Source-Changes-HG archive

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

[src/trunk]: src/external/gpl3/gdb/dist/gdb Provide a generic nbsd_skip_solib...



details:   https://anonhg.NetBSD.org/src/rev/fac3dd15faf0
branches:  trunk
changeset: 348969:fac3dd15faf0
user:      skrll <skrll%NetBSD.org@localhost>
date:      Fri Nov 18 09:52:33 2016 +0000

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

I even tested it.

diffstat:

 external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c |  16 +---------------
 external/gpl3/gdb/dist/gdb/armnbsd-tdep.c   |  17 ++---------------
 external/gpl3/gdb/dist/gdb/configure.tgt    |   2 +-
 external/gpl3/gdb/dist/gdb/nbsd-tdep.c      |  18 ++++++++++++++++--
 external/gpl3/gdb/dist/gdb/nbsd-tdep.h      |   2 ++
 5 files changed, 22 insertions(+), 33 deletions(-)

diffs (146 lines):

diff -r fb1fe3a01c6f -r fac3dd15faf0 external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c       Fri Nov 18 09:06:35 2016 +0000
+++ b/external/gpl3/gdb/dist/gdb/alphanbsd-tdep.c       Fri Nov 18 09:52:33 2016 +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 @@
   /* 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;
diff -r fb1fe3a01c6f -r fac3dd15faf0 external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c Fri Nov 18 09:06:35 2016 +0000
+++ b/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c Fri Nov 18 09:52:33 2016 +0000
@@ -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_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 @@
     (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
diff -r fb1fe3a01c6f -r fac3dd15faf0 external/gpl3/gdb/dist/gdb/configure.tgt
--- a/external/gpl3/gdb/dist/gdb/configure.tgt  Fri Nov 18 09:06:35 2016 +0000
+++ b/external/gpl3/gdb/dist/gdb/configure.tgt  Fri Nov 18 09:52:33 2016 +0000
@@ -109,7 +109,7 @@
 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
diff -r fb1fe3a01c6f -r fac3dd15faf0 external/gpl3/gdb/dist/gdb/nbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/nbsd-tdep.c    Fri Nov 18 09:06:35 2016 +0000
+++ b/external/gpl3/gdb/dist/gdb/nbsd-tdep.c    Fri Nov 18 09:52:33 2016 +0000
@@ -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 @@
   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);
+}
+
diff -r fb1fe3a01c6f -r fac3dd15faf0 external/gpl3/gdb/dist/gdb/nbsd-tdep.h
--- a/external/gpl3/gdb/dist/gdb/nbsd-tdep.h    Fri Nov 18 09:06:35 2016 +0000
+++ b/external/gpl3/gdb/dist/gdb/nbsd-tdep.h    Fri Nov 18 09:52:33 2016 +0000
@@ -25,4 +25,6 @@
 
 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 */



Home | Main Index | Thread Index | Old Index