Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/gpl3 PR/50773: Rin Okuyama: Fix single stepping on ...
details: https://anonhg.NetBSD.org/src/rev/840496ffdddd
branches: trunk
changeset: 815809:840496ffdddd
user: christos <christos%NetBSD.org@localhost>
date: Sat Jun 04 16:14:29 2016 +0000
description:
PR/50773: Rin Okuyama: Fix single stepping on dynamically linked binaries
by skipping dynamic linker calls (from OpenBSD)
diffstat:
external/gpl3/gdb.old/dist/gdb/armnbsd-tdep.c | 17 +++++++++++++++++
external/gpl3/gdb/dist/gdb/armnbsd-tdep.c | 17 +++++++++++++++++
2 files changed, 34 insertions(+), 0 deletions(-)
diffs (82 lines):
diff -r b66ae5034f0c -r 840496ffdddd external/gpl3/gdb.old/dist/gdb/armnbsd-tdep.c
--- a/external/gpl3/gdb.old/dist/gdb/armnbsd-tdep.c Sat Jun 04 16:11:50 2016 +0000
+++ b/external/gpl3/gdb.old/dist/gdb/armnbsd-tdep.c Sat Jun 04 16:14:29 2016 +0000
@@ -19,6 +19,7 @@
#include "defs.h"
#include "osabi.h"
+#include "objfiles.h"
#include "arm-tdep.h"
#include "solib-svr4.h"
@@ -34,6 +35,19 @@
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)
@@ -93,6 +107,9 @@
/* NetBSD ELF uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+ /* for single stepping */
+ set_gdbarch_skip_solib_resolver (gdbarch, armnbsd_skip_solib_resolver);
}
static enum gdb_osabi
diff -r b66ae5034f0c -r 840496ffdddd external/gpl3/gdb/dist/gdb/armnbsd-tdep.c
--- a/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c Sat Jun 04 16:11:50 2016 +0000
+++ b/external/gpl3/gdb/dist/gdb/armnbsd-tdep.c Sat Jun 04 16:14:29 2016 +0000
@@ -19,6 +19,7 @@
#include "defs.h"
#include "osabi.h"
+#include "objfiles.h"
#include "arm-tdep.h"
#include "solib-svr4.h"
@@ -34,6 +35,19 @@
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)
@@ -93,6 +107,9 @@
/* NetBSD ELF uses SVR4-style shared libraries. */
set_solib_svr4_fetch_link_map_offsets
(gdbarch, svr4_ilp32_fetch_link_map_offsets);
+
+ /* for single stepping; see PR/50773 */
+ set_gdbarch_skip_solib_resolver (gdbarch, armnbsd_skip_solib_resolver);
}
static enum gdb_osabi
Home |
Main Index |
Thread Index |
Old Index