* [PATCH 1/7] gdbserver: remove support for LynxOS
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
@ 2020-05-14 17:43 ` Simon Marchi
2020-05-14 17:43 ` [PATCH 2/7] gdbserver: remove support for Neutrino Simon Marchi
` (10 subsequent siblings)
11 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 17:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
This port has been unmaintained for years, remove it.
gdbserver/ChangeLog:
* configure: Re-generate.
* configure.ac: Remove srv_lynxos test.
* configure.srv: Remove lynxos cases.
* lynx-i386-low.cc, lynx-low.cc, lynx-low.h, lynx-ppc-low.c:
Remove.
---
gdbserver/configure | 2 -
gdbserver/configure.ac | 2 -
gdbserver/configure.srv | 13 -
gdbserver/lynx-i386-low.cc | 358 ------------------
gdbserver/lynx-low.cc | 747 -------------------------------------
gdbserver/lynx-low.h | 102 -----
gdbserver/lynx-ppc-low.cc | 185 ---------
7 files changed, 1409 deletions(-)
delete mode 100644 gdbserver/lynx-i386-low.cc
delete mode 100644 gdbserver/lynx-low.cc
delete mode 100644 gdbserver/lynx-low.h
delete mode 100644 gdbserver/lynx-ppc-low.cc
diff --git a/gdbserver/configure b/gdbserver/configure
index 5479823705e5..dc818736b0ec 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -10254,8 +10254,6 @@ elif test "${srv_mingw}" = "yes"; then
LIBS="$LIBS $WIN32APILIBS"
elif test "${srv_qnx}" = "yes"; then
LIBS="$LIBS -lsocket"
-elif test "${srv_lynxos}" = "yes"; then
- LIBS="$LIBS -lnetinet"
fi
if test "${srv_linux_usrregs}" = "yes"; then
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 090a6dcdb6e9..0b1c81d6af54 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -227,8 +227,6 @@ elif test "${srv_mingw}" = "yes"; then
LIBS="$LIBS $WIN32APILIBS"
elif test "${srv_qnx}" = "yes"; then
LIBS="$LIBS -lsocket"
-elif test "${srv_lynxos}" = "yes"; then
- LIBS="$LIBS -lnetinet"
fi
if test "${srv_linux_usrregs}" = "yes"; then
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index 9a027e44af60..24a930624013 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -117,12 +117,6 @@ case "${gdbserver_host}" in
ipa_obj="linux-i386-ipa.o linux-x86-tdesc-ipa.o"
ipa_obj="${ipa_obj} arch/i386-ipa.o"
;;
- i[34567]86-*-lynxos*) srv_regobj=""
- srv_tgtobj="lynx-low.o lynx-i386-low.o fork-child.o"
- srv_tgtobj="${srv_tgtobj} nat/fork-inferior.o"
- srv_tgtobj="${srv_tgtobj} arch/i386.o"
- srv_lynxos=yes
- ;;
i[34567]86-*-mingw32ce*)
srv_regobj=""
srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
@@ -274,13 +268,6 @@ case "${gdbserver_host}" in
srv_linux_thread_db=yes
ipa_obj="${ipa_ppc_linux_regobj} linux-ppc-ipa.o"
;;
- powerpc-*-lynxos*) srv_regobj="powerpc-32.o"
- srv_tgtobj="lynx-low.o lynx-ppc-low.o"
- srv_xmlfiles="rs6000/powerpc-32.xml"
- srv_xmlfiles="${srv_xmlfiles} rs6000/power-core.xml"
- srv_xmlfiles="${srv_xmlfiles} rs6000/power-fpu.xml"
- srv_lynxos=yes
- ;;
riscv*-*-linux*) srv_tgtobj="arch/riscv.o nat/riscv-linux-tdesc.o"
srv_tgtobj="${srv_tgtobj} linux-riscv-low.o"
srv_tgtobj="${srv_tgtobj} ${srv_linux_obj}"
diff --git a/gdbserver/lynx-i386-low.cc b/gdbserver/lynx-i386-low.cc
deleted file mode 100644
index d00e1a167719..000000000000
--- a/gdbserver/lynx-i386-low.cc
+++ /dev/null
@@ -1,358 +0,0 @@
-/* Copyright (C) 2010-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "lynx-low.h"
-#include <limits.h>
-#include <sys/ptrace.h>
-#include "gdbsupport/x86-xstate.h"
-#include "arch/i386.h"
-#include "x86-tdesc.h"
-
-/* The following two typedefs are defined in a .h file which is not
- in the standard include path (/sys/include/family/x86/ucontext.h),
- so we just duplicate them here.
-
- Unfortunately for us, the definition of this structure differs between
- LynxOS 5.x and LynxOS 178. Rather than duplicate the code, we use
- different definitions depending on the target. */
-
-#ifdef VMOS_DEV
-#define LYNXOS_178
-#endif
-
-/* General register context */
-typedef struct usr_econtext {
-
- uint32_t uec_fault;
- uint32_t uec_es;
- uint32_t uec_ds;
- uint32_t uec_edi;
- uint32_t uec_esi;
- uint32_t uec_ebp;
- uint32_t uec_temp;
- uint32_t uec_ebx;
- uint32_t uec_edx;
- uint32_t uec_ecx;
- uint32_t uec_eax;
- uint32_t uec_inum;
- uint32_t uec_ecode;
- uint32_t uec_eip;
- uint32_t uec_cs;
- uint32_t uec_eflags;
- uint32_t uec_esp;
- uint32_t uec_ss;
- uint32_t uec_fs;
- uint32_t uec_gs;
-} usr_econtext_t;
-
-#if defined(LYNXOS_178)
-
-/* Floating point register context */
-typedef struct usr_fcontext {
- uint32_t ufc_control;
- uint32_t ufc_status;
- uint32_t ufc_tag;
- uint8_t *ufc_inst_off;
- uint32_t ufc_inst_sel;
- uint8_t *ufc_data_off;
- uint32_t ufc_data_sel;
- struct ufp387_real {
- uint16_t umant4;
- uint16_t umant3;
- uint16_t umant2;
- uint16_t umant1;
- uint16_t us_and_e;
- } ufc_reg[8];
-} usr_fcontext_t;
-
-#else /* This is LynxOS 5.x. */
-
-/* Floating point and SIMD register context */
-typedef struct usr_fcontext {
- uint16_t ufc_control;
- uint16_t ufc_status;
- uint16_t ufc_tag;
- uint16_t ufc_opcode;
- uint8_t *ufc_inst_off;
- uint32_t ufc_inst_sel;
- uint8_t *ufc_data_off;
- uint32_t ufc_data_sel;
- uint32_t usse_mxcsr;
- uint32_t usse_mxcsr_mask;
- struct ufp387_real {
- uint16_t umant4;
- uint16_t umant3;
- uint16_t umant2;
- uint16_t umant1;
- uint16_t us_and_e;
- uint16_t ureserved_1;
- uint16_t ureserved_2;
- uint16_t ureserved_3;
- } ufc_reg[8];
- struct uxmm_register {
- uint16_t uchunk_1;
- uint16_t uchunk_2;
- uint16_t uchunk_3;
- uint16_t uchunk_4;
- uint16_t uchunk_5;
- uint16_t uchunk_6;
- uint16_t uchunk_7;
- uint16_t uchunk_8;
- } uxmm_reg[8];
- char ureserved[16][14];
-} usr_fcontext_t;
-
-#endif
-
-/* The index of various registers inside the regcache. */
-
-enum lynx_i386_gdb_regnum
-{
- I386_EAX_REGNUM,
- I386_ECX_REGNUM,
- I386_EDX_REGNUM,
- I386_EBX_REGNUM,
- I386_ESP_REGNUM,
- I386_EBP_REGNUM,
- I386_ESI_REGNUM,
- I386_EDI_REGNUM,
- I386_EIP_REGNUM,
- I386_EFLAGS_REGNUM,
- I386_CS_REGNUM,
- I386_SS_REGNUM,
- I386_DS_REGNUM,
- I386_ES_REGNUM,
- I386_FS_REGNUM,
- I386_GS_REGNUM,
- I386_ST0_REGNUM,
- I386_FCTRL_REGNUM = I386_ST0_REGNUM + 8,
- I386_FSTAT_REGNUM,
- I386_FTAG_REGNUM,
- I386_FISEG_REGNUM,
- I386_FIOFF_REGNUM,
- I386_FOSEG_REGNUM,
- I386_FOOFF_REGNUM,
- I386_FOP_REGNUM,
- I386_XMM0_REGNUM = 32,
- I386_MXCSR_REGNUM = I386_XMM0_REGNUM + 8,
- I386_SENTINEL_REGUM
-};
-
-/* The fill_function for the general-purpose register set. */
-
-static void
-lynx_i386_fill_gregset (struct regcache *regcache, char *buf)
-{
-#define lynx_i386_collect_gp(regnum, fld) \
- collect_register (regcache, regnum, \
- buf + offsetof (usr_econtext_t, uec_##fld))
-
- lynx_i386_collect_gp (I386_EAX_REGNUM, eax);
- lynx_i386_collect_gp (I386_ECX_REGNUM, ecx);
- lynx_i386_collect_gp (I386_EDX_REGNUM, edx);
- lynx_i386_collect_gp (I386_EBX_REGNUM, ebx);
- lynx_i386_collect_gp (I386_ESP_REGNUM, esp);
- lynx_i386_collect_gp (I386_EBP_REGNUM, ebp);
- lynx_i386_collect_gp (I386_ESI_REGNUM, esi);
- lynx_i386_collect_gp (I386_EDI_REGNUM, edi);
- lynx_i386_collect_gp (I386_EIP_REGNUM, eip);
- lynx_i386_collect_gp (I386_EFLAGS_REGNUM, eflags);
- lynx_i386_collect_gp (I386_CS_REGNUM, cs);
- lynx_i386_collect_gp (I386_SS_REGNUM, ss);
- lynx_i386_collect_gp (I386_DS_REGNUM, ds);
- lynx_i386_collect_gp (I386_ES_REGNUM, es);
- lynx_i386_collect_gp (I386_FS_REGNUM, fs);
- lynx_i386_collect_gp (I386_GS_REGNUM, gs);
-}
-
-/* The store_function for the general-purpose register set. */
-
-static void
-lynx_i386_store_gregset (struct regcache *regcache, const char *buf)
-{
-#define lynx_i386_supply_gp(regnum, fld) \
- supply_register (regcache, regnum, \
- buf + offsetof (usr_econtext_t, uec_##fld))
-
- lynx_i386_supply_gp (I386_EAX_REGNUM, eax);
- lynx_i386_supply_gp (I386_ECX_REGNUM, ecx);
- lynx_i386_supply_gp (I386_EDX_REGNUM, edx);
- lynx_i386_supply_gp (I386_EBX_REGNUM, ebx);
- lynx_i386_supply_gp (I386_ESP_REGNUM, esp);
- lynx_i386_supply_gp (I386_EBP_REGNUM, ebp);
- lynx_i386_supply_gp (I386_ESI_REGNUM, esi);
- lynx_i386_supply_gp (I386_EDI_REGNUM, edi);
- lynx_i386_supply_gp (I386_EIP_REGNUM, eip);
- lynx_i386_supply_gp (I386_EFLAGS_REGNUM, eflags);
- lynx_i386_supply_gp (I386_CS_REGNUM, cs);
- lynx_i386_supply_gp (I386_SS_REGNUM, ss);
- lynx_i386_supply_gp (I386_DS_REGNUM, ds);
- lynx_i386_supply_gp (I386_ES_REGNUM, es);
- lynx_i386_supply_gp (I386_FS_REGNUM, fs);
- lynx_i386_supply_gp (I386_GS_REGNUM, gs);
-}
-
-/* Extract the first 16 bits of register REGNUM in the REGCACHE,
- and store these 2 bytes at DEST.
-
- This is useful to collect certain 16bit registers which are known
- by GDBserver as 32bit registers (such as the Control Register
- for instance). */
-
-static void
-collect_16bit_register (struct regcache *regcache, int regnum, char *dest)
-{
- gdb_byte word[4];
-
- collect_register (regcache, regnum, word);
- memcpy (dest, word, 2);
-}
-
-/* The fill_function for the floating-point register set. */
-
-static void
-lynx_i386_fill_fpregset (struct regcache *regcache, char *buf)
-{
- int i;
-
- /* Collect %st0 .. %st7. */
- for (i = 0; i < 8; i++)
- collect_register (regcache, I386_ST0_REGNUM + i,
- buf + offsetof (usr_fcontext_t, ufc_reg)
- + i * sizeof (struct ufp387_real));
-
- /* Collect the other FPU registers. */
- collect_16bit_register (regcache, I386_FCTRL_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_control));
- collect_16bit_register (regcache, I386_FSTAT_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_status));
- collect_16bit_register (regcache, I386_FTAG_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_tag));
- collect_register (regcache, I386_FISEG_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_inst_sel));
- collect_register (regcache, I386_FIOFF_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_inst_off));
- collect_register (regcache, I386_FOSEG_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_data_sel));
- collect_register (regcache, I386_FOOFF_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_data_off));
-#if !defined(LYNXOS_178)
- collect_16bit_register (regcache, I386_FOP_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_opcode));
-
- /* Collect the XMM registers. */
- for (i = 0; i < 8; i++)
- collect_register (regcache, I386_XMM0_REGNUM + i,
- buf + offsetof (usr_fcontext_t, uxmm_reg)
- + i * sizeof (struct uxmm_register));
- collect_register (regcache, I386_MXCSR_REGNUM,
- buf + offsetof (usr_fcontext_t, usse_mxcsr));
-#endif
-}
-
-/* This is the supply counterpart for collect_16bit_register:
- It extracts a 2byte value from BUF, and uses that value to
- set REGNUM's value in the regcache.
-
- This is useful to supply the value of certain 16bit registers
- which are known by GDBserver as 32bit registers (such as the Control
- Register for instance). */
-
-static void
-supply_16bit_register (struct regcache *regcache, int regnum, const char *buf)
-{
- gdb_byte word[4];
-
- memcpy (word, buf, 2);
- memset (word + 2, 0, 2);
- supply_register (regcache, regnum, word);
-}
-
-/* The store_function for the floating-point register set. */
-
-static void
-lynx_i386_store_fpregset (struct regcache *regcache, const char *buf)
-{
- int i;
-
- /* Store the %st0 .. %st7 registers. */
- for (i = 0; i < 8; i++)
- supply_register (regcache, I386_ST0_REGNUM + i,
- buf + offsetof (usr_fcontext_t, ufc_reg)
- + i * sizeof (struct ufp387_real));
-
- /* Store the other FPU registers. */
- supply_16bit_register (regcache, I386_FCTRL_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_control));
- supply_16bit_register (regcache, I386_FSTAT_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_status));
- supply_16bit_register (regcache, I386_FTAG_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_tag));
- supply_register (regcache, I386_FISEG_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_inst_sel));
- supply_register (regcache, I386_FIOFF_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_inst_off));
- supply_register (regcache, I386_FOSEG_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_data_sel));
- supply_register (regcache, I386_FOOFF_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_data_off));
-#if !defined(LYNXOS_178)
- supply_16bit_register (regcache, I386_FOP_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_opcode));
-
- /* Store the XMM registers. */
- for (i = 0; i < 8; i++)
- supply_register (regcache, I386_XMM0_REGNUM + i,
- buf + offsetof (usr_fcontext_t, uxmm_reg)
- + i * sizeof (struct uxmm_register));
- supply_register (regcache, I386_MXCSR_REGNUM,
- buf + offsetof (usr_fcontext_t, usse_mxcsr));
-#endif
-}
-
-/* Implements the lynx_target_ops.arch_setup routine. */
-
-static void
-lynx_i386_arch_setup (void)
-{
- struct target_desc *tdesc
- = i386_create_target_description (X86_XSTATE_SSE_MASK, false, false);
-
- init_target_desc (tdesc, i386_expedite_regs);
-
- lynx_tdesc = tdesc;
-}
-
-/* Description of all the x86-lynx register sets. */
-
-struct lynx_regset_info lynx_target_regsets[] = {
- /* General Purpose Registers. */
- {PTRACE_GETREGS, PTRACE_SETREGS, sizeof(usr_econtext_t),
- lynx_i386_fill_gregset, lynx_i386_store_gregset},
- /* Floating Point Registers. */
- { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof(usr_fcontext_t),
- lynx_i386_fill_fpregset, lynx_i386_store_fpregset },
- /* End of list marker. */
- {0, 0, -1, NULL, NULL }
-};
-
-/* The lynx_target_ops vector for x86-lynx. */
-
-struct lynx_target_ops the_low_target = {
- lynx_i386_arch_setup,
-};
diff --git a/gdbserver/lynx-low.cc b/gdbserver/lynx-low.cc
deleted file mode 100644
index 9aa140c12988..000000000000
--- a/gdbserver/lynx-low.cc
+++ /dev/null
@@ -1,747 +0,0 @@
-/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "target.h"
-#include "lynx-low.h"
-
-#include <limits.h>
-#include <sys/ptrace.h>
-#include <sys/piddef.h> /* Provides PIDGET, TIDGET, BUILDPID, etc. */
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include "gdbsupport/gdb_wait.h"
-#include <signal.h>
-#include "gdbsupport/filestuff.h"
-#include "gdbsupport/common-inferior.h"
-#include "nat/fork-inferior.h"
-
-int using_threads = 1;
-
-const struct target_desc *lynx_tdesc;
-
-/* Per-process private data. */
-
-struct process_info_private
-{
- /* The PTID obtained from the last wait performed on this process.
- Initialized to null_ptid until the first wait is performed. */
- ptid_t last_wait_event_ptid;
-};
-
-/* Print a debug trace on standard output if debug_threads is set. */
-
-static void
-lynx_debug (char *string, ...)
-{
- va_list args;
-
- if (!debug_threads)
- return;
-
- va_start (args, string);
- fprintf (stderr, "DEBUG(lynx): ");
- vfprintf (stderr, string, args);
- fprintf (stderr, "\n");
- va_end (args);
-}
-
-/* Build a ptid_t given a PID and a LynxOS TID. */
-
-static ptid_t
-lynx_ptid_t (int pid, long tid)
-{
- /* brobecker/2010-06-21: It looks like the LWP field in ptids
- should be distinct for each thread (see write_ptid where it
- writes the thread ID from the LWP). So instead of storing
- the LynxOS tid in the tid field of the ptid, we store it in
- the lwp field. */
- return ptid_t (pid, tid, 0);
-}
-
-/* Return the process ID of the given PTID.
-
- This function has little reason to exist, it's just a wrapper around
- ptid_get_pid. But since we have a getter function for the lynxos
- ptid, it feels cleaner to have a getter for the pid as well. */
-
-static int
-lynx_ptid_get_pid (ptid_t ptid)
-{
- return ptid.pid ();
-}
-
-/* Return the LynxOS tid of the given PTID. */
-
-static long
-lynx_ptid_get_tid (ptid_t ptid)
-{
- /* See lynx_ptid_t: The LynxOS tid is stored inside the lwp field
- of the ptid. */
- return ptid.lwp ();
-}
-
-/* For a given PTID, return the associated PID as known by the LynxOS
- ptrace layer. */
-
-static int
-lynx_ptrace_pid_from_ptid (ptid_t ptid)
-{
- return BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid));
-}
-
-/* Return a string image of the ptrace REQUEST number. */
-
-static char *
-ptrace_request_to_str (int request)
-{
-#define CASE(X) case X: return #X
- switch (request)
- {
- CASE(PTRACE_TRACEME);
- CASE(PTRACE_PEEKTEXT);
- CASE(PTRACE_PEEKDATA);
- CASE(PTRACE_PEEKUSER);
- CASE(PTRACE_POKETEXT);
- CASE(PTRACE_POKEDATA);
- CASE(PTRACE_POKEUSER);
- CASE(PTRACE_CONT);
- CASE(PTRACE_KILL);
- CASE(PTRACE_SINGLESTEP);
- CASE(PTRACE_ATTACH);
- CASE(PTRACE_DETACH);
- CASE(PTRACE_GETREGS);
- CASE(PTRACE_SETREGS);
- CASE(PTRACE_GETFPREGS);
- CASE(PTRACE_SETFPREGS);
- CASE(PTRACE_READDATA);
- CASE(PTRACE_WRITEDATA);
- CASE(PTRACE_READTEXT);
- CASE(PTRACE_WRITETEXT);
- CASE(PTRACE_GETFPAREGS);
- CASE(PTRACE_SETFPAREGS);
- CASE(PTRACE_GETWINDOW);
- CASE(PTRACE_SETWINDOW);
- CASE(PTRACE_SYSCALL);
- CASE(PTRACE_DUMPCORE);
- CASE(PTRACE_SETWRBKPT);
- CASE(PTRACE_SETACBKPT);
- CASE(PTRACE_CLRBKPT);
- CASE(PTRACE_GET_UCODE);
-#ifdef PT_READ_GPR
- CASE(PT_READ_GPR);
-#endif
-#ifdef PT_WRITE_GPR
- CASE(PT_WRITE_GPR);
-#endif
-#ifdef PT_READ_FPR
- CASE(PT_READ_FPR);
-#endif
-#ifdef PT_WRITE_FPR
- CASE(PT_WRITE_FPR);
-#endif
-#ifdef PT_READ_VPR
- CASE(PT_READ_VPR);
-#endif
-#ifdef PT_WRITE_VPR
- CASE(PT_WRITE_VPR);
-#endif
-#ifdef PTRACE_PEEKUSP
- CASE(PTRACE_PEEKUSP);
-#endif
-#ifdef PTRACE_POKEUSP
- CASE(PTRACE_POKEUSP);
-#endif
- CASE(PTRACE_PEEKTHREAD);
- CASE(PTRACE_THREADUSER);
- CASE(PTRACE_FPREAD);
- CASE(PTRACE_FPWRITE);
- CASE(PTRACE_SETSIG);
- CASE(PTRACE_CONT_ONE);
- CASE(PTRACE_KILL_ONE);
- CASE(PTRACE_SINGLESTEP_ONE);
- CASE(PTRACE_GETLOADINFO);
- CASE(PTRACE_GETTRACESIG);
-#ifdef PTRACE_GETTHREADLIST
- CASE(PTRACE_GETTHREADLIST);
-#endif
- }
-#undef CASE
-
- return "<unknown-request>";
-}
-
-/* A wrapper around ptrace that allows us to print debug traces of
- ptrace calls if debug traces are activated. */
-
-static int
-lynx_ptrace (int request, ptid_t ptid, int addr, int data, int addr2)
-{
- int result;
- const int pid = lynx_ptrace_pid_from_ptid (ptid);
- int saved_errno;
-
- if (debug_threads)
- fprintf (stderr, "PTRACE (%s, pid=%d(pid=%d, tid=%d), addr=0x%x, "
- "data=0x%x, addr2=0x%x)",
- ptrace_request_to_str (request), pid, PIDGET (pid), TIDGET (pid),
- addr, data, addr2);
- result = ptrace (request, pid, addr, data, addr2);
- saved_errno = errno;
- if (debug_threads)
- fprintf (stderr, " -> %d (=0x%x)\n", result, result);
-
- errno = saved_errno;
- return result;
-}
-
-/* Call add_process with the given parameters, and initializes
- the process' private data. */
-
-static struct process_info *
-lynx_add_process (int pid, int attached)
-{
- struct process_info *proc;
-
- proc = add_process (pid, attached);
- proc->tdesc = lynx_tdesc;
- proc->priv = XCNEW (struct process_info_private);
- proc->priv->last_wait_event_ptid = null_ptid;
-
- return proc;
-}
-
-/* Callback used by fork_inferior to start tracing the inferior. */
-
-static void
-lynx_ptrace_fun ()
-{
- int pgrp;
-
- /* Switch child to its own process group so that signals won't
- directly affect GDBserver. */
- pgrp = getpid();
- if (pgrp < 0)
- trace_start_error_with_name ("pgrp");
- if (setpgid (0, pgrp) < 0)
- trace_start_error_with_name ("setpgid");
- if (ioctl (0, TIOCSPGRP, &pgrp) < 0)
- trace_start_error_with_name ("ioctl");
- if (lynx_ptrace (PTRACE_TRACEME, null_ptid, 0, 0, 0) < 0)
- trace_start_error_with_name ("lynx_ptrace");
-}
-
-/* Implement the create_inferior method of the target_ops vector. */
-
-int
-lynx_process_target::create_inferior (const char *program,
- const std::vector<char *> &program_args)
-{
- int pid;
- std::string str_program_args = stringify_argv (program_args);
-
- lynx_debug ("create_inferior ()");
-
- pid = fork_inferior (program,
- str_program_args.c_str (),
- get_environ ()->envp (), lynx_ptrace_fun,
- NULL, NULL, NULL, NULL);
-
- post_fork_inferior (pid, program);
-
- lynx_add_process (pid, 0);
- /* Do not add the process thread just yet, as we do not know its tid.
- We will add it later, during the wait for the STOP event corresponding
- to the lynx_ptrace (PTRACE_TRACEME) call above. */
- return pid;
-}
-
-/* Assuming we've just attached to a running inferior whose pid is PID,
- add all threads running in that process. */
-
-static void
-lynx_add_threads_after_attach (int pid)
-{
- /* Ugh! There appears to be no way to get the list of threads
- in the program we just attached to. So get the list by calling
- the "ps" command. This is only needed now, as we will then
- keep the thread list up to date thanks to thread creation and
- exit notifications. */
- FILE *f;
- char buf[256];
- int thread_pid, thread_tid;
-
- f = popen ("ps atx", "r");
- if (f == NULL)
- perror_with_name ("Cannot get thread list");
-
- while (fgets (buf, sizeof (buf), f) != NULL)
- if ((sscanf (buf, "%d %d", &thread_pid, &thread_tid) == 2
- && thread_pid == pid))
- {
- ptid_t thread_ptid = lynx_ptid_t (pid, thread_tid);
-
- if (!find_thread_ptid (thread_ptid))
- {
- lynx_debug ("New thread: (pid = %d, tid = %d)",
- pid, thread_tid);
- add_thread (thread_ptid, NULL);
- }
- }
-
- pclose (f);
-}
-
-/* Implement the attach target_ops method. */
-
-int
-lynx_process_target::attach (unsigned long pid)
-{
- ptid_t ptid = lynx_ptid_t (pid, 0);
-
- if (lynx_ptrace (PTRACE_ATTACH, ptid, 0, 0, 0) != 0)
- error ("Cannot attach to process %lu: %s (%d)\n", pid,
- safe_strerror (errno), errno);
-
- lynx_add_process (pid, 1);
- lynx_add_threads_after_attach (pid);
-
- return 0;
-}
-
-/* Implement the resume target_ops method. */
-
-void
-lynx_process_target::resume (thread_resume *resume_info, size_t n)
-{
- ptid_t ptid = resume_info[0].thread;
- const int request
- = (resume_info[0].kind == resume_step
- ? (n == 1 ? PTRACE_SINGLESTEP_ONE : PTRACE_SINGLESTEP)
- : PTRACE_CONT);
- const int signal = resume_info[0].sig;
-
- /* If given a minus_one_ptid, then try using the current_process'
- private->last_wait_event_ptid. On most LynxOS versions,
- using any of the process' thread works well enough, but
- LynxOS 178 is a little more sensitive, and triggers some
- unexpected signals (Eg SIG61) when we resume the inferior
- using a different thread. */
- if (ptid == minus_one_ptid)
- ptid = current_process()->priv->last_wait_event_ptid;
-
- /* The ptid might still be minus_one_ptid; this can happen between
- the moment we create the inferior or attach to a process, and
- the moment we resume its execution for the first time. It is
- fine to use the current_thread's ptid in those cases. */
- if (ptid == minus_one_ptid)
- ptid = ptid_of (current_thread);
-
- regcache_invalidate_pid (ptid.pid ());
-
- errno = 0;
- lynx_ptrace (request, ptid, 1, signal, 0);
- if (errno)
- perror_with_name ("ptrace");
-}
-
-/* Resume the execution of the given PTID. */
-
-static void
-lynx_continue (ptid_t ptid)
-{
- struct thread_resume resume_info;
-
- resume_info.thread = ptid;
- resume_info.kind = resume_continue;
- resume_info.sig = 0;
-
- lynx_resume (&resume_info, 1);
-}
-
-/* A wrapper around waitpid that handles the various idiosyncrasies
- of LynxOS' waitpid. */
-
-static int
-lynx_waitpid (int pid, int *stat_loc)
-{
- int ret = 0;
-
- while (1)
- {
- ret = waitpid (pid, stat_loc, WNOHANG);
- if (ret < 0)
- {
- /* An ECHILD error is not indicative of a real problem.
- It happens for instance while waiting for the inferior
- to stop after attaching to it. */
- if (errno != ECHILD)
- perror_with_name ("waitpid (WNOHANG)");
- }
- if (ret > 0)
- break;
- /* No event with WNOHANG. See if there is one with WUNTRACED. */
- ret = waitpid (pid, stat_loc, WNOHANG | WUNTRACED);
- if (ret < 0)
- {
- /* An ECHILD error is not indicative of a real problem.
- It happens for instance while waiting for the inferior
- to stop after attaching to it. */
- if (errno != ECHILD)
- perror_with_name ("waitpid (WNOHANG|WUNTRACED)");
- }
- if (ret > 0)
- break;
- usleep (1000);
- }
- return ret;
-}
-
-/* Implement the wait target_ops method. */
-
-static ptid_t
-lynx_wait_1 (ptid_t ptid, struct target_waitstatus *status, int options)
-{
- int pid;
- int ret;
- int wstat;
- ptid_t new_ptid;
-
- if (ptid == minus_one_ptid)
- pid = lynx_ptid_get_pid (ptid_of (current_thread));
- else
- pid = BUILDPID (lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid));
-
-retry:
-
- ret = lynx_waitpid (pid, &wstat);
- new_ptid = lynx_ptid_t (ret, ((union wait *) &wstat)->w_tid);
- find_process_pid (ret)->priv->last_wait_event_ptid = new_ptid;
-
- /* If this is a new thread, then add it now. The reason why we do
- this here instead of when handling new-thread events is because
- we need to add the thread associated to the "main" thread - even
- for non-threaded applications where the new-thread events are not
- generated. */
- if (!find_thread_ptid (new_ptid))
- {
- lynx_debug ("New thread: (pid = %d, tid = %d)",
- lynx_ptid_get_pid (new_ptid), lynx_ptid_get_tid (new_ptid));
- add_thread (new_ptid, NULL);
- }
-
- if (WIFSTOPPED (wstat))
- {
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.integer = gdb_signal_from_host (WSTOPSIG (wstat));
- lynx_debug ("process stopped with signal: %d",
- status->value.integer);
- }
- else if (WIFEXITED (wstat))
- {
- status->kind = TARGET_WAITKIND_EXITED;
- status->value.integer = WEXITSTATUS (wstat);
- lynx_debug ("process exited with code: %d", status->value.integer);
- }
- else if (WIFSIGNALED (wstat))
- {
- status->kind = TARGET_WAITKIND_SIGNALLED;
- status->value.integer = gdb_signal_from_host (WTERMSIG (wstat));
- lynx_debug ("process terminated with code: %d",
- status->value.integer);
- }
- else
- {
- /* Not sure what happened if we get here, or whether we can
- in fact get here. But if we do, handle the event the best
- we can. */
- status->kind = TARGET_WAITKIND_STOPPED;
- status->value.integer = gdb_signal_from_host (0);
- lynx_debug ("unknown event ????");
- }
-
- /* SIGTRAP events are generated for situations other than single-step/
- breakpoint events (Eg. new-thread events). Handle those other types
- of events, and resume the execution if necessary. */
- if (status->kind == TARGET_WAITKIND_STOPPED
- && status->value.integer == GDB_SIGNAL_TRAP)
- {
- const int realsig = lynx_ptrace (PTRACE_GETTRACESIG, new_ptid, 0, 0, 0);
-
- lynx_debug ("(realsig = %d)", realsig);
- switch (realsig)
- {
- case SIGNEWTHREAD:
- /* We just added the new thread above. No need to do anything
- further. Just resume the execution again. */
- lynx_continue (new_ptid);
- goto retry;
-
- case SIGTHREADEXIT:
- remove_thread (find_thread_ptid (new_ptid));
- lynx_continue (new_ptid);
- goto retry;
- }
- }
-
- return new_ptid;
-}
-
-/* A wrapper around lynx_wait_1 that also prints debug traces when
- such debug traces have been activated. */
-
-ptid_t
-lynx_process_target::wait (ptid_t ptid, target_waitstatus *status,
- int options)
-{
- ptid_t new_ptid;
-
- lynx_debug ("wait (pid = %d, tid = %ld)",
- lynx_ptid_get_pid (ptid), lynx_ptid_get_tid (ptid));
- new_ptid = lynx_wait_1 (ptid, status, options);
- lynx_debug (" -> (pid=%d, tid=%ld, status->kind = %d)",
- lynx_ptid_get_pid (new_ptid), lynx_ptid_get_tid (new_ptid),
- status->kind);
- return new_ptid;
-}
-
-/* Implement the kill target_ops method. */
-
-int
-lynx_process_target::kill (process_info *process)
-{
- ptid_t ptid = lynx_ptid_t (process->pid, 0);
- struct target_waitstatus status;
-
- lynx_ptrace (PTRACE_KILL, ptid, 0, 0, 0);
- lynx_wait (ptid, &status, 0);
- mourn (process);
- return 0;
-}
-
-/* Implement the detach target_ops method. */
-
-int
-lynx_process_target::detach (process_info *process)
-{
- ptid_t ptid = lynx_ptid_t (process->pid, 0);
-
- lynx_ptrace (PTRACE_DETACH, ptid, 0, 0, 0);
- mourn (process);
- return 0;
-}
-
-/* Implement the mourn target_ops method. */
-
-void
-lynx_process_target::mourn (struct process_info *proc)
-{
- for_each_thread (proc->pid, remove_thread);
-
- /* Free our private data. */
- free (proc->priv);
- proc->priv = NULL;
-
- remove_process (proc);
-}
-
-/* Implement the join target_ops method. */
-
-void
-lynx_process_target::join (int pid)
-{
- /* The PTRACE_DETACH is sufficient to detach from the process.
- So no need to do anything extra. */
-}
-
-/* Implement the thread_alive target_ops method. */
-
-bool
-lynx_process_target::thread_alive (ptid_t ptid)
-{
- /* The list of threads is updated at the end of each wait, so it
- should be up to date. No need to re-fetch it. */
- return (find_thread_ptid (ptid) != NULL);
-}
-
-/* Implement the fetch_registers target_ops method. */
-
-void
-lynx_process_target::fetch_registers (regcache *regcache, int regno)
-{
- struct lynx_regset_info *regset = lynx_target_regsets;
- ptid_t inferior_ptid = ptid_of (current_thread);
-
- lynx_debug ("fetch_registers (regno = %d)", regno);
-
- while (regset->size >= 0)
- {
- char *buf;
- int res;
-
- buf = xmalloc (regset->size);
- res = lynx_ptrace (regset->get_request, inferior_ptid, (int) buf, 0, 0);
- if (res < 0)
- perror ("ptrace");
- regset->store_function (regcache, buf);
- free (buf);
- regset++;
- }
-}
-
-/* Implement the store_registers target_ops method. */
-
-void
-lynx_process_target::store_registers (regcache *regcache, int regno)
-{
- struct lynx_regset_info *regset = lynx_target_regsets;
- ptid_t inferior_ptid = ptid_of (current_thread);
-
- lynx_debug ("store_registers (regno = %d)", regno);
-
- while (regset->size >= 0)
- {
- char *buf;
- int res;
-
- buf = xmalloc (regset->size);
- res = lynx_ptrace (regset->get_request, inferior_ptid, (int) buf, 0, 0);
- if (res == 0)
- {
- /* Then overlay our cached registers on that. */
- regset->fill_function (regcache, buf);
- /* Only now do we write the register set. */
- res = lynx_ptrace (regset->set_request, inferior_ptid, (int) buf,
- 0, 0);
- }
- if (res < 0)
- perror ("ptrace");
- free (buf);
- regset++;
- }
-}
-
-/* Implement the read_memory target_ops method. */
-
-int
-lynx_process_target::read_memory (CORE_ADDR memaddr, unsigned char *myaddr,
- int len)
-{
- /* On LynxOS, memory reads needs to be performed in chunks the size
- of int types, and they should also be aligned accordingly. */
- int buf;
- const int xfer_size = sizeof (buf);
- CORE_ADDR addr = memaddr & -(CORE_ADDR) xfer_size;
- ptid_t inferior_ptid = ptid_of (current_thread);
-
- while (addr < memaddr + len)
- {
- int skip = 0;
- int truncate = 0;
-
- errno = 0;
- if (addr < memaddr)
- skip = memaddr - addr;
- if (addr + xfer_size > memaddr + len)
- truncate = addr + xfer_size - memaddr - len;
- buf = lynx_ptrace (PTRACE_PEEKTEXT, inferior_ptid, addr, 0, 0);
- if (errno)
- return errno;
- memcpy (myaddr + (addr - memaddr) + skip, (gdb_byte *) &buf + skip,
- xfer_size - skip - truncate);
- addr += xfer_size;
- }
-
- return 0;
-}
-
-/* Implement the write_memory target_ops method. */
-
-int
-lynx_process_target::write_memory (CORE_ADDR memaddr,
- const unsigned char *myaddr, int len)
-{
- /* On LynxOS, memory writes needs to be performed in chunks the size
- of int types, and they should also be aligned accordingly. */
- int buf;
- const int xfer_size = sizeof (buf);
- CORE_ADDR addr = memaddr & -(CORE_ADDR) xfer_size;
- ptid_t inferior_ptid = ptid_of (current_thread);
-
- while (addr < memaddr + len)
- {
- int skip = 0;
- int truncate = 0;
-
- if (addr < memaddr)
- skip = memaddr - addr;
- if (addr + xfer_size > memaddr + len)
- truncate = addr + xfer_size - memaddr - len;
- if (skip > 0 || truncate > 0)
- {
- /* We need to read the memory at this address in order to preserve
- the data that we are not overwriting. */
- read_memory (addr, (unsigned char *) &buf, xfer_size);
- if (errno)
- return errno;
- }
- memcpy ((gdb_byte *) &buf + skip, myaddr + (addr - memaddr) + skip,
- xfer_size - skip - truncate);
- errno = 0;
- lynx_ptrace (PTRACE_POKETEXT, inferior_ptid, addr, buf, 0);
- if (errno)
- return errno;
- addr += xfer_size;
- }
-
- return 0;
-}
-
-/* Implement the kill_request target_ops method. */
-
-void
-lynx_process_target::request_interrupt ()
-{
- ptid_t inferior_ptid = ptid_of (get_first_thread ());
-
- kill (lynx_ptid_get_pid (inferior_ptid), SIGINT);
-}
-
-bool
-lynx_process_target::supports_hardware_single_step ()
-{
- return true;
-}
-
-const gdb_byte *
-lynx_process_target::sw_breakpoint_from_kind (int kind, int *size)
-{
- error (_("Target does not implement the sw_breakpoint_from_kind op"));
-}
-
-/* The LynxOS target ops object. */
-
-static lynx_process_target the_lynx_target;
-
-void
-initialize_low (void)
-{
- set_target_ops (&the_lynx_target);
- the_low_target.arch_setup ();
-}
-
diff --git a/gdbserver/lynx-low.h b/gdbserver/lynx-low.h
deleted file mode 100644
index fa975a21f30c..000000000000
--- a/gdbserver/lynx-low.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Copyright (C) 2010-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef GDBSERVER_LYNX_LOW_H
-#define GDBSERVER_LYNX_LOW_H
-
-struct regcache;
-struct target_desc;
-
-/* Some information relative to a given register set. */
-
-struct lynx_regset_info
-{
- /* The ptrace request needed to get/set registers of this set. */
- int get_request, set_request;
- /* The size of the register set. */
- int size;
- /* Fill the buffer BUF from the contents of the given REGCACHE. */
- void (*fill_function) (struct regcache *regcache, char *buf);
- /* Store the register value in BUF in the given REGCACHE. */
- void (*store_function) (struct regcache *regcache, const char *buf);
-};
-
-/* A list of regsets for the target being debugged, terminated by an entry
- where the size is negative.
-
- This list should be created by the target-specific code. */
-
-extern struct lynx_regset_info lynx_target_regsets[];
-
-/* The target-specific operations for LynxOS support. */
-
-struct lynx_target_ops
-{
- /* Architecture-specific setup. */
- void (*arch_setup) (void);
-};
-
-extern struct lynx_target_ops the_low_target;
-
-/* Target ops definitions for a LynxOS target. */
-
-class lynx_process_target : public process_stratum_target
-{
-public:
-
- int create_inferior (const char *program,
- const std::vector<char *> &program_args) override;
-
- int attach (unsigned long pid) override;
-
- int kill (process_info *proc) override;
-
- int detach (process_info *proc) override;
-
- void mourn (process_info *proc) override;
-
- void join (int pid) override;
-
- bool thread_alive (ptid_t pid) override;
-
- void resume (thread_resume *resume_info, size_t n) override;
-
- ptid_t wait (ptid_t ptid, target_waitstatus *status,
- int options) override;
-
- void fetch_registers (regcache *regcache, int regno) override;
-
- void store_registers (regcache *regcache, int regno) override;
-
- int read_memory (CORE_ADDR memaddr, unsigned char *myaddr,
- int len) override;
-
- int write_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
- int len) override;
-
- void request_interrupt () override;
-
- bool supports_hardware_single_step () override;
-
- const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-};
-
-/* The inferior's target description. This is a global because the
- LynxOS ports support neither bi-arch nor multi-process. */
-extern const struct target_desc *lynx_tdesc;
-
-#endif /* GDBSERVER_LYNX_LOW_H */
diff --git a/gdbserver/lynx-ppc-low.cc b/gdbserver/lynx-ppc-low.cc
deleted file mode 100644
index f93fc1d8d87f..000000000000
--- a/gdbserver/lynx-ppc-low.cc
+++ /dev/null
@@ -1,185 +0,0 @@
-/* Copyright (C) 2009-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "lynx-low.h"
-#include <limits.h>
-#include <sys/ptrace.h>
-
-/* The following two typedefs are defined in a .h file which is not
- in the standard include path (/sys/include/family/ppc/ucontext.h),
- so we just duplicate them here. */
-
-/* General register context */
-typedef struct usr_econtext_s
-{
- uint32_t uec_iregs[32];
- uint32_t uec_inum;
- uint32_t uec_srr0;
- uint32_t uec_srr1;
- uint32_t uec_lr;
- uint32_t uec_ctr;
- uint32_t uec_cr;
- uint32_t uec_xer;
- uint32_t uec_dar;
- uint32_t uec_mq;
- uint32_t uec_msr;
- uint32_t uec_sregs[16];
- uint32_t uec_ss_count;
- uint32_t uec_ss_addr1;
- uint32_t uec_ss_addr2;
- uint32_t uec_ss_code1;
- uint32_t uec_ss_code2;
-} usr_econtext_t;
-
-/* Floating point register context */
-typedef struct usr_fcontext_s
-{
- uint64_t ufc_freg[32];
- uint32_t ufc_fpscr[2];
-} usr_fcontext_t;
-
-/* Index of for various registers inside the regcache. */
-#define R0_REGNUM 0
-#define F0_REGNUM 32
-#define PC_REGNUM 64
-#define MSR_REGNUM 65
-#define CR_REGNUM 66
-#define LR_REGNUM 67
-#define CTR_REGNUM 68
-#define XER_REGNUM 69
-#define FPSCR_REGNUM 70
-
-/* Defined in auto-generated file powerpc-32.c. */
-extern void init_registers_powerpc_32 (void);
-extern const struct target_desc *tdesc_powerpc_32;
-
-/* The fill_function for the general-purpose register set. */
-
-static void
-lynx_ppc_fill_gregset (struct regcache *regcache, char *buf)
-{
- int i;
-
- /* r0 - r31 */
- for (i = 0; i < 32; i++)
- collect_register (regcache, R0_REGNUM + i,
- buf + offsetof (usr_econtext_t, uec_iregs[i]));
-
- /* The other registers provided in the GP register context. */
- collect_register (regcache, PC_REGNUM,
- buf + offsetof (usr_econtext_t, uec_srr0));
- collect_register (regcache, MSR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_srr1));
- collect_register (regcache, CR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_cr));
- collect_register (regcache, LR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_lr));
- collect_register (regcache, CTR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_ctr));
- collect_register (regcache, XER_REGNUM,
- buf + offsetof (usr_econtext_t, uec_xer));
-}
-
-/* The store_function for the general-purpose register set. */
-
-static void
-lynx_ppc_store_gregset (struct regcache *regcache, const char *buf)
-{
- int i;
-
- /* r0 - r31 */
- for (i = 0; i < 32; i++)
- supply_register (regcache, R0_REGNUM + i,
- buf + offsetof (usr_econtext_t, uec_iregs[i]));
-
- /* The other registers provided in the GP register context. */
- supply_register (regcache, PC_REGNUM,
- buf + offsetof (usr_econtext_t, uec_srr0));
- supply_register (regcache, MSR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_srr1));
- supply_register (regcache, CR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_cr));
- supply_register (regcache, LR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_lr));
- supply_register (regcache, CTR_REGNUM,
- buf + offsetof (usr_econtext_t, uec_ctr));
- supply_register (regcache, XER_REGNUM,
- buf + offsetof (usr_econtext_t, uec_xer));
-}
-
-/* The fill_function for the floating-point register set. */
-
-static void
-lynx_ppc_fill_fpregset (struct regcache *regcache, char *buf)
-{
- int i;
-
- /* f0 - f31 */
- for (i = 0; i < 32; i++)
- collect_register (regcache, F0_REGNUM + i,
- buf + offsetof (usr_fcontext_t, ufc_freg[i]));
-
- /* fpscr */
- collect_register (regcache, FPSCR_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_fpscr));
-}
-
-/* The store_function for the floating-point register set. */
-
-static void
-lynx_ppc_store_fpregset (struct regcache *regcache, const char *buf)
-{
- int i;
-
- /* f0 - f31 */
- for (i = 0; i < 32; i++)
- supply_register (regcache, F0_REGNUM + i,
- buf + offsetof (usr_fcontext_t, ufc_freg[i]));
-
- /* fpscr */
- supply_register (regcache, FPSCR_REGNUM,
- buf + offsetof (usr_fcontext_t, ufc_fpscr));
-}
-
-/* Implements the lynx_target_ops.arch_setup routine. */
-
-static void
-lynx_ppc_arch_setup (void)
-{
- init_registers_powerpc_32 ();
- lynx_tdesc = tdesc_powerpc_32;
-}
-
-/* Description of all the powerpc-lynx register sets. */
-
-struct lynx_regset_info lynx_target_regsets[] = {
- /* General Purpose Registers. */
- {PTRACE_GETREGS, PTRACE_SETREGS, sizeof(usr_econtext_t),
- lynx_ppc_fill_gregset, lynx_ppc_store_gregset},
- /* Floating Point Registers. */
- { PTRACE_GETFPREGS, PTRACE_SETFPREGS, sizeof(usr_fcontext_t),
- lynx_ppc_fill_fpregset, lynx_ppc_store_fpregset },
- /* End of list marker. */
- {0, 0, -1, NULL, NULL }
-};
-
-/* The lynx_target_ops vector for powerpc-lynxos. */
-
-struct lynx_target_ops the_low_target = {
- lynx_ppc_arch_setup,
-};
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 2/7] gdbserver: remove support for Neutrino
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
2020-05-14 17:43 ` [PATCH 1/7] gdbserver: remove support for LynxOS Simon Marchi
@ 2020-05-14 17:43 ` Simon Marchi
2020-05-14 17:43 ` [PATCH 3/7] gdbserver: remove support for Blackfin Simon Marchi
` (9 subsequent siblings)
11 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 17:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
This port has been unmaintained for years, remove it.
gdbserver/ChangeLog:
* configure: Re-generate.
* configure.ac: Remove srv_qnx test.
* configure.srv: Remove nto case.
* nto-low.cc, nto-low.h, nto-x86-low.cc: Remove.
* remote-utils.c: Remove __QNX__-guarded code.
---
gdbserver/configure | 2 -
gdbserver/configure.ac | 2 -
gdbserver/configure.srv | 4 -
gdbserver/nto-low.cc | 966 --------------------------------------
gdbserver/nto-low.h | 109 -----
gdbserver/nto-x86-low.cc | 109 -----
gdbserver/remote-utils.cc | 33 --
7 files changed, 1225 deletions(-)
delete mode 100644 gdbserver/nto-low.cc
delete mode 100644 gdbserver/nto-low.h
delete mode 100644 gdbserver/nto-x86-low.cc
diff --git a/gdbserver/configure b/gdbserver/configure
index dc818736b0ec..0f77ac6cb8dd 100755
--- a/gdbserver/configure
+++ b/gdbserver/configure
@@ -10252,8 +10252,6 @@ if test "${srv_mingwce}" = "yes"; then
elif test "${srv_mingw}" = "yes"; then
# WIN32APILIBS is set by GDB_AC_COMMON.
LIBS="$LIBS $WIN32APILIBS"
-elif test "${srv_qnx}" = "yes"; then
- LIBS="$LIBS -lsocket"
fi
if test "${srv_linux_usrregs}" = "yes"; then
diff --git a/gdbserver/configure.ac b/gdbserver/configure.ac
index 0b1c81d6af54..10f2f4c0cb07 100644
--- a/gdbserver/configure.ac
+++ b/gdbserver/configure.ac
@@ -225,8 +225,6 @@ if test "${srv_mingwce}" = "yes"; then
elif test "${srv_mingw}" = "yes"; then
# WIN32APILIBS is set by GDB_AC_COMMON.
LIBS="$LIBS $WIN32APILIBS"
-elif test "${srv_qnx}" = "yes"; then
- LIBS="$LIBS -lsocket"
fi
if test "${srv_linux_usrregs}" = "yes"; then
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index 24a930624013..0a3bf32dd18c 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -136,10 +136,6 @@ case "${gdbserver_host}" in
srv_tgtobj="${srv_tgtobj} arch/i386.o"
srv_mingw=yes
;;
- i[34567]86-*-nto*) srv_regobj=""
- srv_tgtobj="nto-low.o nto-x86-low.o arch/i386.o"
- srv_qnx="yes"
- ;;
ia64-*-linux*) srv_regobj=reg-ia64.o
srv_tgtobj="$srv_linux_obj linux-ia64-low.o"
srv_linux_usrregs=yes
diff --git a/gdbserver/nto-low.cc b/gdbserver/nto-low.cc
deleted file mode 100644
index 642fe9ffd213..000000000000
--- a/gdbserver/nto-low.cc
+++ /dev/null
@@ -1,966 +0,0 @@
-/* QNX Neutrino specific low level interface, for the remote server
- for GDB.
- Copyright (C) 2009-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-
-#include "server.h"
-#include "gdbthread.h"
-#include "nto-low.h"
-#include "hostio.h"
-#include "debug.h"
-
-#include <limits.h>
-#include <fcntl.h>
-#include <spawn.h>
-#include <sys/procfs.h>
-#include <sys/auxv.h>
-#include <sys/iomgr.h>
-#include <sys/neutrino.h>
-
-
-int using_threads = 1;
-
-const struct target_desc *nto_tdesc;
-
-static void
-nto_trace (const char *fmt, ...)
-{
- va_list arg_list;
-
- if (debug_threads == 0)
- return;
- fprintf (stderr, "nto:");
- va_start (arg_list, fmt);
- vfprintf (stderr, fmt, arg_list);
- va_end (arg_list);
-}
-
-#define TRACE nto_trace
-
-/* Structure holding neutrino specific information about
- inferior. */
-
-struct nto_inferior
-{
- char nto_procfs_path[PATH_MAX];
- int ctl_fd;
- pid_t pid;
- int exit_signo; /* For tracking exit status. */
-};
-
-static struct nto_inferior nto_inferior;
-
-static void
-init_nto_inferior (struct nto_inferior *nto_inferior)
-{
- memset (nto_inferior, 0, sizeof (struct nto_inferior));
- nto_inferior->ctl_fd = -1;
- nto_inferior->pid = -1;
-}
-
-static void
-do_detach (void)
-{
- if (nto_inferior.ctl_fd != -1)
- {
- nto_trace ("Closing fd\n");
- close (nto_inferior.ctl_fd);
- init_nto_inferior (&nto_inferior);
- }
-}
-
-/* Set current thread. Return 1 on success, 0 otherwise. */
-
-static int
-nto_set_thread (ptid_t ptid)
-{
- int res = 0;
-
- TRACE ("%s pid: %d tid: %ld\n", __func__, ptid.pid (),
- ptid.lwp ());
- if (nto_inferior.ctl_fd != -1
- && ptid != null_ptid
- && ptid != minus_one_ptid)
- {
- pthread_t tid = ptid.lwp ();
-
- if (EOK == devctl (nto_inferior.ctl_fd, DCMD_PROC_CURTHREAD, &tid,
- sizeof (tid), 0))
- res = 1;
- else
- TRACE ("%s: Error: failed to set current thread\n", __func__);
- }
- return res;
-}
-
-/* This function will determine all alive threads. Note that we do not list
- dead but unjoined threads even though they are still in the process' thread
- list.
-
- NTO_INFERIOR must not be NULL. */
-
-static void
-nto_find_new_threads (struct nto_inferior *nto_inferior)
-{
- pthread_t tid;
-
- TRACE ("%s pid:%d\n", __func__, nto_inferior->pid);
-
- if (nto_inferior->ctl_fd == -1)
- return;
-
- for (tid = 1;; ++tid)
- {
- procfs_status status;
- ptid_t ptid;
- int err;
-
- status.tid = tid;
- err = devctl (nto_inferior->ctl_fd, DCMD_PROC_TIDSTATUS, &status,
- sizeof (status), 0);
-
- if (err != EOK || status.tid == 0)
- break;
-
- /* All threads in between are gone. */
- while (tid != status.tid || status.state == STATE_DEAD)
- {
- struct thread_info *ti;
-
- ptid = ptid_t (nto_inferior->pid, tid, 0);
- ti = find_thread_ptid (ptid);
- if (ti != NULL)
- {
- TRACE ("Removing thread %d\n", tid);
- remove_thread (ti);
- }
- if (tid == status.tid)
- break;
- ++tid;
- }
-
- if (status.state != STATE_DEAD)
- {
- TRACE ("Adding thread %d\n", tid);
- ptid = ptid_t (nto_inferior->pid, tid, 0);
- if (!find_thread_ptid (ptid))
- add_thread (ptid, NULL);
- }
- }
-}
-
-/* Given pid, open procfs path. */
-
-static pid_t
-do_attach (pid_t pid)
-{
- procfs_status status;
- struct sigevent event;
-
- if (nto_inferior.ctl_fd != -1)
- {
- close (nto_inferior.ctl_fd);
- init_nto_inferior (&nto_inferior);
- }
- xsnprintf (nto_inferior.nto_procfs_path, PATH_MAX - 1, "/proc/%d/as", pid);
- nto_inferior.ctl_fd = open (nto_inferior.nto_procfs_path, O_RDWR);
- if (nto_inferior.ctl_fd == -1)
- {
- TRACE ("Failed to open %s\n", nto_inferior.nto_procfs_path);
- init_nto_inferior (&nto_inferior);
- return -1;
- }
- if (devctl (nto_inferior.ctl_fd, DCMD_PROC_STOP, &status, sizeof (status), 0)
- != EOK)
- {
- do_detach ();
- return -1;
- }
- nto_inferior.pid = pid;
- /* Define a sigevent for process stopped notification. */
- event.sigev_notify = SIGEV_SIGNAL_THREAD;
- event.sigev_signo = SIGUSR1;
- event.sigev_code = 0;
- event.sigev_value.sival_ptr = NULL;
- event.sigev_priority = -1;
- devctl (nto_inferior.ctl_fd, DCMD_PROC_EVENT, &event, sizeof (event), 0);
-
- if (devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status),
- 0) == EOK
- && (status.flags & _DEBUG_FLAG_STOPPED))
- {
- ptid_t ptid;
- struct process_info *proc;
-
- kill (pid, SIGCONT);
- ptid = ptid_t (status.pid, status.tid, 0);
- the_low_target.arch_setup ();
- proc = add_process (status.pid, 1);
- proc->tdesc = nto_tdesc;
- TRACE ("Adding thread: pid=%d tid=%ld\n", status.pid,
- ptid.lwp ());
- nto_find_new_threads (&nto_inferior);
- }
- else
- {
- do_detach ();
- return -1;
- }
-
- return pid;
-}
-
-/* Read or write LEN bytes from/to inferior's MEMADDR memory address
- into gdbservers's MYADDR buffer. Return number of bytes actually
- transfered. */
-
-static int
-nto_xfer_memory (off_t memaddr, unsigned char *myaddr, int len,
- int dowrite)
-{
- int nbytes = 0;
-
- if (lseek (nto_inferior.ctl_fd, memaddr, SEEK_SET) == memaddr)
- {
- if (dowrite)
- nbytes = write (nto_inferior.ctl_fd, myaddr, len);
- else
- nbytes = read (nto_inferior.ctl_fd, myaddr, len);
- if (nbytes < 0)
- nbytes = 0;
- }
- if (nbytes == 0)
- {
- int e = errno;
- TRACE ("Error in %s : errno=%d (%s)\n", __func__, e, safe_strerror (e));
- }
- return nbytes;
-}
-
-/* Insert or remove breakpoint or watchpoint at address ADDR.
- TYPE can be one of Neutrino breakpoint types. SIZE must be 0 for
- inserting the point, -1 for removing it.
-
- Return 0 on success, 1 otherwise. */
-
-static int
-nto_breakpoint (CORE_ADDR addr, int type, int size)
-{
- procfs_break brk;
-
- brk.type = type;
- brk.addr = addr;
- brk.size = size;
- if (devctl (nto_inferior.ctl_fd, DCMD_PROC_BREAK, &brk, sizeof (brk), 0)
- != EOK)
- return 1;
- return 0;
-}
-
-/* Read auxiliary vector from inferior's initial stack into gdbserver's
- MYADDR buffer, up to LEN bytes.
-
- Return number of bytes read. */
-
-static int
-nto_read_auxv_from_initial_stack (CORE_ADDR initial_stack,
- unsigned char *myaddr,
- unsigned int len)
-{
- int data_ofs = 0;
- int anint;
- unsigned int len_read = 0;
-
- /* Skip over argc, argv and envp... Comment from ldd.c:
-
- The startup frame is set-up so that we have:
- auxv
- NULL
- ...
- envp2
- envp1 <----- void *frame + (argc + 2) * sizeof(char *)
- NULL
- ...
- argv2
- argv1
- argc <------ void * frame
-
- On entry to ldd, frame gives the address of argc on the stack. */
- if (nto_xfer_memory (initial_stack, (unsigned char *)&anint,
- sizeof (anint), 0) != sizeof (anint))
- return 0;
-
- /* Size of pointer is assumed to be 4 bytes (32 bit arch. ) */
- data_ofs += (anint + 2) * sizeof (void *); /* + 2 comes from argc itself and
- NULL terminating pointer in
- argv. */
-
- /* Now loop over env table: */
- while (nto_xfer_memory (initial_stack + data_ofs,
- (unsigned char *)&anint, sizeof (anint), 0)
- == sizeof (anint))
- {
- data_ofs += sizeof (anint);
- if (anint == 0)
- break;
- }
- initial_stack += data_ofs;
-
- memset (myaddr, 0, len);
- while (len_read <= len - sizeof (auxv_t))
- {
- auxv_t *auxv = (auxv_t *)myaddr;
-
- /* Search backwards until we have read AT_PHDR (num. 3),
- AT_PHENT (num 4), AT_PHNUM (num 5) */
- if (nto_xfer_memory (initial_stack, (unsigned char *)auxv,
- sizeof (auxv_t), 0) == sizeof (auxv_t))
- {
- if (auxv->a_type != AT_NULL)
- {
- auxv++;
- len_read += sizeof (auxv_t);
- }
- if (auxv->a_type == AT_PHNUM) /* That's all we need. */
- break;
- initial_stack += sizeof (auxv_t);
- }
- else
- break;
- }
- TRACE ("auxv: len_read: %d\n", len_read);
- return len_read;
-}
-
-/* Start inferior specified by PROGRAM, using PROGRAM_ARGS as its
- arguments. */
-
-int
-nto_process_target::create_inferior (const char *program,
- const std::vector<char *> &program_args)
-{
- struct inheritance inherit;
- pid_t pid;
- sigset_t set;
- std::string str_program_args = stringify_argv (program_args);
-
- TRACE ("%s %s\n", __func__, program);
- /* Clear any pending SIGUSR1's but keep the behavior the same. */
- signal (SIGUSR1, signal (SIGUSR1, SIG_IGN));
-
- sigemptyset (&set);
- sigaddset (&set, SIGUSR1);
- sigprocmask (SIG_UNBLOCK, &set, NULL);
-
- memset (&inherit, 0, sizeof (inherit));
- inherit.flags |= SPAWN_SETGROUP | SPAWN_HOLD;
- inherit.pgroup = SPAWN_NEWPGROUP;
- pid = spawnp (program, 0, NULL, &inherit,
- (char *) str_program_args.c_str (), 0);
- sigprocmask (SIG_BLOCK, &set, NULL);
-
- if (pid == -1)
- return -1;
-
- if (do_attach (pid) != pid)
- return -1;
-
- return pid;
-}
-
-/* Attach to process PID. */
-
-int
-nto_process_target::attach (unsigned long pid)
-{
- TRACE ("%s %ld\n", __func__, pid);
- if (do_attach (pid) != pid)
- error ("Unable to attach to %ld\n", pid);
- return 0;
-}
-
-/* Send signal to process PID. */
-
-int
-nto_process_target::kill (process_info *proc)
-{
- int pid = proc->pid;
-
- TRACE ("%s %d\n", __func__, pid);
- kill (pid, SIGKILL);
- do_detach ();
- return 0;
-}
-
-/* Detach from process PID. */
-
-int
-nto_process_target::detach (process_info *proc)
-{
- TRACE ("%s %d\n", __func__, proc->pid);
- do_detach ();
- return 0;
-}
-
-void
-nto_process_target::mourn (struct process_info *process)
-{
- remove_process (process);
-}
-
-void
-nto_process_target::join (int pid)
-{
- error (_("nto target does not implement the join op"));
-}
-
-/* Check if the given thread is alive.
-
- Return true if alive, false otherwise. */
-
-bool
-nto_process_target::thread_alive (ptid_t ptid)
-{
- int res;
-
- TRACE ("%s pid:%d tid:%d\n", __func__, ptid.pid (),
- ptid.lwp ());
- if (SignalKill (0, ptid.pid (), ptid.lwp (),
- 0, 0, 0) == -1)
- res = 0;
- else
- res = 1;
- TRACE ("%s: %s\n", __func__, res ? "yes" : "no");
- return res;
-}
-
-/* Resume inferior's execution. */
-
-void
-nto_process_target::resume (thread_resume *resume_info, size_t n)
-{
- /* We can only work in all-stop mode. */
- procfs_status status;
- procfs_run run;
- int err;
-
- TRACE ("%s\n", __func__);
- /* Workaround for aliasing rules violation. */
- sigset_t *run_fault = (sigset_t *) (void *) &run.fault;
-
- nto_set_thread (resume_info->thread);
-
- run.flags = _DEBUG_RUN_FAULT | _DEBUG_RUN_TRACE;
- if (resume_info->kind == resume_step)
- run.flags |= _DEBUG_RUN_STEP;
- run.flags |= _DEBUG_RUN_ARM;
-
- sigemptyset (run_fault);
- sigaddset (run_fault, FLTBPT);
- sigaddset (run_fault, FLTTRACE);
- sigaddset (run_fault, FLTILL);
- sigaddset (run_fault, FLTPRIV);
- sigaddset (run_fault, FLTBOUNDS);
- sigaddset (run_fault, FLTIOVF);
- sigaddset (run_fault, FLTIZDIV);
- sigaddset (run_fault, FLTFPE);
- sigaddset (run_fault, FLTPAGE);
- sigaddset (run_fault, FLTSTACK);
- sigaddset (run_fault, FLTACCESS);
-
- sigemptyset (&run.trace);
- if (resume_info->sig)
- {
- int signal_to_pass;
-
- devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status),
- 0);
- signal_to_pass = resume_info->sig;
- if (status.why & (_DEBUG_WHY_SIGNALLED | _DEBUG_WHY_FAULTED))
- {
- if (signal_to_pass != status.info.si_signo)
- {
- kill (status.pid, signal_to_pass);
- run.flags |= _DEBUG_RUN_CLRFLT | _DEBUG_RUN_CLRSIG;
- }
- else /* Let it kill the program without telling us. */
- sigdelset (&run.trace, signal_to_pass);
- }
- }
- else
- run.flags |= _DEBUG_RUN_CLRSIG | _DEBUG_RUN_CLRFLT;
-
- sigfillset (&run.trace);
-
- regcache_invalidate ();
-
- err = devctl (nto_inferior.ctl_fd, DCMD_PROC_RUN, &run, sizeof (run), 0);
- if (err != EOK)
- TRACE ("Error: %d \"%s\"\n", err, safe_strerror (err));
-}
-
-/* Wait for inferior's event.
-
- Return ptid of thread that caused the event. */
-
-ptid_t
-nto_process_target::wait (ptid_t ptid, target_waitstatus *ourstatus,
- int target_options)
-{
- sigset_t set;
- siginfo_t info;
- procfs_status status;
- const int trace_mask = (_DEBUG_FLAG_TRACE_EXEC | _DEBUG_FLAG_TRACE_RD
- | _DEBUG_FLAG_TRACE_WR | _DEBUG_FLAG_TRACE_MODIFY);
-
- TRACE ("%s\n", __func__);
-
- ourstatus->kind = TARGET_WAITKIND_SPURIOUS;
-
- sigemptyset (&set);
- sigaddset (&set, SIGUSR1);
-
- devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status), 0);
- while (!(status.flags & _DEBUG_FLAG_ISTOP))
- {
- sigwaitinfo (&set, &info);
- devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status, sizeof (status),
- 0);
- }
- nto_find_new_threads (&nto_inferior);
-
- if (status.flags & _DEBUG_FLAG_SSTEP)
- {
- TRACE ("SSTEP\n");
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = GDB_SIGNAL_TRAP;
- }
- /* Was it a breakpoint? */
- else if (status.flags & trace_mask)
- {
- TRACE ("STOPPED\n");
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = GDB_SIGNAL_TRAP;
- }
- else if (status.flags & _DEBUG_FLAG_ISTOP)
- {
- TRACE ("ISTOP\n");
- switch (status.why)
- {
- case _DEBUG_WHY_SIGNALLED:
- TRACE (" SIGNALLED\n");
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig =
- gdb_signal_from_host (status.info.si_signo);
- nto_inferior.exit_signo = ourstatus->value.sig;
- break;
- case _DEBUG_WHY_FAULTED:
- TRACE (" FAULTED\n");
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
- if (status.info.si_signo == SIGTRAP)
- {
- ourstatus->value.sig = 0;
- nto_inferior.exit_signo = 0;
- }
- else
- {
- ourstatus->value.sig =
- gdb_signal_from_host (status.info.si_signo);
- nto_inferior.exit_signo = ourstatus->value.sig;
- }
- break;
-
- case _DEBUG_WHY_TERMINATED:
- {
- int waitval = 0;
-
- TRACE (" TERMINATED\n");
- waitpid (ptid.pid (), &waitval, WNOHANG);
- if (nto_inferior.exit_signo)
- {
- /* Abnormal death. */
- ourstatus->kind = TARGET_WAITKIND_SIGNALLED;
- ourstatus->value.sig = nto_inferior.exit_signo;
- }
- else
- {
- /* Normal death. */
- ourstatus->kind = TARGET_WAITKIND_EXITED;
- ourstatus->value.integer = WEXITSTATUS (waitval);
- }
- nto_inferior.exit_signo = 0;
- break;
- }
-
- case _DEBUG_WHY_REQUESTED:
- TRACE ("REQUESTED\n");
- /* We are assuming a requested stop is due to a SIGINT. */
- ourstatus->kind = TARGET_WAITKIND_STOPPED;
- ourstatus->value.sig = GDB_SIGNAL_INT;
- nto_inferior.exit_signo = 0;
- break;
- }
- }
-
- return ptid_t (status.pid, status.tid, 0);
-}
-
-/* Fetch inferior's registers for currently selected thread (CURRENT_INFERIOR).
- If REGNO is -1, fetch all registers, or REGNO register only otherwise. */
-
-void
-nto_process_target::fetch_registers (regcache *regcache, int regno)
-{
- int regsize;
- procfs_greg greg;
-
- TRACE ("%s (regno=%d)\n", __func__, regno);
- if (regno >= the_low_target.num_regs)
- return;
-
- if (current_thread == NULL)
- {
- TRACE ("current_thread is NULL\n");
- return;
- }
- ptid_t ptid = ptid_of (current_thread);
- if (!nto_set_thread (ptid))
- return;
-
- if (devctl (nto_inferior.ctl_fd, DCMD_PROC_GETGREG, &greg, sizeof (greg),
- ®size) == EOK)
- {
- if (regno == -1) /* All registers. */
- {
- for (regno = 0; regno != the_low_target.num_regs; ++regno)
- {
- const unsigned int registeroffset
- = the_low_target.register_offset (regno);
- supply_register (regcache, regno,
- ((char *)&greg) + registeroffset);
- }
- }
- else
- {
- const unsigned int registeroffset
- = the_low_target.register_offset (regno);
- if (registeroffset == -1)
- return;
- supply_register (regcache, regno, ((char *)&greg) + registeroffset);
- }
- }
- else
- TRACE ("ERROR reading registers from inferior.\n");
-}
-
-/* Store registers for currently selected thread (CURRENT_INFERIOR).
- We always store all registers, regardless of REGNO. */
-
-void
-nto_process_target::store_registers (regcache *regcache, int regno)
-{
- procfs_greg greg;
- int err;
-
- TRACE ("%s (regno:%d)\n", __func__, regno);
-
- if (current_thread == NULL)
- {
- TRACE ("current_thread is NULL\n");
- return;
- }
- ptid_t ptid = ptid_of (current_thread);
- if (!nto_set_thread (ptid))
- return;
-
- memset (&greg, 0, sizeof (greg));
- for (regno = 0; regno != the_low_target.num_regs; ++regno)
- {
- const unsigned int regoffset
- = the_low_target.register_offset (regno);
- collect_register (regcache, regno, ((char *)&greg) + regoffset);
- }
- err = devctl (nto_inferior.ctl_fd, DCMD_PROC_SETGREG, &greg, sizeof (greg),
- 0);
- if (err != EOK)
- TRACE ("Error: setting registers.\n");
-}
-
-/* Read LEN bytes from inferior's memory address MEMADDR into
- gdbserver's MYADDR buffer.
-
- Return 0 on success -1 otherwise. */
-
-int
-nto_process_target::read_memory (CORE_ADDR memaddr, unsigned char *myaddr,
- int len)
-{
- TRACE ("%s memaddr:0x%08lx, len:%d\n", __func__, memaddr, len);
-
- if (nto_xfer_memory (memaddr, myaddr, len, 0) != len)
- {
- TRACE ("Failed to read memory\n");
- return -1;
- }
-
- return 0;
-}
-
-/* Write LEN bytes from gdbserver's buffer MYADDR into inferior's
- memory at address MEMADDR.
-
- Return 0 on success -1 otherwise. */
-
-int
-nto_process_target::write_memory (CORE_ADDR memaddr,
- const unsigned char *myaddr, int len)
-{
- int len_written;
-
- TRACE ("%s memaddr: 0x%08llx len: %d\n", __func__, memaddr, len);
- if ((len_written = nto_xfer_memory (memaddr, (unsigned char *)myaddr, len,
- 1))
- != len)
- {
- TRACE ("Wanted to write: %d but written: %d\n", len, len_written);
- return -1;
- }
-
- return 0;
-}
-
-/* Stop inferior. We always stop all threads. */
-
-void
-nto_process_target::request_interrupt ()
-{
- TRACE ("%s\n", __func__);
- nto_set_thread (ptid_t (nto_inferior.pid, 1, 0));
- if (EOK != devctl (nto_inferior.ctl_fd, DCMD_PROC_STOP, NULL, 0, 0))
- TRACE ("Error stopping inferior.\n");
-}
-
-bool
-nto_process_target::supports_read_auxv ()
-{
- return true;
-}
-
-/* Read auxiliary vector from inferior's memory into gdbserver's buffer
- MYADDR. We always read whole auxv.
-
- Return number of bytes stored in MYADDR buffer, 0 if OFFSET > 0
- or -1 on error. */
-
-int
-nto_process_target::read_auxv (CORE_ADDR offset, unsigned char *myaddr,
- unsigned int len)
-{
- int err;
- CORE_ADDR initial_stack;
- procfs_info procinfo;
-
- TRACE ("%s\n", __func__);
- if (offset > 0)
- return 0;
-
- err = devctl (nto_inferior.ctl_fd, DCMD_PROC_INFO, &procinfo,
- sizeof procinfo, 0);
- if (err != EOK)
- return -1;
-
- initial_stack = procinfo.initial_stack;
-
- return nto_read_auxv_from_initial_stack (initial_stack, myaddr, len);
-}
-
-bool
-nto_process_target::supports_z_point_type (char z_type)
-{
- switch (z_type)
- {
- case Z_PACKET_SW_BP:
- case Z_PACKET_HW_BP:
- case Z_PACKET_WRITE_WP:
- case Z_PACKET_READ_WP:
- case Z_PACKET_ACCESS_WP:
- return true;
- default:
- return false;
- }
-}
-
-/* Insert {break/watch}point at address ADDR. SIZE is not used. */
-
-int
-nto_process_target::insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, raw_breakpoint *bp)
-{
- int wtype = _DEBUG_BREAK_HW; /* Always request HW. */
-
- TRACE ("%s type:%c addr: 0x%08lx len:%d\n", __func__, (int)type, addr, size);
- switch (type)
- {
- case raw_bkpt_type_sw:
- wtype = _DEBUG_BREAK_EXEC;
- break;
- case raw_bkpt_type_hw:
- wtype |= _DEBUG_BREAK_EXEC;
- break;
- case raw_bkpt_type_write_wp:
- wtype |= _DEBUG_BREAK_RW;
- break;
- case raw_bkpt_type_read_wp:
- wtype |= _DEBUG_BREAK_RD;
- break;
- case raw_bkpt_type_access_wp:
- wtype |= _DEBUG_BREAK_RW;
- break;
- default:
- return 1; /* Not supported. */
- }
- return nto_breakpoint (addr, wtype, 0);
-}
-
-/* Remove {break/watch}point at address ADDR. SIZE is not used. */
-
-int
-nto_process_target::remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, raw_breakpoint *bp)
-{
- int wtype = _DEBUG_BREAK_HW; /* Always request HW. */
-
- TRACE ("%s type:%c addr: 0x%08lx len:%d\n", __func__, (int)type, addr, size);
- switch (type)
- {
- case raw_bkpt_type_sw:
- wtype = _DEBUG_BREAK_EXEC;
- break;
- case raw_bkpt_type_hw:
- wtype |= _DEBUG_BREAK_EXEC;
- break;
- case raw_bkpt_type_write_wp:
- wtype |= _DEBUG_BREAK_RW;
- break;
- case raw_bkpt_type_read_wp:
- wtype |= _DEBUG_BREAK_RD;
- break;
- case raw_bkpt_type_access_wp:
- wtype |= _DEBUG_BREAK_RW;
- break;
- default:
- return 1; /* Not supported. */
- }
- return nto_breakpoint (addr, wtype, -1);
-}
-
-bool
-nto_process_target::supports_hardware_single_step ()
-{
- return true;
-}
-
-/* Check if the reason of stop for current thread (CURRENT_INFERIOR) is
- a watchpoint.
-
- Return true if stopped by watchpoint, false otherwise. */
-
-bool
-nto_process_target::stopped_by_watchpoint ()
-{
- bool ret = false;
-
- TRACE ("%s\n", __func__);
- if (nto_inferior.ctl_fd != -1 && current_thread != NULL)
- {
- ptid_t ptid = ptid_of (current_thread);
- if (nto_set_thread (ptid))
- {
- const int watchmask = _DEBUG_FLAG_TRACE_RD | _DEBUG_FLAG_TRACE_WR
- | _DEBUG_FLAG_TRACE_MODIFY;
- procfs_status status;
- int err;
-
- err = devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status,
- sizeof (status), 0);
- if (err == EOK && (status.flags & watchmask))
- ret = true;
- }
- }
- TRACE ("%s: %s\n", __func__, ret ? "yes" : "no");
- return ret;
-}
-
-/* Get instruction pointer for CURRENT_INFERIOR thread.
-
- Return inferior's instruction pointer value, or 0 on error. */
-
-CORE_ADDR
-nto_process_target::stopped_data_address ()
-{
- CORE_ADDR ret = (CORE_ADDR)0;
-
- TRACE ("%s\n", __func__);
- if (nto_inferior.ctl_fd != -1 && current_thread != NULL)
- {
- ptid_t ptid = ptid_of (current_thread);
-
- if (nto_set_thread (ptid))
- {
- procfs_status status;
-
- if (devctl (nto_inferior.ctl_fd, DCMD_PROC_STATUS, &status,
- sizeof (status), 0) == EOK)
- ret = status.ip;
- }
- }
- TRACE ("%s: 0x%08lx\n", __func__, ret);
- return ret;
-}
-
-/* Implementation of the target_ops method "sw_breakpoint_from_kind". */
-
-const gdb_byte *
-nto_process_target::sw_breakpoint_from_kind (int kind, int *size)
-{
- *size = the_low_target.breakpoint_len;
- return the_low_target.breakpoint;
-}
-
-/* The QNX Neutrino target ops object. */
-
-static nto_process_target the_nto_target;
-
-/* Global function called by server.c. Initializes QNX Neutrino
- gdbserver. */
-
-void
-initialize_low (void)
-{
- sigset_t set;
-
- TRACE ("%s\n", __func__);
- set_target_ops (&the_nto_target);
-
- /* We use SIGUSR1 to gain control after we block waiting for a process.
- We use sigwaitevent to wait. */
- sigemptyset (&set);
- sigaddset (&set, SIGUSR1);
- sigprocmask (SIG_BLOCK, &set, NULL);
-}
-
diff --git a/gdbserver/nto-low.h b/gdbserver/nto-low.h
deleted file mode 100644
index e26dcab331d2..000000000000
--- a/gdbserver/nto-low.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Internal interfaces for the QNX Neutrino specific target code for gdbserver.
- Copyright (C) 2009-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef GDBSERVER_NTO_LOW_H
-#define GDBSERVER_NTO_LOW_H
-
-struct target_desc;
-
-enum regset_type
-{
- NTO_REG_GENERAL,
- NTO_REG_FLOAT,
- NTO_REG_SYSTEM,
- NTO_REG_ALT,
- NTO_REG_END
-};
-
-struct nto_target_ops
-{
- /* Architecture specific setup. */
- void (*arch_setup) (void);
- int num_regs;
- int (*register_offset) (int gdbregno);
- const unsigned char *breakpoint;
- int breakpoint_len;
-};
-
-extern struct nto_target_ops the_low_target;
-
-/* Target ops definitions for a QNX Neutrino target. */
-
-class nto_process_target : public process_stratum_target
-{
-public:
-
- int create_inferior (const char *program,
- const std::vector<char *> &program_args) override;
-
- int attach (unsigned long pid) override;
-
- int kill (process_info *proc) override;
-
- int detach (process_info *proc) override;
-
- void mourn (process_info *proc) override;
-
- void join (int pid) override;
-
- bool thread_alive (ptid_t pid) override;
-
- void resume (thread_resume *resume_info, size_t n) override;
-
- ptid_t wait (ptid_t ptid, target_waitstatus *status,
- int options) override;
-
- void fetch_registers (regcache *regcache, int regno) override;
-
- void store_registers (regcache *regcache, int regno) override;
-
- int read_memory (CORE_ADDR memaddr, unsigned char *myaddr,
- int len) override;
-
- int write_memory (CORE_ADDR memaddr, const unsigned char *myaddr,
- int len) override;
-
- void request_interrupt () override;
-
- bool supports_read_auxv () override;
-
- int read_auxv (CORE_ADDR offset, unsigned char *myaddr,
- unsigned int len) override;
-
- bool supports_z_point_type (char z_type) override;
-
- int insert_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, raw_breakpoint *bp) override;
-
- int remove_point (enum raw_bkpt_type type, CORE_ADDR addr,
- int size, raw_breakpoint *bp) override;
-
- bool supports_hardware_single_step () override;
-
- bool stopped_by_watchpoint () override;
-
- CORE_ADDR stopped_data_address () override;
-
- const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-};
-
-/* The inferior's target description. This is a global because the
- LynxOS ports support neither bi-arch nor multi-process. */
-extern const struct target_desc *nto_tdesc;
-
-#endif /* GDBSERVER_NTO_LOW_H */
diff --git a/gdbserver/nto-x86-low.cc b/gdbserver/nto-x86-low.cc
deleted file mode 100644
index efee95736222..000000000000
--- a/gdbserver/nto-x86-low.cc
+++ /dev/null
@@ -1,109 +0,0 @@
-/* QNX Neutrino specific low level interface, for the remote server
- for GDB.
- Copyright (C) 2009-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "nto-low.h"
-#include "regdef.h"
-#include "regcache.h"
-
-#include <x86/context.h>
-#include "gdbsupport/x86-xstate.h"
-#include "arch/i386.h"
-#include "x86-tdesc.h"
-
-const unsigned char x86_breakpoint[] = { 0xCC };
-#define x86_breakpoint_len 1
-
-/* Returns offset in appropriate Neutrino's context structure.
- Defined in x86/context.h.
- GDBREGNO is index into regs_i386 array. It is autogenerated and
- hopefully doesn't change. */
-static int
-nto_x86_register_offset (int gdbregno)
-{
- if (gdbregno >= 0 && gdbregno < 16)
- {
- X86_CPU_REGISTERS *dummy = (void*)0;
- /* GPRs */
- switch (gdbregno)
- {
- case 0:
- return (int)&(dummy->eax);
- case 1:
- return (int)&(dummy->ecx);
- case 2:
- return (int)&(dummy->edx);
- case 3:
- return (int)&(dummy->ebx);
- case 4:
- return (int)&(dummy->esp);
- case 5:
- return (int)&(dummy->ebp);
- case 6:
- return (int)&(dummy->esi);
- case 7:
- return (int)&(dummy->edi);
- case 8:
- return (int)&(dummy->eip);
- case 9:
- return (int)&(dummy->efl);
- case 10:
- return (int)&(dummy->cs);
- case 11:
- return (int)&(dummy->ss);
-#ifdef __SEGMENTS__
- case 12:
- return (int)&(dummy->ds);
- case 13:
- return (int)&(dummy->es);
- case 14:
- return (int)&(dummy->fs);
- case 15:
- return (int)&(dummy->gs);
-#endif
- default:
- return -1;
- }
- }
- return -1;
-}
-
-static void
-nto_x86_arch_setup (void)
-{
- the_low_target.num_regs = 16;
- struct target_desc *tdesc
- = i386_create_target_description (X86_XSTATE_SSE_MASK, false, false);
-
- init_target_desc (tdesc, i386_expedite_regs);
-
- nto_tdesc = tdesc;
-}
-
-struct nto_target_ops the_low_target =
-{
- nto_x86_arch_setup,
- 0, /* num_regs */
- nto_x86_register_offset,
- x86_breakpoint,
- x86_breakpoint_len
-};
-
-
-
diff --git a/gdbserver/remote-utils.cc b/gdbserver/remote-utils.cc
index 67c560d1c87b..c26668dc0f8a 100644
--- a/gdbserver/remote-utils.cc
+++ b/gdbserver/remote-utils.cc
@@ -68,10 +68,6 @@
#include <ws2tcpip.h>
#endif
-#if __QNX__
-#include <sys/iomgr.h>
-#endif /* __QNX__ */
-
#ifndef HAVE_SOCKLEN_T
typedef int socklen_t;
#endif
@@ -804,28 +800,6 @@ block_unblock_async_io (int block)
#endif
}
-#ifdef __QNX__
-static void
-nto_comctrl (int enable)
-{
- struct sigevent event;
-
- if (enable)
- {
- event.sigev_notify = SIGEV_SIGNAL_THREAD;
- event.sigev_signo = SIGIO;
- event.sigev_code = 0;
- event.sigev_value.sival_ptr = NULL;
- event.sigev_priority = -1;
- ionotify (remote_desc, _NOTIFY_ACTION_POLLARM, _NOTIFY_COND_INPUT,
- &event);
- }
- else
- ionotify (remote_desc, _NOTIFY_ACTION_POLL, _NOTIFY_COND_INPUT, NULL);
-}
-#endif /* __QNX__ */
-
-
/* Current state of asynchronous I/O. */
static int async_io_enabled;
@@ -839,9 +813,6 @@ enable_async_io (void)
block_unblock_async_io (0);
async_io_enabled = 1;
-#ifdef __QNX__
- nto_comctrl (1);
-#endif /* __QNX__ */
}
/* Disable asynchronous I/O. */
@@ -854,10 +825,6 @@ disable_async_io (void)
block_unblock_async_io (1);
async_io_enabled = 0;
-#ifdef __QNX__
- nto_comctrl (0);
-#endif /* __QNX__ */
-
}
void
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 3/7] gdbserver: remove support for Blackfin
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
2020-05-14 17:43 ` [PATCH 1/7] gdbserver: remove support for LynxOS Simon Marchi
2020-05-14 17:43 ` [PATCH 2/7] gdbserver: remove support for Neutrino Simon Marchi
@ 2020-05-14 17:43 ` Simon Marchi
2020-05-14 17:43 ` [PATCH 4/7] gdbserver: remove support for CRIS Simon Marchi
` (8 subsequent siblings)
11 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 17:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
This port has been unmaintained for years and the upstream Linux kernel
does not support this architecture anymore, remove it.
gdbserver/ChangeLog:
* Makefile.in (SFILES): Remove linux-bfin-low.c.
* README: Remove bfin targets.
* configure.srv: Remove bfin case.
* linux-bfin-low.cc: Remove.
* linux-low.cc: Remove BFIN-conditional code.
---
gdbserver/Makefile.in | 1 -
gdbserver/README | 4 +-
gdbserver/configure.srv | 5 --
gdbserver/linux-bfin-low.cc | 173 ------------------------------------
gdbserver/linux-low.cc | 5 --
5 files changed, 1 insertion(+), 187 deletions(-)
delete mode 100644 gdbserver/linux-bfin-low.cc
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 417a530e25d5..58577ca898c3 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -180,7 +180,6 @@ SFILES = \
$(srcdir)/inferiors.cc \
$(srcdir)/linux-aarch64-low.cc \
$(srcdir)/linux-arm-low.cc \
- $(srcdir)/linux-bfin-low.cc \
$(srcdir)/linux-cris-low.cc \
$(srcdir)/linux-crisv32-low.cc \
$(srcdir)/linux-ia64-low.cc \
diff --git a/gdbserver/README b/gdbserver/README
index 17d435c18f52..e06aab58c237 100644
--- a/gdbserver/README
+++ b/gdbserver/README
@@ -79,10 +79,8 @@ command, otherwise you may get an error that looks something like
Building GDBserver:
-The supported targets as of November 2006 are:
+The supported targets are:
arm-*-linux*
- bfin-*-uclinux
- bfin-*-linux-uclibc
crisv32-*-linux*
cris-*-linux*
i[34567]86-*-cygwin*
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index 0a3bf32dd18c..4b4e25a5e5e8 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -81,11 +81,6 @@ case "${gdbserver_host}" in
srv_mingw=yes
srv_mingwce=yes
;;
- bfin-*-*linux*) srv_regobj=reg-bfin.o
- srv_tgtobj="$srv_linux_obj linux-bfin-low.o"
- srv_linux_usrregs=yes
- srv_linux_thread_db=yes
- ;;
crisv32-*-linux*) srv_regobj=reg-crisv32.o
srv_tgtobj="$srv_linux_obj linux-crisv32-low.o"
srv_linux_regsets=yes
diff --git a/gdbserver/linux-bfin-low.cc b/gdbserver/linux-bfin-low.cc
deleted file mode 100644
index 963ccfeda949..000000000000
--- a/gdbserver/linux-bfin-low.cc
+++ /dev/null
@@ -1,173 +0,0 @@
-/* GNU/Linux/BFIN specific low level interface, for the remote server for GDB.
-
- Copyright (C) 2005-2020 Free Software Foundation, Inc.
-
- Contributed by Analog Devices, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "linux-low.h"
-#include <asm/ptrace.h>
-
-/* Linux target op definitions for the BFIN architecture. */
-
-class bfin_target : public linux_process_target
-{
-public:
-
- const regs_info *get_regs_info () override;
-
- const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-
-protected:
-
- void low_arch_setup () override;
-
- bool low_cannot_fetch_register (int regno) override;
-
- bool low_cannot_store_register (int regno) override;
-
- bool low_supports_breakpoints () override;
-
- CORE_ADDR low_get_pc (regcache *regcache) override;
-
- void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
-
- int low_decr_pc_after_break () override;
-
- bool low_breakpoint_at (CORE_ADDR pc) override;
-};
-
-/* The singleton target ops object. */
-
-static bfin_target the_bfin_target;
-
-bool
-bfin_target::low_supports_breakpoints ()
-{
- return true;
-}
-
-CORE_ADDR
-bfin_target::low_get_pc (regcache *regcache)
-{
- return linux_get_pc_32bit (regcache);
-}
-
-void
-bfin_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
-{
- linux_set_pc_32bit (regcache, pc);
-}
-
-int
-bfin_target::low_decr_pc_after_break ()
-{
- return 2;
-}
-
-/* Defined in auto-generated file reg-bfin.c. */
-void init_registers_bfin (void);
-extern const struct target_desc *tdesc_bfin;
-
-static int bfin_regmap[] =
-{
- PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7,
- PT_P0, PT_P1, PT_P2, PT_P3, PT_P4, PT_P5, PT_USP, PT_FP,
- PT_I0, PT_I1, PT_I2, PT_I3, PT_M0, PT_M1, PT_M2, PT_M3,
- PT_B0, PT_B1, PT_B2, PT_B3, PT_L0, PT_L1, PT_L2, PT_L3,
- PT_A0X, PT_A0W, PT_A1X, PT_A1W, PT_ASTAT, PT_RETS,
- PT_LC0, PT_LT0, PT_LB0, PT_LC1, PT_LT1, PT_LB1,
- -1 /* PT_CYCLES */, -1 /* PT_CYCLES2 */,
- -1 /* PT_USP */, PT_SEQSTAT, PT_SYSCFG, PT_PC, PT_RETX, PT_RETN, PT_RETE,
- PT_PC,
-};
-
-#define bfin_num_regs ARRAY_SIZE (bfin_regmap)
-
-bool
-bfin_target::low_cannot_store_register (int regno)
-{
- return (regno >= bfin_num_regs);
-}
-
-bool
-bfin_target::low_cannot_fetch_register (int regno)
-{
- return (regno >= bfin_num_regs);
-}
-
-#define bfin_breakpoint_len 2
-static const gdb_byte bfin_breakpoint[bfin_breakpoint_len] = {0xa1, 0x00};
-
-/* Implementation of target ops method "sw_breakpoint_from_kind". */
-
-const gdb_byte *
-bfin_target::sw_breakpoint_from_kind (int kind, int *size)
-{
- *size = bfin_breakpoint_len;
- return bfin_breakpoint;
-}
-
-bool
-bfin_target::low_breakpoint_at (CORE_ADDR where)
-{
- unsigned char insn[bfin_breakpoint_len];
-
- read_inferior_memory(where, insn, bfin_breakpoint_len);
- if (insn[0] == bfin_breakpoint[0]
- && insn[1] == bfin_breakpoint[1])
- return true;
-
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return false;
-}
-
-void
-bfin_target::low_arch_setup ()
-{
- current_process ()->tdesc = tdesc_bfin;
-}
-
-static struct usrregs_info bfin_usrregs_info =
- {
- bfin_num_regs,
- bfin_regmap,
- };
-
-static struct regs_info myregs_info =
- {
- NULL, /* regset_bitmap */
- &bfin_usrregs_info,
- };
-
-const regs_info *
-bfin_target::get_regs_info ()
-{
- return &myregs_info;
-}
-
-/* The linux target ops object. */
-
-linux_process_target *the_linux_target = &the_bfin_target;
-
-void
-initialize_low_arch (void)
-{
- init_registers_bfin ();
-}
diff --git a/gdbserver/linux-low.cc b/gdbserver/linux-low.cc
index 3cd8d5594dc9..d22914049c48 100644
--- a/gdbserver/linux-low.cc
+++ b/gdbserver/linux-low.cc
@@ -86,11 +86,6 @@
#define PT_TEXT_ADDR 49*4
#define PT_DATA_ADDR 50*4
#define PT_TEXT_END_ADDR 51*4
-/* BFIN already defines these since at least 2.6.32 kernels. */
-#elif defined(BFIN)
-#define PT_TEXT_ADDR 220
-#define PT_TEXT_END_ADDR 224
-#define PT_DATA_ADDR 228
/* These are still undefined in 3.10 kernels. */
#elif defined(__TMS320C6X__)
#define PT_TEXT_ADDR (0x10000*4)
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 4/7] gdbserver: remove support for CRIS
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (2 preceding siblings ...)
2020-05-14 17:43 ` [PATCH 3/7] gdbserver: remove support for Blackfin Simon Marchi
@ 2020-05-14 17:43 ` Simon Marchi
2020-05-14 17:43 ` [PATCH 5/7] gdbserver: remove support for M32R Simon Marchi
` (7 subsequent siblings)
11 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 17:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
This port has been unmaintained for years and the upstream Linux kernel
does not support this architecture anymore, remove it.
gdbserver/ChangeLog:
* Makefile.in (SFILES): Remove linux-cris-low.c.
* README: Remove cris targets.
* configure.srv: Remove cris cases.
* linux-cris-low.cc, linux-crisv32-low.cc: Remove.
---
gdbserver/Makefile.in | 2 -
gdbserver/README | 2 -
gdbserver/configure.srv | 10 -
gdbserver/linux-cris-low.cc | 169 ------------
gdbserver/linux-crisv32-low.cc | 472 ---------------------------------
5 files changed, 655 deletions(-)
delete mode 100644 gdbserver/linux-cris-low.cc
delete mode 100644 gdbserver/linux-crisv32-low.cc
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 58577ca898c3..329962938173 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -180,8 +180,6 @@ SFILES = \
$(srcdir)/inferiors.cc \
$(srcdir)/linux-aarch64-low.cc \
$(srcdir)/linux-arm-low.cc \
- $(srcdir)/linux-cris-low.cc \
- $(srcdir)/linux-crisv32-low.cc \
$(srcdir)/linux-ia64-low.cc \
$(srcdir)/linux-low.cc \
$(srcdir)/linux-m32r-low.cc \
diff --git a/gdbserver/README b/gdbserver/README
index e06aab58c237..431245fb8f88 100644
--- a/gdbserver/README
+++ b/gdbserver/README
@@ -81,8 +81,6 @@ Building GDBserver:
The supported targets are:
arm-*-linux*
- crisv32-*-linux*
- cris-*-linux*
i[34567]86-*-cygwin*
i[34567]86-*-linux*
i[34567]86-*-mingw*
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index 4b4e25a5e5e8..e362c961703f 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -81,16 +81,6 @@ case "${gdbserver_host}" in
srv_mingw=yes
srv_mingwce=yes
;;
- crisv32-*-linux*) srv_regobj=reg-crisv32.o
- srv_tgtobj="$srv_linux_obj linux-crisv32-low.o"
- srv_linux_regsets=yes
- srv_linux_thread_db=yes
- ;;
- cris-*-linux*) srv_regobj=reg-cris.o
- srv_tgtobj="$srv_linux_obj linux-cris-low.o"
- srv_linux_usrregs=yes
- srv_linux_thread_db=yes
- ;;
i[34567]86-*-cygwin*) srv_regobj=""
srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
diff --git a/gdbserver/linux-cris-low.cc b/gdbserver/linux-cris-low.cc
deleted file mode 100644
index 555941414e0e..000000000000
--- a/gdbserver/linux-cris-low.cc
+++ /dev/null
@@ -1,169 +0,0 @@
-/* GNU/Linux/CRIS specific low level interface, for the remote server for GDB.
- Copyright (C) 1995-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "linux-low.h"
-#include "nat/gdb_ptrace.h"
-
-/* Linux target op definitions for the CRIS architecture. */
-
-class cris_target : public linux_process_target
-{
-public:
-
- const regs_info *get_regs_info () override;
-
- const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-
-protected:
-
- void low_arch_setup () override;
-
- bool low_cannot_fetch_register (int regno) override;
-
- bool low_cannot_store_register (int regno) override;
-
- bool low_supports_breakpoints () override;
-
- CORE_ADDR low_get_pc (regcache *regcache) override;
-
- void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
-
- bool low_breakpoint_at (CORE_ADDR pc) override;
-};
-
-/* The singleton target ops object. */
-
-static cris_target the_cris_target;
-
-bool
-cris_target::low_supports_breakpoints ()
-{
- return true;
-}
-
-CORE_ADDR
-cris_target::low_get_pc (regcache *regcache)
-{
- return linux_get_pc_32bit (regcache);
-}
-
-void
-cris_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
-{
- linux_set_pc_32bit (regcache, pc);
-}
-
-/* Defined in auto-generated file reg-cris.c. */
-void init_registers_cris (void);
-extern const struct target_desc *tdesc_cris;
-
-/* CRISv10 */
-#define cris_num_regs 32
-
-/* Locations need to match <include/asm/arch/ptrace.h>. */
-static int cris_regmap[] = {
- 15*4, 14*4, 13*4, 12*4,
- 11*4, 10*4, 9*4, 8*4,
- 7*4, 6*4, 5*4, 4*4,
- 3*4, 2*4, 23*4, 19*4,
-
- -1, -1, -1, -1,
- -1, 17*4, -1, 16*4,
- -1, -1, -1, 18*4,
- -1, 17*4, -1, -1
-
-};
-
-bool
-cris_target::low_cannot_store_register (int regno)
-{
- if (cris_regmap[regno] == -1)
- return true;
-
- return (regno >= cris_num_regs);
-}
-
-bool
-cris_target::low_cannot_fetch_register (int regno)
-{
- if (cris_regmap[regno] == -1)
- return true;
-
- return (regno >= cris_num_regs);
-}
-
-static const unsigned short cris_breakpoint = 0xe938;
-#define cris_breakpoint_len 2
-
-/* Implementation of target ops method "sw_breakpoint_from_kind". */
-
-const gdb_byte *
-cris_target::sw_breakpoint_from_kind (int kind, int *size)
-{
- *size = cris_breakpoint_len;
- return (const gdb_byte *) &cris_breakpoint;
-}
-
-bool
-cris_target::low_breakpoint_at (CORE_ADDR where)
-{
- unsigned short insn;
-
- read_memory (where, (unsigned char *) &insn, cris_breakpoint_len);
- if (insn == cris_breakpoint)
- return true;
-
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return false;
-}
-
-void
-cris_target::low_arch_setup ()
-{
- current_process ()->tdesc = tdesc_cris;
-}
-
-static struct usrregs_info cris_usrregs_info =
- {
- cris_num_regs,
- cris_regmap,
- };
-
-static struct regs_info myregs_info =
- {
- NULL, /* regset_bitmap */
- &cris_usrregs_info,
- };
-
-const regs_info *
-cris_target::get_regs_info ()
-{
- return &myregs_info;
-}
-
-/* The linux target ops object. */
-
-linux_process_target *the_linux_target = &the_cris_target;
-
-void
-initialize_low_arch (void)
-{
- init_registers_cris ();
-}
diff --git a/gdbserver/linux-crisv32-low.cc b/gdbserver/linux-crisv32-low.cc
deleted file mode 100644
index 577039ae2dbc..000000000000
--- a/gdbserver/linux-crisv32-low.cc
+++ /dev/null
@@ -1,472 +0,0 @@
-/* GNU/Linux/CRIS specific low level interface, for the remote server for GDB.
- Copyright (C) 1995-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "linux-low.h"
-#include "nat/gdb_ptrace.h"
-
-/* Linux target op definitions for the CRIS architecture. */
-
-class crisv32_target : public linux_process_target
-{
-public:
-
- const regs_info *get_regs_info () override;
-
- const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-
- bool supports_z_point_type (char z_type) override;
-
-protected:
-
- void low_arch_setup () override;
-
- bool low_cannot_fetch_register (int regno) override;
-
- bool low_cannot_store_register (int regno) override;
-
- bool low_supports_breakpoints () override;
-
- CORE_ADDR low_get_pc (regcache *regcache) override;
-
- void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
-
- bool low_breakpoint_at (CORE_ADDR pc) override;
-
- int low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
- int size, raw_breakpoint *bp) override;
-
- int low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
- int size, raw_breakpoint *bp) override;
-
- bool low_stopped_by_watchpoint () override;
-
- CORE_ADDR low_stopped_data_address () override;
-};
-
-/* The singleton target ops object. */
-
-static crisv32_target the_crisv32_target;
-
-bool
-crisv32_target::low_cannot_fetch_register (int regno)
-{
- gdb_assert_not_reached ("linux target op low_cannot_fetch_register "
- "is not implemented by the target");
-}
-
-bool
-crisv32_target::low_cannot_store_register (int regno)
-{
- gdb_assert_not_reached ("linux target op low_cannot_store_register "
- "is not implemented by the target");
-}
-
-bool
-crisv32_target::low_supports_breakpoints ()
-{
- return true;
-}
-
-CORE_ADDR
-crisv32_target::low_get_pc (regcache *regcache)
-{
- return linux_get_pc_32bit (regcache);
-}
-
-void
-crisv32_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
-{
- linux_set_pc_32bit (regcache, pc);
-}
-
-/* Defined in auto-generated file reg-crisv32.c. */
-void init_registers_crisv32 (void);
-extern const struct target_desc *tdesc_crisv32;
-
-/* CRISv32 */
-#define cris_num_regs 49
-
-#ifndef PTRACE_GET_THREAD_AREA
-#define PTRACE_GET_THREAD_AREA 25
-#endif
-
-/* Note: Ignoring USP (having the stack pointer in two locations causes trouble
- without any significant gain). */
-
-/* Locations need to match <include/asm/arch/ptrace.h>. */
-static int cris_regmap[] = {
- 1*4, 2*4, 3*4, 4*4,
- 5*4, 6*4, 7*4, 8*4,
- 9*4, 10*4, 11*4, 12*4,
- 13*4, 14*4, 24*4, 15*4,
-
- -1, -1, -1, 16*4,
- -1, 22*4, 23*4, 17*4,
- -1, -1, 21*4, 20*4,
- -1, 19*4, -1, 18*4,
-
- 25*4,
-
- 26*4, -1, -1, 29*4,
- 30*4, 31*4, 32*4, 33*4,
- 34*4, 35*4, 36*4, 37*4,
- 38*4, 39*4, 40*4, -1
-
-};
-
-static const unsigned short cris_breakpoint = 0xe938;
-#define cris_breakpoint_len 2
-
-/* Implementation of target ops method "sw_breakpoint_from_kind". */
-
-const gdb_byte *
-crisv32_target::sw_breakpoint_from_kind (int kind, int *size)
-{
- *size = cris_breakpoint_len;
- return (const gdb_byte *) &cris_breakpoint;
-}
-
-bool
-crisv32_target::low_breakpoint_at (CORE_ADDR where)
-{
- unsigned short insn;
-
- read_memory (where, (unsigned char *) &insn, cris_breakpoint_len);
- if (insn == cris_breakpoint)
- return true;
-
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return false;
-}
-
-static void
-cris_write_data_breakpoint (struct regcache *regcache,
- int bp, unsigned long start, unsigned long end)
-{
- switch (bp)
- {
- case 0:
- supply_register_by_name (regcache, "s3", &start);
- supply_register_by_name (regcache, "s4", &end);
- break;
- case 1:
- supply_register_by_name (regcache, "s5", &start);
- supply_register_by_name (regcache, "s6", &end);
- break;
- case 2:
- supply_register_by_name (regcache, "s7", &start);
- supply_register_by_name (regcache, "s8", &end);
- break;
- case 3:
- supply_register_by_name (regcache, "s9", &start);
- supply_register_by_name (regcache, "s10", &end);
- break;
- case 4:
- supply_register_by_name (regcache, "s11", &start);
- supply_register_by_name (regcache, "s12", &end);
- break;
- case 5:
- supply_register_by_name (regcache, "s13", &start);
- supply_register_by_name (regcache, "s14", &end);
- break;
- }
-}
-
-bool
-crisv32_target::supports_z_point_type (char z_type)
-{
- switch (z_type)
- {
- case Z_PACKET_WRITE_WP:
- case Z_PACKET_READ_WP:
- case Z_PACKET_ACCESS_WP:
- return true;
- default:
- return false;
- }
-}
-
-int
-crisv32_target::low_insert_point (raw_bkpt_type type, CORE_ADDR addr,
- int len, raw_breakpoint *bp)
-{
- int bp;
- unsigned long bp_ctrl;
- unsigned long start, end;
- unsigned long ccs;
- struct regcache *regcache;
-
- regcache = get_thread_regcache (current_thread, 1);
-
- /* Read watchpoints are set as access watchpoints, because of GDB's
- inability to deal with pure read watchpoints. */
- if (type == raw_bkpt_type_read_wp)
- type = raw_bkpt_type_access_wp;
-
- /* Get the configuration register. */
- collect_register_by_name (regcache, "s0", &bp_ctrl);
-
- /* The watchpoint allocation scheme is the simplest possible.
- For example, if a region is watched for read and
- a write watch is requested, a new watchpoint will
- be used. Also, if a watch for a region that is already
- covered by one or more existing watchpoints, a new
- watchpoint will be used. */
-
- /* First, find a free data watchpoint. */
- for (bp = 0; bp < 6; bp++)
- {
- /* Each data watchpoint's control registers occupy 2 bits
- (hence the 3), starting at bit 2 for D0 (hence the 2)
- with 4 bits between for each watchpoint (yes, the 4). */
- if (!(bp_ctrl & (0x3 << (2 + (bp * 4)))))
- break;
- }
-
- if (bp > 5)
- {
- /* We're out of watchpoints. */
- return -1;
- }
-
- /* Configure the control register first. */
- if (type == raw_bkpt_type_read_wp || type == raw_bkpt_type_access_wp)
- {
- /* Trigger on read. */
- bp_ctrl |= (1 << (2 + bp * 4));
- }
- if (type == raw_bkpt_type_write_wp || type == raw_bkpt_type_access_wp)
- {
- /* Trigger on write. */
- bp_ctrl |= (2 << (2 + bp * 4));
- }
-
- /* Setup the configuration register. */
- supply_register_by_name (regcache, "s0", &bp_ctrl);
-
- /* Setup the range. */
- start = addr;
- end = addr + len - 1;
-
- /* Configure the watchpoint register. */
- cris_write_data_breakpoint (regcache, bp, start, end);
-
- collect_register_by_name (regcache, "ccs", &ccs);
- /* Set the S1 flag to enable watchpoints. */
- ccs |= (1 << 19);
- supply_register_by_name (regcache, "ccs", &ccs);
-
- return 0;
-}
-
-int
-crisv32_target::low_remove_point (raw_bkpt_type type, CORE_ADDR addr,
- int len, raw_breakpoint *bp)
-{
- int bp;
- unsigned long bp_ctrl;
- unsigned long start, end;
- struct regcache *regcache;
- unsigned long bp_d_regs[12];
-
- regcache = get_thread_regcache (current_thread, 1);
-
- /* Read watchpoints are set as access watchpoints, because of GDB's
- inability to deal with pure read watchpoints. */
- if (type == raw_bkpt_type_read_wp)
- type = raw_bkpt_type_access_wp;
-
- /* Get the configuration register. */
- collect_register_by_name (regcache, "s0", &bp_ctrl);
-
- /* Try to find a watchpoint that is configured for the
- specified range, then check that read/write also matches. */
-
- /* Ugly pointer arithmetic, since I cannot rely on a
- single switch (addr) as there may be several watchpoints with
- the same start address for example. */
-
- /* Get all range registers to simplify search. */
- collect_register_by_name (regcache, "s3", &bp_d_regs[0]);
- collect_register_by_name (regcache, "s4", &bp_d_regs[1]);
- collect_register_by_name (regcache, "s5", &bp_d_regs[2]);
- collect_register_by_name (regcache, "s6", &bp_d_regs[3]);
- collect_register_by_name (regcache, "s7", &bp_d_regs[4]);
- collect_register_by_name (regcache, "s8", &bp_d_regs[5]);
- collect_register_by_name (regcache, "s9", &bp_d_regs[6]);
- collect_register_by_name (regcache, "s10", &bp_d_regs[7]);
- collect_register_by_name (regcache, "s11", &bp_d_regs[8]);
- collect_register_by_name (regcache, "s12", &bp_d_regs[9]);
- collect_register_by_name (regcache, "s13", &bp_d_regs[10]);
- collect_register_by_name (regcache, "s14", &bp_d_regs[11]);
-
- for (bp = 0; bp < 6; bp++)
- {
- if (bp_d_regs[bp * 2] == addr
- && bp_d_regs[bp * 2 + 1] == (addr + len - 1)) {
- /* Matching range. */
- int bitpos = 2 + bp * 4;
- int rw_bits;
-
- /* Read/write bits for this BP. */
- rw_bits = (bp_ctrl & (0x3 << bitpos)) >> bitpos;
-
- if ((type == raw_bkpt_type_read_wp && rw_bits == 0x1)
- || (type == raw_bkpt_type_write_wp && rw_bits == 0x2)
- || (type == raw_bkpt_type_access_wp && rw_bits == 0x3))
- {
- /* Read/write matched. */
- break;
- }
- }
- }
-
- if (bp > 5)
- {
- /* No watchpoint matched. */
- return -1;
- }
-
- /* Found a matching watchpoint. Now, deconfigure it by
- both disabling read/write in bp_ctrl and zeroing its
- start/end addresses. */
- bp_ctrl &= ~(3 << (2 + (bp * 4)));
- /* Setup the configuration register. */
- supply_register_by_name (regcache, "s0", &bp_ctrl);
-
- start = end = 0;
- /* Configure the watchpoint register. */
- cris_write_data_breakpoint (regcache, bp, start, end);
-
- /* Note that we don't clear the S1 flag here. It's done when continuing. */
- return 0;
-}
-
-bool
-crisv32_target::low_stopped_by_watchpoint ()
-{
- unsigned long exs;
- struct regcache *regcache = get_thread_regcache (current_thread, 1);
-
- collect_register_by_name (regcache, "exs", &exs);
-
- return (((exs & 0xff00) >> 8) == 0xc);
-}
-
-CORE_ADDR
-crisv32_target::low_stopped_data_address ()
-{
- unsigned long eda;
- struct regcache *regcache = get_thread_regcache (current_thread, 1);
-
- collect_register_by_name (regcache, "eda", &eda);
-
- /* FIXME: Possibly adjust to match watched range. */
- return eda;
-}
-
-ps_err_e
-ps_get_thread_area (struct ps_prochandle *ph,
- lwpid_t lwpid, int idx, void **base)
-{
- if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0)
- return PS_ERR;
-
- /* IDX is the bias from the thread pointer to the beginning of the
- thread descriptor. It has to be subtracted due to implementation
- quirks in libthread_db. */
- *base = (void *) ((char *) *base - idx);
- return PS_OK;
-}
-
-static void
-cris_fill_gregset (struct regcache *regcache, void *buf)
-{
- int i;
-
- for (i = 0; i < cris_num_regs; i++)
- {
- if (cris_regmap[i] != -1)
- collect_register (regcache, i, ((char *) buf) + cris_regmap[i]);
- }
-}
-
-static void
-cris_store_gregset (struct regcache *regcache, const void *buf)
-{
- int i;
-
- for (i = 0; i < cris_num_regs; i++)
- {
- if (cris_regmap[i] != -1)
- supply_register (regcache, i, ((char *) buf) + cris_regmap[i]);
- }
-}
-
-void
-crisv32_target::low_arch_setup ()
-{
- current_process ()->tdesc = tdesc_crisv32;
-}
-
-static struct regset_info cris_regsets[] = {
- { PTRACE_GETREGS, PTRACE_SETREGS, 0, cris_num_regs * 4,
- GENERAL_REGS, cris_fill_gregset, cris_store_gregset },
- NULL_REGSET
-};
-
-
-static struct regsets_info cris_regsets_info =
- {
- cris_regsets, /* regsets */
- 0, /* num_regsets */
- NULL, /* disabled_regsets */
- };
-
-static struct usrregs_info cris_usrregs_info =
- {
- cris_num_regs,
- cris_regmap,
- };
-
-static struct regs_info myregs_info =
- {
- NULL, /* regset_bitmap */
- &cris_usrregs_info,
- &cris_regsets_info
- };
-
-const regs_info *
-crisv32_target::get_regs_info ()
-{
- return &myregs_info;
-}
-
-/* The linux target ops object. */
-
-linux_process_target *the_linux_target = &the_crisv32_target;
-
-void
-initialize_low_arch (void)
-{
- init_registers_crisv32 ();
-
- initialize_regsets_info (&cris_regsets_info);
-}
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 5/7] gdbserver: remove support for M32R
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (3 preceding siblings ...)
2020-05-14 17:43 ` [PATCH 4/7] gdbserver: remove support for CRIS Simon Marchi
@ 2020-05-14 17:43 ` Simon Marchi
2020-05-14 17:43 ` [PATCH 6/7] gdbserver: remove support for Tile Simon Marchi
` (6 subsequent siblings)
11 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 17:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
This port has been unmaintained for years and the upstream Linux kernel
does not support this architecture anymore, remove it.
gdbserver/ChangeLog:
* Makefile.in (SFILES): Remove linux-m32r-low.cc.
* README: Remove m32r target.
* configure.srv: Remove m32r case.
* linux-m32r-low.cc: Remove.
---
gdbserver/Makefile.in | 1 -
gdbserver/README | 1 -
gdbserver/configure.srv | 5 --
gdbserver/linux-m32r-low.cc | 163 ------------------------------------
4 files changed, 170 deletions(-)
delete mode 100644 gdbserver/linux-m32r-low.cc
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 329962938173..80cc12e58603 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -182,7 +182,6 @@ SFILES = \
$(srcdir)/linux-arm-low.cc \
$(srcdir)/linux-ia64-low.cc \
$(srcdir)/linux-low.cc \
- $(srcdir)/linux-m32r-low.cc \
$(srcdir)/linux-m68k-low.cc \
$(srcdir)/linux-mips-low.cc \
$(srcdir)/linux-nios2-low.cc \
diff --git a/gdbserver/README b/gdbserver/README
index 431245fb8f88..b90efc317b88 100644
--- a/gdbserver/README
+++ b/gdbserver/README
@@ -85,7 +85,6 @@ The supported targets are:
i[34567]86-*-linux*
i[34567]86-*-mingw*
ia64-*-linux*
- m32r*-*-linux*
m68*-*-linux*
m68*-*-uclinux*
mips*64*-*-linux*
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index e362c961703f..76d2b8e7e025 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -125,11 +125,6 @@ case "${gdbserver_host}" in
srv_tgtobj="$srv_linux_obj linux-ia64-low.o"
srv_linux_usrregs=yes
;;
- m32r*-*-linux*) srv_regobj=reg-m32r.o
- srv_tgtobj="$srv_linux_obj linux-m32r-low.o"
- srv_linux_usrregs=yes
- srv_linux_thread_db=yes
- ;;
m68*-*-linux*) if test "$gdb_cv_m68k_is_coldfire" = yes; then
srv_regobj=reg-cf.o
else
diff --git a/gdbserver/linux-m32r-low.cc b/gdbserver/linux-m32r-low.cc
deleted file mode 100644
index 3f84b17302a1..000000000000
--- a/gdbserver/linux-m32r-low.cc
+++ /dev/null
@@ -1,163 +0,0 @@
-/* GNU/Linux/m32r specific low level interface, for the remote server for GDB.
- Copyright (C) 2005-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "linux-low.h"
-
-#ifdef HAVE_SYS_REG_H
-#include <sys/reg.h>
-#endif
-
-/* Linux target op definitions for the m32r architecture. */
-
-class m32r_target : public linux_process_target
-{
-public:
-
- const regs_info *get_regs_info () override;
-
- const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-
-protected:
-
- void low_arch_setup () override;
-
- bool low_cannot_fetch_register (int regno) override;
-
- bool low_cannot_store_register (int regno) override;
-
- bool low_supports_breakpoints () override;
-
- CORE_ADDR low_get_pc (regcache *regcache) override;
-
- void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
-
- bool low_breakpoint_at (CORE_ADDR pc) override;
-};
-
-/* The singleton target ops object. */
-
-static m32r_target the_m32r_target;
-
-bool
-m32r_target::low_supports_breakpoints ()
-{
- return true;
-}
-
-CORE_ADDR
-m32r_target::low_get_pc (regcache *regcache)
-{
- return linux_get_pc_32bit (regcache);
-}
-
-void
-m32r_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
-{
- linux_set_pc_32bit (regcache, pc);
-}
-
-/* Defined in auto-generated file reg-m32r.c. */
-void init_registers_m32r (void);
-extern const struct target_desc *tdesc_m32r;
-
-#define m32r_num_regs 25
-
-static int m32r_regmap[] = {
-#ifdef PT_R0
- PT_R0, PT_R1, PT_R2, PT_R3, PT_R4, PT_R5, PT_R6, PT_R7,
- PT_R8, PT_R9, PT_R10, PT_R11, PT_R12, PT_FP, PT_LR, PT_SPU,
- PT_PSW, PT_CBR, PT_SPI, PT_SPU, PT_BPC, PT_PC, PT_ACCL, PT_ACCH, PT_EVB
-#else
- 4 * 4, 4 * 5, 4 * 6, 4 * 7, 4 * 0, 4 * 1, 4 * 2, 4 * 8,
- 4 * 9, 4 * 10, 4 * 11, 4 * 12, 4 * 13, 4 * 24, 4 * 25, 4 * 23,
- 4 * 19, 4 * 31, 4 * 26, 4 * 23, 4 * 20, 4 * 30, 4 * 16, 4 * 15, 4 * 32
-#endif
-};
-
-bool
-m32r_target::low_cannot_store_register (int regno)
-{
- return (regno >= m32r_num_regs);
-}
-
-bool
-m32r_target::low_cannot_fetch_register (int regno)
-{
- return (regno >= m32r_num_regs);
-}
-
-static const unsigned short m32r_breakpoint = 0x10f1;
-#define m32r_breakpoint_len 2
-
-/* Implementation of target ops method "sw_breakpoint_from_kind". */
-
-const gdb_byte *
-m32r_target::sw_breakpoint_from_kind (int kind, int *size)
-{
- *size = m32r_breakpoint_len;
- return (const gdb_byte *) &m32r_breakpoint;
-}
-
-bool
-m32r_target::low_breakpoint_at (CORE_ADDR where)
-{
- unsigned short insn;
-
- read_memory (where, (unsigned char *) &insn, m32r_breakpoint_len);
- if (insn == m32r_breakpoint)
- return true;
-
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return false;
-}
-
-void
-m32r_target::low_arch_setup ()
-{
- current_process ()->tdesc = tdesc_m32r;
-}
-
-static struct usrregs_info m32r_usrregs_info =
- {
- m32r_num_regs,
- m32r_regmap,
- };
-
-static struct regs_info myregs_info =
- {
- NULL, /* regset_bitmap */
- &m32r_usrregs_info,
- };
-
-const regs_info *
-m32r_target::get_regs_info ()
-{
- return &myregs_info;
-}
-
-/* The linux target ops object. */
-
-linux_process_target *the_linux_target = &the_m32r_target;
-
-void
-initialize_low_arch (void)
-{
- init_registers_m32r ();
-}
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 6/7] gdbserver: remove support for Tile
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (4 preceding siblings ...)
2020-05-14 17:43 ` [PATCH 5/7] gdbserver: remove support for M32R Simon Marchi
@ 2020-05-14 17:43 ` Simon Marchi
2020-05-14 18:59 ` [PATCH 0/7] Remove obsolete GDBserver ports Kevin Buettner
` (5 subsequent siblings)
11 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 17:43 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
This port has been unmaintained for years and the upstream Linux kernel
does not support this architecture anymore, remove it.
gdbserver/ChangeLog:
* Makefile.in (SFILES): linux-tile-low.cc.
* configure.srv: Remove tilegx case.
* linux-tile-low.cc: Remove.
---
gdbserver/Makefile.in | 1 -
gdbserver/configure.srv | 6 -
gdbserver/linux-tile-low.cc | 227 ------------------------------------
3 files changed, 234 deletions(-)
delete mode 100644 gdbserver/linux-tile-low.cc
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index 80cc12e58603..cc5fa427c933 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -190,7 +190,6 @@ SFILES = \
$(srcdir)/linux-s390-low.cc \
$(srcdir)/linux-sh-low.cc \
$(srcdir)/linux-sparc-low.cc \
- $(srcdir)/linux-tile-low.cc \
$(srcdir)/linux-x86-low.cc \
$(srcdir)/linux-xtensa-low.cc \
$(srcdir)/mem-break.cc \
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index 76d2b8e7e025..b376cb13449c 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -375,12 +375,6 @@ case "${gdbserver_host}" in
srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
- tilegx-*-linux*) srv_regobj=reg-tilegx.o
- srv_regobj="${srv_regobj} reg-tilegx32.o"
- srv_tgtobj="$srv_linux_obj linux-tile-low.o"
- srv_linux_regsets=yes
- srv_linux_thread_db=yes
- ;;
*)
# Who are you?
UNSUPPORTED=1
diff --git a/gdbserver/linux-tile-low.cc b/gdbserver/linux-tile-low.cc
deleted file mode 100644
index fa24b0899c02..000000000000
--- a/gdbserver/linux-tile-low.cc
+++ /dev/null
@@ -1,227 +0,0 @@
-/* GNU/Linux/TILE-Gx specific low level interface, GDBserver.
-
- Copyright (C) 2012-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "linux-low.h"
-
-#include <arch/abi.h>
-#include "nat/gdb_ptrace.h"
-
-/* Linux target op definitions for the TILE-Gx architecture. */
-
-class tile_target : public linux_process_target
-{
-public:
-
- const regs_info *get_regs_info () override;
-
- const gdb_byte *sw_breakpoint_from_kind (int kind, int *size) override;
-
-protected:
-
- void low_arch_setup () override;
-
- bool low_cannot_fetch_register (int regno) override;
-
- bool low_cannot_store_register (int regno) override;
-
- bool low_supports_breakpoints () override;
-
- CORE_ADDR low_get_pc (regcache *regcache) override;
-
- void low_set_pc (regcache *regcache, CORE_ADDR newpc) override;
-
- bool low_breakpoint_at (CORE_ADDR pc) override;
-};
-
-/* The singleton target ops object. */
-
-static tile_target the_tile_target;
-
-bool
-tile_target::low_supports_breakpoints ()
-{
- return true;
-}
-
-CORE_ADDR
-tile_target::low_get_pc (regcache *regcache)
-{
- return linux_get_pc_64bit (regcache);
-}
-
-void
-tile_target::low_set_pc (regcache *regcache, CORE_ADDR pc)
-{
- linux_set_pc_64bit (regcache, pc);
-}
-
-/* Defined in auto-generated file reg-tilegx.c. */
-void init_registers_tilegx (void);
-extern const struct target_desc *tdesc_tilegx;
-
-/* Defined in auto-generated file reg-tilegx32.c. */
-void init_registers_tilegx32 (void);
-extern const struct target_desc *tdesc_tilegx32;
-
-#define tile_num_regs 65
-
-static int tile_regmap[] =
-{
- 0, 1, 2, 3, 4, 5, 6, 7,
- 8, 9, 10, 11, 12, 13, 14, 15,
- 16, 17, 18, 19, 20, 21, 22, 23,
- 24, 25, 26, 27, 28, 29, 30, 31,
- 32, 33, 34, 35, 36, 37, 38, 39,
- 40, 41, 42, 43, 44, 45, 46, 47,
- 48, 49, 50, 51, 52, 53, 54, 55,
- -1, -1, -1, -1, -1, -1, -1, -1,
- 56
-};
-
-bool
-tile_target::low_cannot_fetch_register (int regno)
-{
- if (regno >= 0 && regno < 56)
- return false;
- else if (regno == 64)
- return false;
- else
- return true;
-}
-
-bool
-tile_target::low_cannot_store_register (int regno)
-{
- if (regno >= 0 && regno < 56)
- return false;
- else if (regno == 64)
- return false;
- else
- return true;
-}
-
-static uint64_t tile_breakpoint = 0x400b3cae70166000ULL;
-#define tile_breakpoint_len 8
-
-/* Implementation of target ops method "sw_breakpoint_from_kind". */
-
-const gdb_byte *
-tile_target::sw_breakpoint_from_kind (int kind, int *size)
-{
- *size = tile_breakpoint_len;
- return (const gdb_byte *) &tile_breakpoint;
-}
-
-bool
-tile_target::low_breakpoint_at (CORE_ADDR where)
-{
- uint64_t insn;
-
- read_memory (where, (unsigned char *) &insn, 8);
- if (insn == tile_breakpoint)
- return true;
-
- /* If necessary, recognize more trap instructions here. GDB only uses the
- one. */
- return false;
-}
-
-static void
-tile_fill_gregset (struct regcache *regcache, void *buf)
-{
- int i;
-
- for (i = 0; i < tile_num_regs; i++)
- if (tile_regmap[i] != -1)
- collect_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
-}
-
-static void
-tile_store_gregset (struct regcache *regcache, const void *buf)
-{
- int i;
-
- for (i = 0; i < tile_num_regs; i++)
- if (tile_regmap[i] != -1)
- supply_register (regcache, i, ((uint_reg_t *) buf) + tile_regmap[i]);
-}
-
-static struct regset_info tile_regsets[] =
-{
- { PTRACE_GETREGS, PTRACE_SETREGS, 0, tile_num_regs * 8,
- GENERAL_REGS, tile_fill_gregset, tile_store_gregset },
- NULL_REGSET
-};
-
-static struct regsets_info tile_regsets_info =
- {
- tile_regsets, /* regsets */
- 0, /* num_regsets */
- NULL, /* disabled_regsets */
- };
-
-static struct usrregs_info tile_usrregs_info =
- {
- tile_num_regs,
- tile_regmap,
- };
-
-static struct regs_info myregs_info =
- {
- NULL, /* regset_bitmap */
- &tile_usrregs_info,
- &tile_regsets_info,
- };
-
-const regs_info *
-tile_target::get_regs_info ()
-{
- return &myregs_info;
-}
-
-void
-tile_target::low_arch_setup ()
-{
- int pid = pid_of (current_thread);
- unsigned int machine;
- int is_elf64 = linux_pid_exe_is_elf_64_file (pid, &machine);
-
- if (sizeof (void *) == 4)
- if (is_elf64 > 0)
- error (_("Can't debug 64-bit process with 32-bit GDBserver"));
-
- if (!is_elf64)
- current_process ()->tdesc = tdesc_tilegx32;
- else
- current_process ()->tdesc = tdesc_tilegx;
-}
-
-/* The linux target ops object. */
-
-linux_process_target *the_linux_target = &the_tile_target;
-
-void
-initialize_low_arch (void)
-{
- init_registers_tilegx32();
- init_registers_tilegx();
-
- initialize_regsets_info (&tile_regsets_info);
-}
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/7] Remove obsolete GDBserver ports
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (5 preceding siblings ...)
2020-05-14 17:43 ` [PATCH 6/7] gdbserver: remove support for Tile Simon Marchi
@ 2020-05-14 18:59 ` Kevin Buettner
2020-05-14 19:12 ` Simon Marchi
2020-05-14 19:05 ` [PATCH 7/7] gdbserver: remove support for ARM/WinCE Simon Marchi
` (4 subsequent siblings)
11 siblings, 1 reply; 21+ messages in thread
From: Kevin Buettner @ 2020-05-14 18:59 UTC (permalink / raw)
To: Simon Marchi via Gdb-patches; +Cc: Simon Marchi
On Thu, 14 May 2020 13:43:52 -0400
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> wrote:
> This series implements the removal of obsolete gdbserver ports, as discussed
> here:
>
> https://sourceware.org/pipermail/gdb-patches/2020-May/168361.html
>
> I'm not in a hurry to merge this. I don't recall the exact process for
> removing support for a platform/architecture from GDB/GDBserver (I could
> document it on the wiki if someone points me to it, if it's not already there).
> If needed, we can announce these ports as deprecated for the next GDB release
> (10.1 ?), and then merge this series in master right after we have created the
> gdb-10-branch. Or if you think this is unnecessary, we can merge it right
> away, I don't mind.
I'm in favor of this patch series going in.
I looked over each part. They all LGTM.
Kevin
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/7] Remove obsolete GDBserver ports
2020-05-14 18:59 ` [PATCH 0/7] Remove obsolete GDBserver ports Kevin Buettner
@ 2020-05-14 19:12 ` Simon Marchi
0 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 19:12 UTC (permalink / raw)
To: Kevin Buettner, Simon Marchi via Gdb-patches; +Cc: Simon Marchi
On 2020-05-14 2:59 p.m., Kevin Buettner via Gdb-patches wrote:
> On Thu, 14 May 2020 13:43:52 -0400
> Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> wrote:
>
>> This series implements the removal of obsolete gdbserver ports, as discussed
>> here:
>>
>> https://sourceware.org/pipermail/gdb-patches/2020-May/168361.html
>>
>> I'm not in a hurry to merge this. I don't recall the exact process for
>> removing support for a platform/architecture from GDB/GDBserver (I could
>> document it on the wiki if someone points me to it, if it's not already there).
>> If needed, we can announce these ports as deprecated for the next GDB release
>> (10.1 ?), and then merge this series in master right after we have created the
>> gdb-10-branch. Or if you think this is unnecessary, we can merge it right
>> away, I don't mind.
>
> I'm in favor of this patch series going in.
>
> I looked over each part. They all LGTM.
>
> Kevin
>
Thanks Kevin. Note that patch 7/7 didn't go through at first, so you might want
to look at it too.
Simon
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 7/7] gdbserver: remove support for ARM/WinCE
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (6 preceding siblings ...)
2020-05-14 18:59 ` [PATCH 0/7] Remove obsolete GDBserver ports Kevin Buettner
@ 2020-05-14 19:05 ` Simon Marchi
2020-05-14 20:30 ` Kevin Buettner
2020-05-15 11:09 ` Pedro Alves
2020-05-14 19:07 ` [PATCH 0/7] Remove obsolete GDBserver ports Christian Biesinger
` (3 subsequent siblings)
11 siblings, 2 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 19:05 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
This port has been unmaintained for years, remove it.
gdbserver/ChangeLog:
* Makefile.in (SFILES): Remove win32-arm-low.cc, wincecompat.cc.
* configure.srv: Remove mingw32ce cases.
* server.h, win32-low.cc: Remove __MINGW32CE__-guarded code.
* win32-low.h (to_back_slashes): Remove.
* win32-arm-low.cc, wincecompat.cc, wincecompat.h: Remove.
---
gdbserver/Makefile.in | 2 -
gdbserver/configure.srv | 20 -----
gdbserver/server.h | 4 -
gdbserver/win32-arm-low.cc | 168 -------------------------------------
gdbserver/win32-low.cc | 101 +++++++---------------
gdbserver/win32-low.h | 4 -
gdbserver/wincecompat.cc | 38 ---------
gdbserver/wincecompat.h | 30 -------
8 files changed, 29 insertions(+), 338 deletions(-)
delete mode 100644 gdbserver/win32-arm-low.cc
delete mode 100644 gdbserver/wincecompat.cc
delete mode 100644 gdbserver/wincecompat.h
diff --git a/gdbserver/Makefile.in b/gdbserver/Makefile.in
index cc5fa427c933..7321ba12c2eb 100644
--- a/gdbserver/Makefile.in
+++ b/gdbserver/Makefile.in
@@ -202,10 +202,8 @@ SFILES = \
$(srcdir)/target.cc \
$(srcdir)/thread-db.cc \
$(srcdir)/utils.cc \
- $(srcdir)/win32-arm-low.cc \
$(srcdir)/win32-i386-low.cc \
$(srcdir)/win32-low.cc \
- $(srcdir)/wincecompat.cc \
$(srcdir)/x86-low.cc \
$(srcdir)/../gdb/alloc.c \
$(srcdir)/../gdb/arch/arm.c \
diff --git a/gdbserver/configure.srv b/gdbserver/configure.srv
index b376cb13449c..5e33bd9c54d6 100644
--- a/gdbserver/configure.srv
+++ b/gdbserver/configure.srv
@@ -73,14 +73,6 @@ case "${gdbserver_host}" in
srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
- arm*-*-mingw32ce*) srv_regobj=reg-arm.o
- srv_tgtobj="win32-low.o windows-nat.o win32-arm-low.o"
- srv_tgtobj="${srv_tgtobj} wincecompat.o"
- # hostio_last_error implementation is in win32-low.c
- srv_hostio_err_objs=""
- srv_mingw=yes
- srv_mingwce=yes
- ;;
i[34567]86-*-cygwin*) srv_regobj=""
srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
@@ -102,18 +94,6 @@ case "${gdbserver_host}" in
ipa_obj="linux-i386-ipa.o linux-x86-tdesc-ipa.o"
ipa_obj="${ipa_obj} arch/i386-ipa.o"
;;
- i[34567]86-*-mingw32ce*)
- srv_regobj=""
- srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
- srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
- srv_tgtobj="${srv_tgtobj} nat/windows-nat.o"
- srv_tgtobj="${srv_tgtobj} arch/i386.o"
- srv_tgtobj="${srv_tgtobj} wincecompat.o"
- # hostio_last_error implementation is in win32-low.c
- srv_hostio_err_objs=""
- srv_mingw=yes
- srv_mingwce=yes
- ;;
i[34567]86-*-mingw*) srv_regobj=""
srv_tgtobj="x86-low.o nat/x86-dregs.o win32-low.o"
srv_tgtobj="${srv_tgtobj} win32-i386-low.o"
diff --git a/gdbserver/server.h b/gdbserver/server.h
index 09989e46264c..22228050a806 100644
--- a/gdbserver/server.h
+++ b/gdbserver/server.h
@@ -31,10 +31,6 @@
gdb_static_assert (sizeof (CORE_ADDR) >= sizeof (void *));
-#ifdef __MINGW32CE__
-#include "wincecompat.h"
-#endif
-
#include "gdbsupport/version.h"
#if !HAVE_DECL_PERROR
diff --git a/gdbserver/win32-arm-low.cc b/gdbserver/win32-arm-low.cc
deleted file mode 100644
index aacf2cdf8cd3..000000000000
--- a/gdbserver/win32-arm-low.cc
+++ /dev/null
@@ -1,168 +0,0 @@
-/* Copyright (C) 2007-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-#include "win32-low.h"
-
-using namespace windows_nat;
-
-#ifndef CONTEXT_FLOATING_POINT
-#define CONTEXT_FLOATING_POINT 0
-#endif
-
-/* Defined in auto-generated file reg-arm.c. */
-void init_registers_arm (void);
-extern const struct target_desc *tdesc_arm;
-
-static void
-arm_get_thread_context (windows_thread_info *th)
-{
- th->context.ContextFlags = \
- CONTEXT_FULL | \
- CONTEXT_FLOATING_POINT;
-
- GetThreadContext (th->h, &th->context);
-}
-
-#define context_offset(x) ((int)&(((CONTEXT *)NULL)->x))
-static const int mappings[] = {
- context_offset (R0),
- context_offset (R1),
- context_offset (R2),
- context_offset (R3),
- context_offset (R4),
- context_offset (R5),
- context_offset (R6),
- context_offset (R7),
- context_offset (R8),
- context_offset (R9),
- context_offset (R10),
- context_offset (R11),
- context_offset (R12),
- context_offset (Sp),
- context_offset (Lr),
- context_offset (Pc),
- -1, /* f0 */
- -1, /* f1 */
- -1, /* f2 */
- -1, /* f3 */
- -1, /* f4 */
- -1, /* f5 */
- -1, /* f6 */
- -1, /* f7 */
- -1, /* fps */
- context_offset (Psr),
-};
-#undef context_offset
-
-/* Return a pointer into a CONTEXT field indexed by gdb register number.
- Return a pointer to an dummy register holding zero if there is no
- corresponding CONTEXT field for the given register number. */
-static char *
-regptr (CONTEXT* c, int r)
-{
- if (mappings[r] < 0)
- {
- static ULONG zero;
- /* Always force value to zero, in case the user tried to write
- to this register before. */
- zero = 0;
- return (char *) &zero;
- }
- else
- return (char *) c + mappings[r];
-}
-
-/* Fetch register from gdbserver regcache data. */
-static void
-arm_fetch_inferior_register (struct regcache *regcache,
- windows_thread_info *th, int r)
-{
- char *context_offset = regptr (&th->context, r);
- supply_register (regcache, r, context_offset);
-}
-
-/* Store a new register value into the thread context of TH. */
-static void
-arm_store_inferior_register (struct regcache *regcache,
- windows_thread_info *th, int r)
-{
- collect_register (regcache, r, regptr (&th->context, r));
-}
-
-static void
-arm_arch_setup (void)
-{
- init_registers_arm ();
- win32_tdesc = tdesc_arm;
-}
-
-/* Implement win32_target_ops "num_regs" method. */
-
-static int
-arm_num_regs (void)
-{
- return sizeof (mappings) / sizeof (mappings[0]),
-}
-
-/* Correct in either endianness. We do not support Thumb yet. */
-static const unsigned long arm_wince_breakpoint = 0xe6000010;
-#define arm_wince_breakpoint_len 4
-
-/* Implement win32_target_ops "get_pc" method. */
-
-static CORE_ADDR
-arm_win32_get_pc (struct regcache *regcache)
-{
- uint32_t pc;
-
- collect_register_by_name (regcache, "pc", &pc);
- return (CORE_ADDR) pc;
-}
-
-/* Implement win32_target_ops "set_pc" method. */
-
-static void
-arm_win32_set_pc (struct regcache *regcache, CORE_ADDR pc)
-{
- uint32_t newpc = pc;
-
- supply_register_by_name (regcache, "pc", &newpc);
-}
-
-struct win32_target_ops the_low_target = {
- arm_arch_setup,
- arm_num_regs,
- NULL, /* initial_stuff */
- arm_get_thread_context,
- NULL, /* prepare_to_resume */
- NULL, /* thread_added */
- arm_fetch_inferior_register,
- arm_store_inferior_register,
- NULL, /* single_step */
- (const unsigned char *) &arm_wince_breakpoint,
- arm_wince_breakpoint_len,
- 0,
- arm_win32_get_pc,
- arm_win32_set_pc,
- /* Watchpoint related functions. See target.h for comments. */
- NULL, /* supports_z_point_type */
- NULL, /* insert_point */
- NULL, /* remove_point */
- NULL, /* stopped_by_watchpoint */
- NULL /* stopped_data_address */
-};
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
index 4eb63b7ca25a..d671691a575d 100644
--- a/gdbserver/win32-low.cc
+++ b/gdbserver/win32-low.cc
@@ -1414,69 +1414,39 @@ get_child_debug_event (DWORD *continue_status,
goto gotevent;
}
-#ifndef _WIN32_WCE
attaching = 0;
-#else
- if (attaching)
- {
- /* WinCE doesn't set an initial breakpoint automatically. To
- stop the inferior, we flush all currently pending debug
- events -- the thread list and the dll list are always
- reported immediatelly without delay, then, we suspend all
- threads and pretend we saw a trap at the current PC of the
- main thread.
-
- Contrary to desktop Windows, Windows CE *does* report the dll
- names on LOAD_DLL_DEBUG_EVENTs resulting from a
- DebugActiveProcess call. This limits the way we can detect
- if all the dlls have already been reported. If we get a real
- debug event before leaving attaching, the worst that will
- happen is the user will see a spurious breakpoint. */
-
- current_event.dwDebugEventCode = 0;
- if (!wait_for_debug_event (¤t_event, 0))
- {
- OUTMSG2(("no attach events left\n"));
- fake_breakpoint_event ();
- attaching = 0;
- }
- else
- OUTMSG2(("got attach event\n"));
- }
- else
-#endif
- {
- gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
- if (stop.has_value ())
- {
- *ourstatus = stop->status;
- current_event = stop->event;
- ptid = debug_event_ptid (¤t_event);
- current_thread = find_thread_ptid (ptid);
- return 1;
- }
+ {
+ gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
+ if (stop.has_value ())
+ {
+ *ourstatus = stop->status;
+ current_event = stop->event;
+ ptid = debug_event_ptid (¤t_event);
+ current_thread = find_thread_ptid (ptid);
+ return 1;
+ }
- /* Keep the wait time low enough for comfortable remote
- interruption, but high enough so gdbserver doesn't become a
- bottleneck. */
- if (!wait_for_debug_event (¤t_event, 250))
- {
- DWORD e = GetLastError();
+ /* Keep the wait time low enough for comfortable remote
+ interruption, but high enough so gdbserver doesn't become a
+ bottleneck. */
+ if (!wait_for_debug_event (¤t_event, 250))
+ {
+ DWORD e = GetLastError();
- if (e == ERROR_PIPE_NOT_CONNECTED)
- {
- /* This will happen if the loader fails to succesfully
- load the application, e.g., if the main executable
- tries to pull in a non-existing export from a
- DLL. */
- ourstatus->kind = TARGET_WAITKIND_EXITED;
- ourstatus->value.integer = 1;
- return 1;
- }
+ if (e == ERROR_PIPE_NOT_CONNECTED)
+ {
+ /* This will happen if the loader fails to succesfully
+ load the application, e.g., if the main executable
+ tries to pull in a non-existing export from a
+ DLL. */
+ ourstatus->kind = TARGET_WAITKIND_EXITED;
+ ourstatus->value.integer = 1;
+ return 1;
+ }
- return 0;
- }
- }
+ return 0;
+ }
+ }
gotevent:
@@ -1521,19 +1491,6 @@ get_child_debug_event (DWORD *continue_status,
main_thread_id,
current_event.u.CreateProcessInfo.hThread,
current_event.u.CreateProcessInfo.lpThreadLocalBase);
-
-#ifdef _WIN32_WCE
- if (!attaching)
- {
- /* Windows CE doesn't set the initial breakpoint
- automatically like the desktop versions of Windows do.
- We add it explicitly here. It will be removed as soon as
- it is hit. */
- set_breakpoint_at ((CORE_ADDR) (long) current_event.u
- .CreateProcessInfo.lpStartAddress,
- auto_delete_breakpoint);
- }
-#endif
break;
case EXIT_PROCESS_DEBUG_EVENT:
diff --git a/gdbserver/win32-low.h b/gdbserver/win32-low.h
index a023eb1f8394..f3b44776ae1c 100644
--- a/gdbserver/win32-low.h
+++ b/gdbserver/win32-low.h
@@ -183,8 +183,4 @@ extern void win32_require_context (windows_nat::windows_thread_info *th);
of GetLastError. */
extern char * strwinerror (DWORD error);
-/* in wincecompat.c */
-
-extern void to_back_slashes (char *);
-
#endif /* GDBSERVER_WIN32_LOW_H */
diff --git a/gdbserver/wincecompat.cc b/gdbserver/wincecompat.cc
deleted file mode 100644
index 46eece17e557..000000000000
--- a/gdbserver/wincecompat.cc
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Compatibility routines for Windows CE.
- Copyright (C) 2007-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#include "server.h"
-
-#include <windows.h>
-
-void
-perror (const char *s)
-{
- if (s && *s)
- fprintf (stderr, "%s: %s\n", s, strwinerror (GetLastError ()));
- else
- fprintf (stderr, "%s\n", strwinerror (GetLastError ()));
-}
-
-void
-to_back_slashes (char *path)
-{
- for (; *path; ++path)
- if ('/' == *path)
- *path = '\\';
-}
diff --git a/gdbserver/wincecompat.h b/gdbserver/wincecompat.h
deleted file mode 100644
index 34705c3d66c5..000000000000
--- a/gdbserver/wincecompat.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Compatibility routines for Windows CE.
- Copyright (C) 2007-2020 Free Software Foundation, Inc.
-
- This file is part of GDB.
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
-
-#ifndef GDBSERVER_WINCECOMPAT_H
-#define GDBSERVER_WINCECOMPAT_H
-
-#include <windows.h>
-
-#define errno (GetLastError ())
-
-/* in win32-low.c */
-extern char * strwinerror (DWORD error);
-#define strerror strwinerror
-
-#endif /* GDBSERVER_WINCECOMPAT_H */
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/7] gdbserver: remove support for ARM/WinCE
2020-05-14 19:05 ` [PATCH 7/7] gdbserver: remove support for ARM/WinCE Simon Marchi
@ 2020-05-14 20:30 ` Kevin Buettner
2020-05-14 23:14 ` Simon Marchi
2020-05-15 11:09 ` Pedro Alves
1 sibling, 1 reply; 21+ messages in thread
From: Kevin Buettner @ 2020-05-14 20:30 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
Hi Simon,
Just one nit, maybe...
On Thu, 14 May 2020 15:05:37 -0400
Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> wrote:
> diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
> index 4eb63b7ca25a..d671691a575d 100644
> --- a/gdbserver/win32-low.cc
> +++ b/gdbserver/win32-low.cc
> @@ -1414,69 +1414,39 @@ get_child_debug_event (DWORD *continue_status,
> goto gotevent;
> }
>
> -#ifndef _WIN32_WCE
> attaching = 0;
> -#else
> - if (attaching)
> - {
> - /* WinCE doesn't set an initial breakpoint automatically. To
> - stop the inferior, we flush all currently pending debug
> - events -- the thread list and the dll list are always
> - reported immediatelly without delay, then, we suspend all
> - threads and pretend we saw a trap at the current PC of the
> - main thread.
> -
> - Contrary to desktop Windows, Windows CE *does* report the dll
> - names on LOAD_DLL_DEBUG_EVENTs resulting from a
> - DebugActiveProcess call. This limits the way we can detect
> - if all the dlls have already been reported. If we get a real
> - debug event before leaving attaching, the worst that will
> - happen is the user will see a spurious breakpoint. */
> -
> - current_event.dwDebugEventCode = 0;
> - if (!wait_for_debug_event (¤t_event, 0))
> - {
> - OUTMSG2(("no attach events left\n"));
> - fake_breakpoint_event ();
> - attaching = 0;
> - }
> - else
> - OUTMSG2(("got attach event\n"));
> - }
> - else
> -#endif
> - {
> - gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
> - if (stop.has_value ())
> - {
> - *ourstatus = stop->status;
> - current_event = stop->event;
> - ptid = debug_event_ptid (¤t_event);
> - current_thread = find_thread_ptid (ptid);
> - return 1;
> - }
> + {
I think this brace and the matching one later on can be removed, with
a corresponding reduction in indent level for the enclosed block.
> + gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
> + if (stop.has_value ())
> + {
> + *ourstatus = stop->status;
> + current_event = stop->event;
> + ptid = debug_event_ptid (¤t_event);
> + current_thread = find_thread_ptid (ptid);
> + return 1;
> + }
>
> - /* Keep the wait time low enough for comfortable remote
> - interruption, but high enough so gdbserver doesn't become a
> - bottleneck. */
> - if (!wait_for_debug_event (¤t_event, 250))
> - {
> - DWORD e = GetLastError();
> + /* Keep the wait time low enough for comfortable remote
> + interruption, but high enough so gdbserver doesn't become a
> + bottleneck. */
> + if (!wait_for_debug_event (¤t_event, 250))
> + {
> + DWORD e = GetLastError();
>
> - if (e == ERROR_PIPE_NOT_CONNECTED)
> - {
> - /* This will happen if the loader fails to succesfully
> - load the application, e.g., if the main executable
> - tries to pull in a non-existing export from a
> - DLL. */
> - ourstatus->kind = TARGET_WAITKIND_EXITED;
> - ourstatus->value.integer = 1;
> - return 1;
> - }
> + if (e == ERROR_PIPE_NOT_CONNECTED)
> + {
> + /* This will happen if the loader fails to succesfully
> + load the application, e.g., if the main executable
> + tries to pull in a non-existing export from a
> + DLL. */
> + ourstatus->kind = TARGET_WAITKIND_EXITED;
> + ourstatus->value.integer = 1;
> + return 1;
> + }
>
> - return 0;
> - }
> - }
> + return 0;
> + }
> + }
I think that's the matching brace, above.
Kevin
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/7] gdbserver: remove support for ARM/WinCE
2020-05-14 20:30 ` Kevin Buettner
@ 2020-05-14 23:14 ` Simon Marchi
2020-05-15 1:03 ` Kevin Buettner
0 siblings, 1 reply; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 23:14 UTC (permalink / raw)
To: Kevin Buettner, gdb-patches; +Cc: Simon Marchi
On 2020-05-14 4:30 p.m., Kevin Buettner via Gdb-patches wrote:
> Hi Simon,
>
> Just one nit, maybe...
>
> On Thu, 14 May 2020 15:05:37 -0400
> Simon Marchi via Gdb-patches <gdb-patches@sourceware.org> wrote:
>
>> diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc
>> index 4eb63b7ca25a..d671691a575d 100644
>> --- a/gdbserver/win32-low.cc
>> +++ b/gdbserver/win32-low.cc
>> @@ -1414,69 +1414,39 @@ get_child_debug_event (DWORD *continue_status,
>> goto gotevent;
>> }
>>
>> -#ifndef _WIN32_WCE
>> attaching = 0;
>> -#else
>> - if (attaching)
>> - {
>> - /* WinCE doesn't set an initial breakpoint automatically. To
>> - stop the inferior, we flush all currently pending debug
>> - events -- the thread list and the dll list are always
>> - reported immediatelly without delay, then, we suspend all
>> - threads and pretend we saw a trap at the current PC of the
>> - main thread.
>> -
>> - Contrary to desktop Windows, Windows CE *does* report the dll
>> - names on LOAD_DLL_DEBUG_EVENTs resulting from a
>> - DebugActiveProcess call. This limits the way we can detect
>> - if all the dlls have already been reported. If we get a real
>> - debug event before leaving attaching, the worst that will
>> - happen is the user will see a spurious breakpoint. */
>> -
>> - current_event.dwDebugEventCode = 0;
>> - if (!wait_for_debug_event (¤t_event, 0))
>> - {
>> - OUTMSG2(("no attach events left\n"));
>> - fake_breakpoint_event ();
>> - attaching = 0;
>> - }
>> - else
>> - OUTMSG2(("got attach event\n"));
>> - }
>> - else
>> -#endif
>> - {
>> - gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
>> - if (stop.has_value ())
>> - {
>> - *ourstatus = stop->status;
>> - current_event = stop->event;
>> - ptid = debug_event_ptid (¤t_event);
>> - current_thread = find_thread_ptid (ptid);
>> - return 1;
>> - }
>> + {
>
> I think this brace and the matching one later on can be removed, with
> a corresponding reduction in indent level for the enclosed block.
>
>> + gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
>> + if (stop.has_value ())
>> + {
>> + *ourstatus = stop->status;
>> + current_event = stop->event;
>> + ptid = debug_event_ptid (¤t_event);
>> + current_thread = find_thread_ptid (ptid);
>> + return 1;
>> + }
>>
>> - /* Keep the wait time low enough for comfortable remote
>> - interruption, but high enough so gdbserver doesn't become a
>> - bottleneck. */
>> - if (!wait_for_debug_event (¤t_event, 250))
>> - {
>> - DWORD e = GetLastError();
>> + /* Keep the wait time low enough for comfortable remote
>> + interruption, but high enough so gdbserver doesn't become a
>> + bottleneck. */
>> + if (!wait_for_debug_event (¤t_event, 250))
>> + {
>> + DWORD e = GetLastError();
>>
>> - if (e == ERROR_PIPE_NOT_CONNECTED)
>> - {
>> - /* This will happen if the loader fails to succesfully
>> - load the application, e.g., if the main executable
>> - tries to pull in a non-existing export from a
>> - DLL. */
>> - ourstatus->kind = TARGET_WAITKIND_EXITED;
>> - ourstatus->value.integer = 1;
>> - return 1;
>> - }
>> + if (e == ERROR_PIPE_NOT_CONNECTED)
>> + {
>> + /* This will happen if the loader fails to succesfully
>> + load the application, e.g., if the main executable
>> + tries to pull in a non-existing export from a
>> + DLL. */
>> + ourstatus->kind = TARGET_WAITKIND_EXITED;
>> + ourstatus->value.integer = 1;
>> + return 1;
>> + }
>>
>> - return 0;
>> - }
>> - }
>> + return 0;
>> + }
>> + }
>
> I think that's the matching brace, above.
>
> Kevin
>
Thanks for the suggestion. I tried this, but just removing the braces leads to this error:
CXX win32-low.o
cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc: In function ‘int get_child_debug_event(DWORD*, target_waitstatus*)’:
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1449:2: error: jump to label ‘gotevent’
1449 | gotevent:
| ^~~~~~~~
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1414:12: note: from here
1414 | goto gotevent;
| ^~~~~~~~
/home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1418:33: note: crosses initialization of ‘gdb::optional<windows_nat::pending_stop> stop’
1418 | gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
| ^~~~
So it would require other changes. I'd rather keep this patch trivial, just removing the ifdefs,
and keep this other change for another time.
Simon
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/7] gdbserver: remove support for ARM/WinCE
2020-05-14 23:14 ` Simon Marchi
@ 2020-05-15 1:03 ` Kevin Buettner
0 siblings, 0 replies; 21+ messages in thread
From: Kevin Buettner @ 2020-05-15 1:03 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi, Simon Marchi
On Thu, 14 May 2020 19:14:23 -0400
Simon Marchi <simark@simark.ca> wrote:
> On 2020-05-14 4:30 p.m., Kevin Buettner via Gdb-patches wrote:
> > Hi Simon,
> >
> > Just one nit, maybe...
> >
[...]
> >> + {
> >
> > I think this brace and the matching one later on can be removed, with
> > a corresponding reduction in indent level for the enclosed block.
[...]
> >> + }
> >
> > I think that's the matching brace, above.
> >
> > Kevin
> >
>
> Thanks for the suggestion. I tried this, but just removing the braces leads to this error:
>
> CXX win32-low.o
> cc1plus: warning: command line option ‘-Wmissing-prototypes’ is valid for C/ObjC but not for C++
> /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc: In function ‘int get_child_debug_event(DWORD*, target_waitstatus*)’:
> /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1449:2: error: jump to label ‘gotevent’
> 1449 | gotevent:
> | ^~~~~~~~
> /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1414:12: note: from here
> 1414 | goto gotevent;
> | ^~~~~~~~
> /home/smarchi/src/binutils-gdb/gdbserver/win32-low.cc:1418:33: note: crosses initialization of ‘gdb::optional<windows_nat::pending_stop> stop’
> 1418 | gdb::optional<pending_stop> stop = fetch_pending_stop (debug_threads);
> | ^~~~
>
> So it would require other changes. I'd rather keep this patch trivial, just removing the ifdefs,
> and keep this other change for another time.
Agreed.
Kevin
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 7/7] gdbserver: remove support for ARM/WinCE
2020-05-14 19:05 ` [PATCH 7/7] gdbserver: remove support for ARM/WinCE Simon Marchi
2020-05-14 20:30 ` Kevin Buettner
@ 2020-05-15 11:09 ` Pedro Alves
1 sibling, 0 replies; 21+ messages in thread
From: Pedro Alves @ 2020-05-15 11:09 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 5/14/20 8:05 PM, Simon Marchi via Gdb-patches wrote:
> This port has been unmaintained for years, remove it.
Full circle. Sniff... :-)
OK.
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/7] Remove obsolete GDBserver ports
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (7 preceding siblings ...)
2020-05-14 19:05 ` [PATCH 7/7] gdbserver: remove support for ARM/WinCE Simon Marchi
@ 2020-05-14 19:07 ` Christian Biesinger
2020-05-14 19:12 ` Simon Marchi
2020-05-14 19:18 ` [PATCH 8/7] gdb: mention removed GDBserver host support in NEWS Simon Marchi
` (2 subsequent siblings)
11 siblings, 1 reply; 21+ messages in thread
From: Christian Biesinger @ 2020-05-14 19:07 UTC (permalink / raw)
To: Simon Marchi; +Cc: gdb-patches
On Thu, May 14, 2020 at 12:44 PM Simon Marchi via Gdb-patches
<gdb-patches@sourceware.org> wrote:
>
> This series implements the removal of obsolete gdbserver ports, as discussed
> here:
>
> https://sourceware.org/pipermail/gdb-patches/2020-May/168361.html
>
> I'm not in a hurry to merge this. I don't recall the exact process for
> removing support for a platform/architecture from GDB/GDBserver (I could
> document it on the wiki if someone points me to it, if it's not already there).
> If needed, we can announce these ports as deprecated for the next GDB release
> (10.1 ?), and then merge this series in master right after we have created the
> gdb-10-branch. Or if you think this is unnecessary, we can merge it right
> away, I don't mind.
I support removal of Lynx/Neutrino/WinCE, and have no opinion on the
others. However, shouldn't there be a NEWS entry for this?
Also, I didn't notice which patch changed gdbserver/README as per the
diffstat, did I just miss that?
Christian
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/7] Remove obsolete GDBserver ports
2020-05-14 19:07 ` [PATCH 0/7] Remove obsolete GDBserver ports Christian Biesinger
@ 2020-05-14 19:12 ` Simon Marchi
0 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 19:12 UTC (permalink / raw)
To: Christian Biesinger, Simon Marchi; +Cc: gdb-patches
On 2020-05-14 3:07 p.m., Christian Biesinger via Gdb-patches wrote:
> On Thu, May 14, 2020 at 12:44 PM Simon Marchi via Gdb-patches
> <gdb-patches@sourceware.org> wrote:
>>
>> This series implements the removal of obsolete gdbserver ports, as discussed
>> here:
>>
>> https://sourceware.org/pipermail/gdb-patches/2020-May/168361.html
>>
>> I'm not in a hurry to merge this. I don't recall the exact process for
>> removing support for a platform/architecture from GDB/GDBserver (I could
>> document it on the wiki if someone points me to it, if it's not already there).
>> If needed, we can announce these ports as deprecated for the next GDB release
>> (10.1 ?), and then merge this series in master right after we have created the
>> gdb-10-branch. Or if you think this is unnecessary, we can merge it right
>> away, I don't mind.
>
> I support removal of Lynx/Neutrino/WinCE, and have no opinion on the
> others. However, shouldn't there be a NEWS entry for this?
You are right, I'll send a 8/7 patch for that.
> Also, I didn't notice which patch changed gdbserver/README as per the
> diffstat, did I just miss that?
Patches 3, 4, and 5. But that will go away if this other patch goes in first, which
would be preferable.
https://sourceware.org/pipermail/gdb-patches/2020-May/168523.html
Simon
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH 8/7] gdb: mention removed GDBserver host support in NEWS
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (8 preceding siblings ...)
2020-05-14 19:07 ` [PATCH 0/7] Remove obsolete GDBserver ports Christian Biesinger
@ 2020-05-14 19:18 ` Simon Marchi
2020-05-14 19:21 ` Eli Zaretskii
2020-05-15 10:19 ` [PATCH 0/7] Remove obsolete GDBserver ports Pedro Alves
2020-06-12 20:08 ` Simon Marchi
11 siblings, 1 reply; 21+ messages in thread
From: Simon Marchi @ 2020-05-14 19:18 UTC (permalink / raw)
To: gdb-patches; +Cc: Simon Marchi
gdb/ChangeLog:
* NEWS: Mention removed GDBserver host support.
---
gdb/NEWS | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/gdb/NEWS b/gdb/NEWS
index 5b9eabe746c2..248bfdd43954 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -21,6 +21,19 @@
** GDBserver is now supported on RISC-V GNU/Linux.
+ ** GDBserver no longer supports these host triplets:
+
+ i[34567]86-*-lynxos*
+ powerpc-*-lynxos*
+ i[34567]86-*-nto*
+ bfin-*-*linux*
+ crisv32-*-linux*
+ cris-*-linux*
+ m32r*-*-linux*
+ tilegx-*-linux*
+ arm*-*-mingw32ce*
+ i[34567]86-*-mingw32ce*
+
* Debugging MS-Windows processes now sets $_exitsignal when the
inferior is terminated by a signal, instead of setting $_exitcode.
--
2.26.2
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/7] Remove obsolete GDBserver ports
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (9 preceding siblings ...)
2020-05-14 19:18 ` [PATCH 8/7] gdb: mention removed GDBserver host support in NEWS Simon Marchi
@ 2020-05-15 10:19 ` Pedro Alves
2020-05-15 14:18 ` Simon Marchi
2020-06-12 20:08 ` Simon Marchi
11 siblings, 1 reply; 21+ messages in thread
From: Pedro Alves @ 2020-05-15 10:19 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 5/14/20 6:43 PM, Simon Marchi via Gdb-patches wrote:
> This series implements the removal of obsolete gdbserver ports, as discussed
> here:
>
> https://sourceware.org/pipermail/gdb-patches/2020-May/168361.html
>
> I'm not in a hurry to merge this. I don't recall the exact process for
> removing support for a platform/architecture from GDB/GDBserver (I could
> document it on the wiki if someone points me to it, if it's not already there).
It's here:
https://sourceware.org/gdb/wiki/Internals%20Obsoleting-code
(I kind of wish the internals manual hadn't been wikified, since it's
so hard to find stuff there... :-/)
> If needed, we can announce these ports as deprecated for the next GDB release
> (10.1 ?), and then merge this series in master right after we have created the
> gdb-10-branch. Or if you think this is unnecessary, we can merge it right
> away, I don't mind.
>
Thanks,
Pedro Alves
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH 0/7] Remove obsolete GDBserver ports
2020-05-14 17:43 [PATCH 0/7] Remove obsolete GDBserver ports Simon Marchi
` (10 preceding siblings ...)
2020-05-15 10:19 ` [PATCH 0/7] Remove obsolete GDBserver ports Pedro Alves
@ 2020-06-12 20:08 ` Simon Marchi
11 siblings, 0 replies; 21+ messages in thread
From: Simon Marchi @ 2020-06-12 20:08 UTC (permalink / raw)
To: Simon Marchi, gdb-patches
On 2020-05-14 1:43 p.m., Simon Marchi via Gdb-patches wrote:
> This series implements the removal of obsolete gdbserver ports, as discussed
> here:
>
> https://sourceware.org/pipermail/gdb-patches/2020-May/168361.html
>
> I'm not in a hurry to merge this. I don't recall the exact process for
> removing support for a platform/architecture from GDB/GDBserver (I could
> document it on the wiki if someone points me to it, if it's not already there).
> If needed, we can announce these ports as deprecated for the next GDB release
> (10.1 ?), and then merge this series in master right after we have created the
> gdb-10-branch. Or if you think this is unnecessary, we can merge it right
> away, I don't mind.
>
> Simon Marchi (7):
> gdbserver: remove support for LynxOS
> gdbserver: remove support for Neutrino
> gdbserver: remove support for Blackfin
> gdbserver: remove support for CRIS
> gdbserver: remove support for M32R
> gdbserver: remove support for Tile
> gdbserver: remove support for ARM/WinCE
>
> gdbserver/Makefile.in | 7 -
> gdbserver/README | 7 +-
> gdbserver/configure | 4 -
> gdbserver/configure.ac | 4 -
> gdbserver/configure.srv | 63 ---
> gdbserver/linux-bfin-low.cc | 173 ------
> gdbserver/linux-cris-low.cc | 169 ------
> gdbserver/linux-crisv32-low.cc | 472 ----------------
> gdbserver/linux-low.cc | 5 -
> gdbserver/linux-m32r-low.cc | 163 ------
> gdbserver/linux-tile-low.cc | 227 --------
> gdbserver/lynx-i386-low.cc | 358 ------------
> gdbserver/lynx-low.cc | 747 -------------------------
> gdbserver/lynx-low.h | 102 ----
> gdbserver/lynx-ppc-low.cc | 185 -------
> gdbserver/nto-low.cc | 966 ---------------------------------
> gdbserver/nto-low.h | 109 ----
> gdbserver/nto-x86-low.cc | 109 ----
> gdbserver/remote-utils.cc | 33 --
> gdbserver/server.h | 4 -
> gdbserver/win32-arm-low.cc | 168 ------
> gdbserver/win32-low.cc | 101 +---
> gdbserver/win32-low.h | 4 -
> gdbserver/wincecompat.cc | 38 --
> gdbserver/wincecompat.h | 30 -
> 25 files changed, 30 insertions(+), 4218 deletions(-)
> delete mode 100644 gdbserver/linux-bfin-low.cc
> delete mode 100644 gdbserver/linux-cris-low.cc
> delete mode 100644 gdbserver/linux-crisv32-low.cc
> delete mode 100644 gdbserver/linux-m32r-low.cc
> delete mode 100644 gdbserver/linux-tile-low.cc
> delete mode 100644 gdbserver/lynx-i386-low.cc
> delete mode 100644 gdbserver/lynx-low.cc
> delete mode 100644 gdbserver/lynx-low.h
> delete mode 100644 gdbserver/lynx-ppc-low.cc
> delete mode 100644 gdbserver/nto-low.cc
> delete mode 100644 gdbserver/nto-low.h
> delete mode 100644 gdbserver/nto-x86-low.cc
> delete mode 100644 gdbserver/win32-arm-low.cc
> delete mode 100644 gdbserver/wincecompat.cc
> delete mode 100644 gdbserver/wincecompat.h
>
> --
> 2.26.2
>
I pushed this series.
Simon
^ permalink raw reply [flat|nested] 21+ messages in thread