aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@gnu.org>2003-11-09 12:07:16 +0000
committerMark Kettenis <kettenis@gnu.org>2003-11-09 12:07:16 +0000
commitdea0c52f825dd14c6608c86e38a948d22115cd38 (patch)
treefa706dfaad281b4c3502f178f63796150df83ae7 /gdb
parent292da8136c57a208bf9bde712a3952198994edd3 (diff)
downloadgdb-dea0c52f825dd14c6608c86e38a948d22115cd38.zip
gdb-dea0c52f825dd14c6608c86e38a948d22115cd38.tar.gz
gdb-dea0c52f825dd14c6608c86e38a948d22115cd38.tar.bz2
From David S. Miller <davem@redhat.com>:
* gdbarch.sh (SKIP_SOLIB_RESOLVER): New method. * gdbarch.c, gdbarch.h: Regenerated. * arch-utils.c (generic_skip_solib_resolver): New function. * arch-utils.h (generic_skip_solib_resolver): New prototype. * infrun.c (SKIP_SOLIB_RESOLVER): Don't define.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog9
-rw-r--r--gdb/arch-utils.c6
-rw-r--r--gdb/arch-utils.h2
-rw-r--r--gdb/gdbarch.c31
-rw-r--r--gdb/gdbarch.h14
-rwxr-xr-xgdb/gdbarch.sh4
-rw-r--r--gdb/infrun.c4
7 files changed, 66 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index d636126..b40dee9 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2003-11-09 Mark Kettenis <kettenis@gnu.org>
+
+ From David S. Miller <davem@redhat.com>:
+ * gdbarch.sh (SKIP_SOLIB_RESOLVER): New method.
+ * gdbarch.c, gdbarch.h: Regenerated.
+ * arch-utils.c (generic_skip_solib_resolver): New function.
+ * arch-utils.h (generic_skip_solib_resolver): New prototype.
+ * infrun.c (SKIP_SOLIB_RESOLVER): Don't define.
+
2003-11-07 Andrew Cagney <cagney@redhat.com>
* top.c (print_gdb_version): Replace STREQ with strcmp.
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index 21c5682..2c564e7 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -100,6 +100,12 @@ generic_skip_trampoline_code (CORE_ADDR pc)
return 0;
}
+CORE_ADDR
+generic_skip_solib_resolver (CORE_ADDR pc)
+{
+ return 0;
+}
+
int
generic_in_solib_call_trampoline (CORE_ADDR pc, char *name)
{
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index 27df54d..a180fda 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -110,6 +110,8 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer;
extern CORE_ADDR generic_skip_trampoline_code (CORE_ADDR pc);
+extern CORE_ADDR generic_skip_solib_resolver (CORE_ADDR pc);
+
extern int generic_in_solib_call_trampoline (CORE_ADDR pc, char *name);
extern int generic_in_solib_return_trampoline (CORE_ADDR pc, char *name);
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index 8198bb0..75652a8 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -252,6 +252,7 @@ struct gdbarch
gdbarch_software_single_step_ftype *software_single_step;
gdbarch_print_insn_ftype *print_insn;
gdbarch_skip_trampoline_code_ftype *skip_trampoline_code;
+ gdbarch_skip_solib_resolver_ftype *skip_solib_resolver;
gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
gdbarch_in_solib_return_trampoline_ftype *in_solib_return_trampoline;
gdbarch_pc_in_sigtramp_ftype *pc_in_sigtramp;
@@ -424,6 +425,7 @@ struct gdbarch startup_gdbarch =
0, /* software_single_step */
0, /* print_insn */
0, /* skip_trampoline_code */
+ 0, /* skip_solib_resolver */
0, /* in_solib_call_trampoline */
0, /* in_solib_return_trampoline */
0, /* pc_in_sigtramp */
@@ -553,6 +555,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->addr_bits_remove = core_addr_identity;
current_gdbarch->smash_text_address = core_addr_identity;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
+ current_gdbarch->skip_solib_resolver = generic_skip_solib_resolver;
current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
current_gdbarch->in_solib_return_trampoline = generic_in_solib_return_trampoline;
current_gdbarch->pc_in_sigtramp = legacy_pc_in_sigtramp;
@@ -756,6 +759,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
&& (gdbarch->print_insn == 0))
fprintf_unfiltered (log, "\n\tprint_insn");
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
+ /* Skip verify of skip_solib_resolver, invalid_p == 0 */
/* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
/* Skip verify of in_solib_return_trampoline, invalid_p == 0 */
/* Skip verify of pc_in_sigtramp, invalid_p == 0 */
@@ -2225,6 +2229,16 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->skip_prologue
/*SKIP_PROLOGUE ()*/);
#endif
+#ifdef SKIP_SOLIB_RESOLVER
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "SKIP_SOLIB_RESOLVER(pc)",
+ XSTRING (SKIP_SOLIB_RESOLVER (pc)));
+ fprintf_unfiltered (file,
+ "gdbarch_dump: SKIP_SOLIB_RESOLVER = <0x%08lx>\n",
+ (long) current_gdbarch->skip_solib_resolver
+ /*SKIP_SOLIB_RESOLVER ()*/);
+#endif
#ifdef SKIP_TRAMPOLINE_CODE
fprintf_unfiltered (file,
"gdbarch_dump: %s # %s\n",
@@ -5211,6 +5225,23 @@ set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
gdbarch->skip_trampoline_code = skip_trampoline_code;
}
+CORE_ADDR
+gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc)
+{
+ gdb_assert (gdbarch != NULL);
+ gdb_assert (gdbarch->skip_solib_resolver != NULL);
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_solib_resolver called\n");
+ return gdbarch->skip_solib_resolver (pc);
+}
+
+void
+set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch,
+ gdbarch_skip_solib_resolver_ftype skip_solib_resolver)
+{
+ gdbarch->skip_solib_resolver = skip_solib_resolver;
+}
+
int
gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
{
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 36e0e7a..021ab36 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -2134,6 +2134,20 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s
#define SKIP_TRAMPOLINE_CODE(pc) (gdbarch_skip_trampoline_code (current_gdbarch, pc))
#endif
+/* If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER
+ evaluates non-zero, this is the address where the debugger will place
+ a step-resume breakpoint to get us past the dynamic linker. */
+
+typedef CORE_ADDR (gdbarch_skip_solib_resolver_ftype) (CORE_ADDR pc);
+extern CORE_ADDR gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, CORE_ADDR pc);
+extern void set_gdbarch_skip_solib_resolver (struct gdbarch *gdbarch, gdbarch_skip_solib_resolver_ftype *skip_solib_resolver);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (SKIP_SOLIB_RESOLVER)
+#error "Non multi-arch definition of SKIP_SOLIB_RESOLVER"
+#endif
+#if !defined (SKIP_SOLIB_RESOLVER)
+#define SKIP_SOLIB_RESOLVER(pc) (gdbarch_skip_solib_resolver (current_gdbarch, pc))
+#endif
+
/* For SVR4 shared libraries, each call goes through a small piece of
trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
to nonzero if we are currently stopped in one of these. */
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index d11e2fa..c1c39f6 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -700,6 +700,10 @@ f::TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, struct disassemble_info *info:v
f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::0
+# If IN_SOLIB_DYNSYM_RESOLVE_CODE returns true, and SKIP_SOLIB_RESOLVER
+# evaluates non-zero, this is the address where the debugger will place
+# a step-resume breakpoint to get us past the dynamic linker.
+f:2:SKIP_SOLIB_RESOLVER:CORE_ADDR:skip_solib_resolver:CORE_ADDR pc:pc:::generic_skip_solib_resolver::0
# For SVR4 shared libraries, each call goes through a small piece of
# trampoline code in the ".plt" section. IN_SOLIB_CALL_TRAMPOLINE evaluates
# to nonzero if we are currently stopped in one of these.
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 3a8e121..6bc22a6 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -153,10 +153,6 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
#define IN_SOLIB_DYNSYM_RESOLVE_CODE(pc) 0
#endif
-#ifndef SKIP_SOLIB_RESOLVER
-#define SKIP_SOLIB_RESOLVER(pc) 0
-#endif
-
/* This function returns TRUE if pc is the address of an instruction
that lies within the dynamic linker (such as the event hook, or the
dld itself).