This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] Fix gdbserver for SH NPTL
- From: Daniel Jacobowitz <drow at false dot org>
- To: gdb-patches at sourceware dot org
- Date: Thu, 12 Jul 2007 15:59:44 -0400
- Subject: [commit] Fix gdbserver for SH NPTL
This simple patch lets gdbserver debug multi-threaded programs on
sh-linux again. Checked in.
--
Daniel Jacobowitz
CodeSourcery
2007-07-12 Daniel Jacobowitz <dan@codesourcery.com>
* configure.srv: Set srv_linux_regsets for sh*-*-linux*.
* linux-sh-low.c (sh_fill_gregset, target_regsets): New.
Index: gdb-6.3/gdb/gdbserver/configure.srv
===================================================================
--- gdb-6.3.orig/gdb/gdbserver/configure.srv 2007-07-12 11:28:48.000000000 -0700
+++ gdb-6.3/gdb/gdbserver/configure.srv 2007-07-12 12:33:17.000000000 -0700
@@ -84,6 +84,7 @@ case "${target}" in
sh*-*-linux*) srv_regobj=reg-sh.o
srv_tgtobj="linux-low.o linux-sh-low.o"
srv_linux_usrregs=yes
+ srv_linux_regsets=yes
srv_linux_thread_db=yes
;;
x86_64-*-linux*) srv_regobj=reg-x86-64.o
Index: gdb-6.3/gdb/gdbserver/linux-sh-low.c
===================================================================
--- gdb-6.3.orig/gdb/gdbserver/linux-sh-low.c 2003-06-28 11:41:56.000000000 -0700
+++ gdb-6.3/gdb/gdbserver/linux-sh-low.c 2007-07-12 12:32:21.000000000 -0700
@@ -90,6 +90,23 @@ sh_breakpoint_at (CORE_ADDR where)
return 0;
}
+/* Provide only a fill function for the general register set. ps_lgetregs
+ will use this for NPTL support. */
+
+static void sh_fill_gregset (void *buf)
+{
+ int i;
+
+ for (i = 0; i < 23; i++)
+ if (sh_regmap[i] != -1)
+ collect_register (i, (char *) buf + sh_regmap[i]);
+}
+
+struct regset_info target_regsets[] = {
+ { 0, 0, 0, GENERAL_REGS, sh_fill_gregset, NULL },
+ { 0, 0, -1, -1, NULL, NULL }
+};
+
struct linux_target_ops the_low_target = {
sh_num_regs,
sh_regmap,