This is the mail archive of the gdb-patches@sourceware.org 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]
Other format: [Raw text]

[commit] s390: enable thread-db for gdbserver


Hello,

while testing the new_objfile hook change I noticed that the s390{x}
targets don't support debugging multi-threaded processes via gdbserver,
since thread-db isn't enabled.  Fixed by the following patch.

Tested on s390-ibm-linux and s390x-ibm-linux,
committed to mainline.

Bye,
Ulrich


ChangeLog:

	* configure.srv [s390-*-linux*, s390x-*-linux*]: Set srv_linux_regsets
	and srv_linux_thread_db to yes.
	* linux-s390-low.c (s390_fill_gregset): New function.
	(target_regsets): Define data structure.

Index: gdb/gdbserver/configure.srv
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/configure.srv,v
retrieving revision 1.16
diff -u -p -r1.16 configure.srv
--- gdb/gdbserver/configure.srv	19 Aug 2006 15:15:18 -0000	1.16
+++ gdb/gdbserver/configure.srv	20 Oct 2006 00:31:39 -0000
@@ -87,10 +87,14 @@ case "${target}" in
   s390-*-linux*)	srv_regobj=reg-s390.o
 			srv_tgtobj="linux-low.o linux-s390-low.o"
 			srv_linux_usrregs=yes
+			srv_linux_regsets=yes
+			srv_linux_thread_db=yes
 			;;
   s390x-*-linux*)	srv_regobj=reg-s390x.o
 			srv_tgtobj="linux-low.o linux-s390-low.o"
 			srv_linux_usrregs=yes
+			srv_linux_regsets=yes
+			srv_linux_thread_db=yes
 			;;
   sh*-*-linux*)		srv_regobj=reg-sh.o
 			srv_tgtobj="linux-low.o linux-sh-low.o"
Index: gdb/gdbserver/linux-s390-low.c
===================================================================
RCS file: /cvs/src/src/gdb/gdbserver/linux-s390-low.c,v
retrieving revision 1.7
diff -u -p -r1.7 linux-s390-low.c
--- gdb/gdbserver/linux-s390-low.c	23 Dec 2005 18:11:55 -0000	1.7
+++ gdb/gdbserver/linux-s390-low.c	20 Oct 2006 00:31:40 -0000
@@ -1,6 +1,6 @@
 /* GNU/Linux S/390 specific low level interface, for the remote server
    for GDB.
-   Copyright (C) 2001, 2002, 2005
+   Copyright (C) 2001, 2002, 2005, 2006
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -75,6 +75,22 @@ s390_cannot_store_register (int regno)
   return 0;
 }
 
+/* Provide only a fill function for the general register set.  ps_lgetregs
+   will use this for NPTL support.  */
+
+static void s390_fill_gregset (void *buf)
+{
+  int i;
+
+  for (i = 0; i < 34; i++)
+    collect_register (i, (char *) buf + s390_regmap[i]);
+}
+
+struct regset_info target_regsets[] = {
+  { 0, 0, 0, GENERAL_REGS, s390_fill_gregset, NULL },
+  { 0, 0, -1, -1, NULL, NULL }
+};
+
 
 static const unsigned char s390_breakpoint[] = { 0, 1 };
 #define s390_breakpoint_len 2
-- 
  Dr. Ulrich Weigand
  Linux on zSeries Development
  Ulrich.Weigand@de.ibm.com


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