tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: GDB single-step fails on alpha (Re: CVS commit: src/share/mk)



On 10/28/16 09:14, Rin Okuyama wrote:
{alpha,arm}nbsd_skip_solib_resolver()
should be merged and moved into nbsd-tdep.c.

I started on this before the alpha commit.

Here's a patch to make arm/alpha use a generic nbsd_skip_solib_resolver.

Nick
Index: external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c
===================================================================
RCS file: /cvsroot/src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c,v
retrieving revision 1.12
diff -u -p -w -b -r1.12 alphanbsd-tdep.c
--- external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c	29 Oct 2016 17:02:06 -0000	1.12
+++ external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c	31 Oct 2016 11:36:19 -0000
@@ -22,7 +22,6 @@
 #include "defs.h"
 #include "frame.h"
 #include "gdbcore.h"
-#include "objfiles.h"
 #include "osabi.h"
 #include "regcache.h"
 #include "regset.h"
@@ -37,19 +36,6 @@
 #include "tramp-frame.h"
 #include "target.h"
 
-/* from obsd-tdep.c with symbol name adjusted to ours */
-static CORE_ADDR
-alphanbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
-{
-  struct bound_minimal_symbol msym;
-
-  msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
-  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
-    return frame_unwind_caller_pc (get_current_frame ());
-  else
-    return find_solib_trampoline_target (get_current_frame (), pc);
-}
-
 /* Core file support.  */
 
 /* Even though NetBSD/alpha used ELF since day one, it used the
@@ -347,7 +333,7 @@ alphanbsd_init_abi (struct gdbarch_info 
   /* NetBSD/alpha has SVR4-style shared libraries.  */
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_lp64_fetch_link_map_offsets);
-  set_gdbarch_skip_solib_resolver (gdbarch, alphanbsd_skip_solib_resolver);
+  set_gdbarch_skip_solib_resolver (gdbarch, nbsd_skip_solib_resolver);
 
 #ifdef notyet
   tdep->dynamic_sigtramp_offset = alphanbsd_sigtramp_offset;
Index: external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
===================================================================
RCS file: /cvsroot/src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c,v
retrieving revision 1.7
diff -u -p -w -b -r1.7 armnbsd-tdep.c
--- external/gpl3/gdb/dist/gdb/armnbsd-tdep.c	23 Oct 2016 07:40:08 -0000	1.7
+++ external/gpl3/gdb/dist/gdb/armnbsd-tdep.c	31 Oct 2016 11:36:20 -0000
@@ -19,7 +19,6 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "objfiles.h"
 
 #include "arch/arm.h"
 #include "arm-tdep.h"
@@ -36,19 +35,6 @@ static const gdb_byte arm_nbsd_arm_be_br
 static const gdb_byte arm_nbsd_thumb_le_breakpoint[] = {0xfe, 0xde};
 static const gdb_byte arm_nbsd_thumb_be_breakpoint[] = {0xde, 0xfe};
 
-/* from obsd-tdep.c with symbol name adjusted to ours */
-static CORE_ADDR
-armnbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
-{
-  struct bound_minimal_symbol msym;
-
-  msym = lookup_minimal_symbol("_rtld_bind", NULL, NULL);
-  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
-    return frame_unwind_caller_pc (get_current_frame ());
-  else
-    return find_solib_trampoline_target (get_current_frame (), pc);
-}
-
 static void
 arm_netbsd_init_abi_common (struct gdbarch_info info,
 			    struct gdbarch *gdbarch)
@@ -114,7 +100,7 @@ arm_netbsd_elf_init_abi (struct gdbarch_
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 
   /* for single stepping; see PR/50773 */
-  set_gdbarch_skip_solib_resolver (gdbarch, armnbsd_skip_solib_resolver);
+  set_gdbarch_skip_solib_resolver (gdbarch, nbsd_skip_solib_resolver);
 }
 
 static enum gdb_osabi
Index: external/gpl3/gdb/dist/gdb/nbsd-tdep.c
===================================================================
RCS file: /cvsroot/src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c,v
retrieving revision 1.1.1.6
diff -u -p -w -b -r1.1.1.6 nbsd-tdep.c
--- external/gpl3/gdb/dist/gdb/nbsd-tdep.c	12 Oct 2016 16:47:14 -0000	1.1.1.6
+++ external/gpl3/gdb/dist/gdb/nbsd-tdep.c	31 Oct 2016 11:36:20 -0000
@@ -47,3 +47,16 @@ nbsd_pc_in_sigtramp (CORE_ADDR pc, const
   return (func_name != NULL
 	  && startswith (func_name, "__sigtramp"));
 }
+
+static CORE_ADDR
+nbsd_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+  struct bound_minimal_symbol msym;
+
+  msym = lookup_minimal_symbol("_rtld_bind_start", NULL, NULL);
+  if (msym.minsym && BMSYMBOL_VALUE_ADDRESS (msym) == pc)
+    return frame_unwind_caller_pc (get_current_frame ());
+  else
+    return find_solib_trampoline_target (get_current_frame (), pc);
+}
+
Index: external/gpl3/gdb/dist/gdb/nbsd-tdep.h
===================================================================
RCS file: /cvsroot/src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h,v
retrieving revision 1.1.1.5
diff -u -p -w -b -r1.1.1.5 nbsd-tdep.h
--- external/gpl3/gdb/dist/gdb/nbsd-tdep.h	12 Oct 2016 16:47:12 -0000	1.1.1.5
+++ external/gpl3/gdb/dist/gdb/nbsd-tdep.h	31 Oct 2016 11:36:20 -0000
@@ -25,4 +25,6 @@ struct link_map_offsets *nbsd_lp64_solib
 
 int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
 
+static CORE_ADDR nbsd_skip_solib_resolver (struct gdbarch *gdbarch,
+					   CORE_ADDR pc);
 #endif /* NBSD_TDEP_H */


Home | Main Index | Thread Index | Old Index