diff options
author | Kevin Buettner <kevinb@redhat.com> | 2000-09-18 01:08:24 +0000 |
---|---|---|
committer | Kevin Buettner <kevinb@redhat.com> | 2000-09-18 01:08:24 +0000 |
commit | fdb28ac40143fc026508662a4df94a2582e6bf99 (patch) | |
tree | f20f8ca483a6e96883b00c0b6f119446dd4beca7 | |
parent | afd64b4e2d76f981f6828f9f55fcc03784d6915b (diff) | |
download | gdb-fdb28ac40143fc026508662a4df94a2582e6bf99.zip gdb-fdb28ac40143fc026508662a4df94a2582e6bf99.tar.gz gdb-fdb28ac40143fc026508662a4df94a2582e6bf99.tar.bz2 |
Enable Mark Kettenis' linux thread support for Linux/PPC.
-rw-r--r-- | gdb/ChangeLog | 15 | ||||
-rw-r--r-- | gdb/config/powerpc/linux.mh | 5 | ||||
-rw-r--r-- | gdb/config/powerpc/nm-linux.h | 30 | ||||
-rw-r--r-- | gdb/ppc-linux-nat.c | 45 |
4 files changed, 75 insertions, 20 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index e9e591c..937a703 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,20 @@ 2000-09-17 Kevin Buettner <kevinb@redhat.com> + * ppc-linux-nat.c (fill_gregset, fill_fpregset): New functions. + * config/powerpc/linux.mh (NATDEPFILES): Remove linux-thread.o. + Add proc-service.o, thread-db.o, and lin-lwp.o. + (LOADLIBES): Define. + * config/powerpc/nm-linux.h (ATTACH_DETACH, SVR4_SHARED_LIBS): + Remove defines which are already present in ../nm-linux.h. + (solib.h): Don't include this file; it's already included by + ../nm-linux.h. + (PREPARE_TO_PROCEED, GET_THREAD_SIGNALS, ATTACH_LWP): Define + to use the following lin-lwp.c functions... + (lin_lwp_prepare_to_proceed, lin_thread_get_thread_signals, + lin_lwp_attach_lwp): Declare. + +2000-09-17 Kevin Buettner <kevinb@redhat.com> + * m88k-nat.c (fetch_inferior_registers): Protoize. * m88k-tdep.c (m88k_skip_prologue): Protoize. diff --git a/gdb/config/powerpc/linux.mh b/gdb/config/powerpc/linux.mh index b074e6a..3bc9961 100644 --- a/gdb/config/powerpc/linux.mh +++ b/gdb/config/powerpc/linux.mh @@ -5,6 +5,9 @@ XDEPFILES= XM_CLIBS= NAT_FILE= nm-linux.h -NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o core-aout.o core-regset.o ppc-linux-nat.o linux-thread.o +NATDEPFILES= infptrace.o solib.o inftarg.o fork-child.o corelow.o \ +core-aout.o core-regset.o ppc-linux-nat.o proc-service.o thread-db.o lin-lwp.o + +LOADLIBES = -ldl -rdynamic GDBSERVER_DEPFILES= low-linux.o diff --git a/gdb/config/powerpc/nm-linux.h b/gdb/config/powerpc/nm-linux.h index 0ef531c..5eac7d3 100644 --- a/gdb/config/powerpc/nm-linux.h +++ b/gdb/config/powerpc/nm-linux.h @@ -28,9 +28,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ #define KERNEL_U_SIZE kernel_u_size() extern int kernel_u_size (void); -/* Tell gdb that we can attach and detach other processes */ -#define ATTACH_DETACH - #define U_REGS_OFFSET 0 #define REGISTER_U_ADDR(addr, blockend, regno) \ @@ -40,25 +37,20 @@ extern int kernel_u_size (void); #define NO_SYS_REG_H -#ifdef HAVE_LINK_H -#include "solib.h" /* Support for shared libraries. */ -#define SVR4_SHARED_LIBS -#endif - -/* Support for Linuxthreads. */ - -#ifdef __STDC__ -struct objfile; -#endif +/* FIXME: kettenis/2000-09-03: This should be moved to ../nm-linux.h + once we have converted all Linux targets to use the new threads + stuff (without the #undef of course). */ -extern void linuxthreads_new_objfile (struct objfile *objfile); -#define target_new_objfile(OBJFILE) linuxthreads_new_objfile (OBJFILE) +extern int lin_lwp_prepare_to_proceed (void); +#undef PREPARE_TO_PROCEED +#define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed () -extern char *linuxthreads_pid_to_str (int pid); -#define target_pid_to_str(PID) linuxthreads_pid_to_str (PID) +extern void lin_lwp_attach_lwp (int pid, int verbose); +#define ATTACH_LWP(pid, verbose) lin_lwp_attach_lwp ((pid), (verbose)) -extern int linuxthreads_prepare_to_proceed (int step); -#define PREPARE_TO_PROCEED(select_it) linuxthreads_prepare_to_proceed (1) +#include <signal.h> +extern void lin_thread_get_thread_signals (sigset_t *mask); +#define GET_THREAD_SIGNALS(mask) lin_thread_get_thread_signals (mask) #endif /* #ifndef NM_LINUX_H */ diff --git a/gdb/ppc-linux-nat.c b/gdb/ppc-linux-nat.c index e37aef9..7388254 100644 --- a/gdb/ppc-linux-nat.c +++ b/gdb/ppc-linux-nat.c @@ -71,6 +71,28 @@ supply_gregset (gregset_t * gregsetp) } void +fill_gregset (gregset_t *gregsetp, int regno) +{ + int regi; + greg_t *regp = (greg_t *) gregsetp; + +#define COPY_REG(_idx_,_regi_) \ + if ((regno == -1) || regno == _regi_) \ + memcpy (regp + _idx_, ®isters[REGISTER_BYTE (_regi_)], \ + REGISTER_RAW_SIZE (_regi_)) + + for (regi = 0; regi < 32; regi++) + { + COPY_REG (regmap[regi], regi); + } + + for (regi = FIRST_UISA_SP_REGNUM; regi <= LAST_UISA_SP_REGNUM; regi++) + { + COPY_REG (regmap[regi], regi); + } +} + +void supply_fpregset (fpregset_t * fpregsetp) { int regi; @@ -79,3 +101,26 @@ supply_fpregset (fpregset_t * fpregsetp) supply_register (FP0_REGNUM + regi, (char *) (*fpregsetp + regi)); } } + +/* Given a pointer to a floating point register set in /proc format + (fpregset_t *), update the register specified by REGNO from gdb's idea + of the current floating point register set. If REGNO is -1, update + them all. */ + +void +fill_fpregset (fpregset_t *fpregsetp, int regno) +{ + int regi; + char *to; + char *from; + + for (regi = 0; regi < 32; regi++) + { + if ((regno == -1) || (regno == FP0_REGNUM + regi)) + { + from = (char *) ®isters[REGISTER_BYTE (FP0_REGNUM + regi)]; + to = (char *) (*fpregsetp + regi); + memcpy (to, from, REGISTER_RAW_SIZE (FP0_REGNUM + regi)); + } + } +} |