This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

[PATCH] Enable new thread support for Linux/IA-64


I recently discovered that I could no longer build GDB on Linux/IA-64.
It turns out that some recent changes to the rest of GDB has caused a
some bitrot in lin-thread.c.  I don't think it's worth fixing lin-thread.c
since we want to migrate all Linux native ports of GDB to the new
thread facilities that Mark Kettenis introduced last year.

The following patch migrates the Linux/IA-64 native port of GDB
to use Mark's new thread support.  In addition, it makes a stab at
getting the framelessness notion right for IA-64.  (I put this in
recently while investigating another problem.)

Maintainers of other Linux native GDB ports which do not already
use the new thread support will have to make similar adjustments
for their ports.  (It's either that or fix the bitrot in lin-thread.c
and possibly linux-thread.c.)

	* ia64-tdep.c (ia64_frameless_function_invocation): Implement.
	* config/ia64/linux.mh (NATDEPFILES): Use thread-db.o and lin-lwp.o
	for thread support instead of linux-thread.o and lin-thread.o.
	* config/ia64/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.

Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.12
diff -u -p -r1.12 ia64-tdep.c
--- ia64-tdep.c	2001/02/08 06:03:53	1.12
+++ ia64-tdep.c	2001/02/21 05:10:55
@@ -1341,8 +1341,8 @@ ia64_store_struct_return (CORE_ADDR addr
 int
 ia64_frameless_function_invocation (struct frame_info *frame)
 {
-  /* FIXME: Implement */
-  return 0;
+  FRAME_INIT_SAVED_REGS (frame);
+  return (frame->extra_info->mem_stack_frame_size == 0);
 }
 
 CORE_ADDR
Index: config/ia64/linux.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/ia64/linux.mh,v
retrieving revision 1.5
diff -u -p -r1.5 linux.mh
--- linux.mh	2000/10/30 22:33:32	1.5
+++ linux.mh	2001/02/21 05:10:59
@@ -5,7 +5,7 @@ XDEPFILES=
 
 NAT_FILE= nm-linux.h
 NATDEPFILES= infptrace.o inftarg.o fork-child.o corelow.o \
-	core-aout.o core-regset.o ia64-linux-nat.o linux-thread.o lin-thread.o
+	core-aout.o core-regset.o ia64-linux-nat.o thread-db.o lin-lwp.o
 
 LOADLIBES = -ldl -rdynamic
 
Index: config/ia64/nm-linux.h
===================================================================
RCS file: /cvs/src/src/gdb/config/ia64/nm-linux.h,v
retrieving revision 1.4
diff -u -p -r1.4 nm-linux.h
--- nm-linux.h	2000/06/09 18:21:59	1.4
+++ nm-linux.h	2001/02/21 05:10:59
@@ -75,4 +75,20 @@ extern int ia64_linux_insert_watchpoint 
   ia64_linux_remove_watchpoint (inferior_pid, addr, len)
 extern int ia64_linux_remove_watchpoint (int pid, CORE_ADDR addr, int len);
 
+/* 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 int lin_lwp_prepare_to_proceed (void);
+#undef PREPARE_TO_PROCEED
+#define PREPARE_TO_PROCEED(select_it) lin_lwp_prepare_to_proceed ()
+
+extern void lin_lwp_attach_lwp (int pid, int verbose);
+#define ATTACH_LWP(pid, verbose) lin_lwp_attach_lwp ((pid), (verbose))
+
+#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 */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]