Module Name:    src
Committed By:   skrll
Date:           Fri Nov 18 09:52:33 UTC 2016

Modified Files:
        src/external/gpl3/gdb/dist/gdb: alphanbsd-tdep.c armnbsd-tdep.c
            configure.tgt nbsd-tdep.c nbsd-tdep.h

Log Message:
Provide a generic nbsd_skip_solib_resolver and use it in alpha and arm.
Others should follow suit.

I even tested it.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c
cvs rdiff -u -r1.7 -r1.8 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
cvs rdiff -u -r1.13 -r1.14 src/external/gpl3/gdb/dist/gdb/configure.tgt
cvs rdiff -u -r1.1.1.6 -r1.2 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c
cvs rdiff -u -r1.1.1.5 -r1.2 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.12 src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.13
--- src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c:1.12	Sat Oct 29 17:02:06 2016
+++ src/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c	Fri Nov 18 09:52:33 2016
@@ -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: src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.7 src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.8
--- src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c:1.7	Sun Oct 23 07:40:08 2016
+++ src/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c	Fri Nov 18 09:52:33 2016
@@ -19,10 +19,10 @@
 
 #include "defs.h"
 #include "osabi.h"
-#include "objfiles.h"
 
 #include "arch/arm.h"
 #include "arm-tdep.h"
+#include "nbsd-tdep.h"
 #include "solib-svr4.h"
 
 /* Description of the longjmp buffer.  */
@@ -36,19 +36,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 +101,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: src/external/gpl3/gdb/dist/gdb/configure.tgt
diff -u src/external/gpl3/gdb/dist/gdb/configure.tgt:1.13 src/external/gpl3/gdb/dist/gdb/configure.tgt:1.14
--- src/external/gpl3/gdb/dist/gdb/configure.tgt:1.13	Sun Oct 23 07:33:15 2016
+++ src/external/gpl3/gdb/dist/gdb/configure.tgt	Fri Nov 18 09:52:33 2016
@@ -109,7 +109,7 @@ arm*-*-linux*)
 arm*-*-netbsd* | arm*-*-knetbsd*-gnu)
 	# Target: NetBSD/arm
 	gdb_target_obs="arm.o arm-get-next-pcs.o arm-tdep.o armbsd-tdep.o \
-			armnbsd-tdep.o solib-svr4.o"
+			armnbsd-tdep.o nbsd-tdep.o solib-svr4.o"
 	;;
 arm*-*-openbsd*)
 	# Target: OpenBSD/arm

Index: src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.1.1.6 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.2
--- src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c:1.1.1.6	Wed Oct 12 16:47:14 2016
+++ src/external/gpl3/gdb/dist/gdb/nbsd-tdep.c	Fri Nov 18 09:52:33 2016
@@ -3,9 +3,9 @@
    Copyright (C) 2002-2016 Free Software Foundation, Inc.
 
    Contributed by Wasabi Systems, Inc.
-  
+
    This file is part of GDB.
-  
+
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
@@ -20,6 +20,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
+#include "objfiles.h"
 #include "solib-svr4.h"
 #include "nbsd-tdep.h"
 
@@ -47,3 +48,16 @@ nbsd_pc_in_sigtramp (CORE_ADDR pc, const
   return (func_name != NULL
 	  && startswith (func_name, "__sigtramp"));
 }
+
+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: src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h
diff -u src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h:1.1.1.5 src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h:1.2
--- src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h:1.1.1.5	Wed Oct 12 16:47:12 2016
+++ src/external/gpl3/gdb/dist/gdb/nbsd-tdep.h	Fri Nov 18 09:52:33 2016
@@ -25,4 +25,6 @@ struct link_map_offsets *nbsd_lp64_solib
 
 int nbsd_pc_in_sigtramp (CORE_ADDR, const char *);
 
+CORE_ADDR nbsd_skip_solib_resolver (struct gdbarch *gdbarch,
+				    CORE_ADDR pc);
 #endif /* NBSD_TDEP_H */

Reply via email to