aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2001-10-31 23:21:33 +0000
committerCorinna Vinschen <corinna@vinschen.de>2001-10-31 23:21:33 +0000
commit68e9cc944cbd49fd6a7108caee8f77b924c2c40b (patch)
tree85c7ada45075581451798f3cf38756237579ce58 /gdb
parent0a299a95a8b2a3a22c8db54f4df4e89ea3e168ef (diff)
downloadfsf-binutils-gdb-68e9cc944cbd49fd6a7108caee8f77b924c2c40b.zip
fsf-binutils-gdb-68e9cc944cbd49fd6a7108caee8f77b924c2c40b.tar.gz
fsf-binutils-gdb-68e9cc944cbd49fd6a7108caee8f77b924c2c40b.tar.bz2
* arch-utils.c (generic_in_solib_call_trampoline): New function.
* arch-utils.h (generic_in_solib_call_trampoline): Extern declaration. * gdbarch.c: Regenerated from gdbarch.sh. * gdbarch.h: Ditto. * gdbarch.sh (function_list): Add `IN_SOLIB_CALL_TRAMPOLINE' definition. * infrun.c (IN_SOLIB_CALL_TRAMPOLINE): Remove macro.
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.c33
-rw-r--r--gdb/gdbarch.h21
-rwxr-xr-xgdb/gdbarch.sh4
-rw-r--r--gdb/infrun.c8
7 files changed, 75 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index ac6b968..fc2044d 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,12 @@
+2001-10-31 Corinna Vinschen <vinschen@redhat.com>
+
+ * arch-utils.c (generic_in_solib_call_trampoline): New function.
+ * arch-utils.h (generic_in_solib_call_trampoline): Extern declaration.
+ * gdbarch.c: Regenerated from gdbarch.sh.
+ * gdbarch.h: Ditto.
+ * gdbarch.sh (function_list): Add `IN_SOLIB_CALL_TRAMPOLINE' definition.
+ * infrun.c (IN_SOLIB_CALL_TRAMPOLINE): Remove macro.
+
2001-10-31 Andrew Cagney <ac131313@redhat.com>
From DJ Barrow.
diff --git a/gdb/arch-utils.c b/gdb/arch-utils.c
index f395c3e..19e35ff 100644
--- a/gdb/arch-utils.c
+++ b/gdb/arch-utils.c
@@ -105,6 +105,12 @@ generic_skip_trampoline_code (CORE_ADDR pc)
return 0;
}
+int
+generic_in_solib_call_trampoline (CORE_ADDR pc, char *name)
+{
+ return 0;
+}
+
char *
legacy_register_name (int i)
{
diff --git a/gdb/arch-utils.h b/gdb/arch-utils.h
index f2d9b8c..92fee9c 100644
--- a/gdb/arch-utils.h
+++ b/gdb/arch-utils.h
@@ -132,4 +132,6 @@ extern gdbarch_virtual_frame_pointer_ftype legacy_virtual_frame_pointer;
extern CORE_ADDR generic_skip_trampoline_code (CORE_ADDR pc);
+extern int generic_in_solib_call_trampoline (CORE_ADDR pc, char *name);
+
#endif
diff --git a/gdb/gdbarch.c b/gdb/gdbarch.c
index e5b6c45..f0a8a0a 100644
--- a/gdb/gdbarch.c
+++ b/gdb/gdbarch.c
@@ -253,6 +253,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_in_solib_call_trampoline_ftype *in_solib_call_trampoline;
};
@@ -390,6 +391,7 @@ struct gdbarch startup_gdbarch =
0,
0,
0,
+ 0,
/* startup_gdbarch() */
};
@@ -497,6 +499,7 @@ gdbarch_alloc (const struct gdbarch_info *info,
current_gdbarch->addr_bits_remove = core_addr_identity;
current_gdbarch->print_insn = legacy_print_insn;
current_gdbarch->skip_trampoline_code = generic_skip_trampoline_code;
+ current_gdbarch->in_solib_call_trampoline = generic_in_solib_call_trampoline;
/* gdbarch_alloc() */
return current_gdbarch;
@@ -795,6 +798,7 @@ verify_gdbarch (struct gdbarch *gdbarch)
/* Skip verify of software_single_step, has predicate */
/* Skip verify of print_insn, invalid_p == 0 */
/* Skip verify of skip_trampoline_code, invalid_p == 0 */
+ /* Skip verify of in_solib_call_trampoline, invalid_p == 0 */
}
@@ -1327,6 +1331,17 @@ gdbarch_dump (struct gdbarch *gdbarch, struct ui_file *file)
(long) current_gdbarch->integer_to_address
/*INTEGER_TO_ADDRESS ()*/);
#endif
+#ifdef IN_SOLIB_CALL_TRAMPOLINE
+ fprintf_unfiltered (file,
+ "gdbarch_dump: %s # %s\n",
+ "IN_SOLIB_CALL_TRAMPOLINE(pc, name)",
+ XSTRING (IN_SOLIB_CALL_TRAMPOLINE (pc, name)));
+ if (GDB_MULTI_ARCH)
+ fprintf_unfiltered (file,
+ "gdbarch_dump: IN_SOLIB_CALL_TRAMPOLINE = 0x%08lx\n",
+ (long) current_gdbarch->in_solib_call_trampoline
+ /*IN_SOLIB_CALL_TRAMPOLINE ()*/);
+#endif
#ifdef MAX_REGISTER_RAW_SIZE
fprintf_unfiltered (file,
"gdbarch_dump: MAX_REGISTER_RAW_SIZE # %s\n",
@@ -4240,6 +4255,24 @@ set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch,
gdbarch->skip_trampoline_code = skip_trampoline_code;
}
+int
+gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name)
+{
+ if (gdbarch->in_solib_call_trampoline == 0)
+ internal_error (__FILE__, __LINE__,
+ "gdbarch: gdbarch_in_solib_call_trampoline invalid");
+ if (gdbarch_debug >= 2)
+ fprintf_unfiltered (gdb_stdlog, "gdbarch_in_solib_call_trampoline called\n");
+ return gdbarch->in_solib_call_trampoline (pc, name);
+}
+
+void
+set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch,
+ gdbarch_in_solib_call_trampoline_ftype in_solib_call_trampoline)
+{
+ gdbarch->in_solib_call_trampoline = in_solib_call_trampoline;
+}
+
/* Keep a registry of per-architecture data-pointers required by GDB
modules. */
diff --git a/gdb/gdbarch.h b/gdb/gdbarch.h
index 26ae3aa..31746fc 100644
--- a/gdb/gdbarch.h
+++ b/gdb/gdbarch.h
@@ -2023,6 +2023,27 @@ extern void set_gdbarch_skip_trampoline_code (struct gdbarch *gdbarch, gdbarch_s
#endif
#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 current stopped in one of these. */
+
+/* Default (function) for non- multi-arch platforms. */
+#if (!GDB_MULTI_ARCH) && !defined (IN_SOLIB_CALL_TRAMPOLINE)
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (generic_in_solib_call_trampoline (pc, name))
+#endif
+
+typedef int (gdbarch_in_solib_call_trampoline_ftype) (CORE_ADDR pc, char *name);
+extern int gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, CORE_ADDR pc, char *name);
+extern void set_gdbarch_in_solib_call_trampoline (struct gdbarch *gdbarch, gdbarch_in_solib_call_trampoline_ftype *in_solib_call_trampoline);
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) && defined (IN_SOLIB_CALL_TRAMPOLINE)
+#error "Non multi-arch definition of IN_SOLIB_CALL_TRAMPOLINE"
+#endif
+#if GDB_MULTI_ARCH
+#if (GDB_MULTI_ARCH > GDB_MULTI_ARCH_PARTIAL) || !defined (IN_SOLIB_CALL_TRAMPOLINE)
+#define IN_SOLIB_CALL_TRAMPOLINE(pc, name) (gdbarch_in_solib_call_trampoline (current_gdbarch, pc, name))
+#endif
+#endif
+
extern struct gdbarch_tdep *gdbarch_tdep (struct gdbarch *gdbarch);
diff --git a/gdb/gdbarch.sh b/gdb/gdbarch.sh
index d1354d9..d3bd595 100755
--- a/gdb/gdbarch.sh
+++ b/gdb/gdbarch.sh
@@ -542,6 +542,10 @@ f:2:ADDR_BITS_REMOVE:CORE_ADDR:addr_bits_remove:CORE_ADDR addr:addr:::core_addr_
F:2:SOFTWARE_SINGLE_STEP:void:software_single_step:enum target_signal sig, int insert_breakpoints_p:sig, insert_breakpoints_p::0:0
f:2:TARGET_PRINT_INSN:int:print_insn:bfd_vma vma, disassemble_info *info:vma, info:::legacy_print_insn::0
f:2:SKIP_TRAMPOLINE_CODE:CORE_ADDR:skip_trampoline_code:CORE_ADDR pc:pc:::generic_skip_trampoline_code::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 current stopped in one of these.
+f:2:IN_SOLIB_CALL_TRAMPOLINE:int:in_solib_call_trampoline:CORE_ADDR pc, char *name:pc, name:::generic_in_solib_call_trampoline::0
EOF
}
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 18bb8c0..0730f91 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -183,14 +183,6 @@ static int may_follow_exec = MAY_FOLLOW_EXEC;
#define SKIP_SOLIB_RESOLVER(pc) 0
#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 current stopped in one of these. */
-
-#ifndef IN_SOLIB_CALL_TRAMPOLINE
-#define IN_SOLIB_CALL_TRAMPOLINE(pc,name) 0
-#endif
-
/* In some shared library schemes, the return path from a shared library
call may need to go through a trampoline too. */