aboutsummaryrefslogtreecommitdiff
path: root/gdb/hppa-tdep.c
diff options
context:
space:
mode:
authorJeff Law <law@redhat.com>1994-11-24 08:02:01 +0000
committerJeff Law <law@redhat.com>1994-11-24 08:02:01 +0000
commit481faa25acc8ea42f8d5f5e5e37f137806616226 (patch)
tree337b91a7363832ffd22ea45c5ef30a7d48c3fdaa /gdb/hppa-tdep.c
parentb5a37058d497b85520b1cd21d88ce40864a04f46 (diff)
downloadgdb-481faa25acc8ea42f8d5f5e5e37f137806616226.zip
gdb-481faa25acc8ea42f8d5f5e5e37f137806616226.tar.gz
gdb-481faa25acc8ea42f8d5f5e5e37f137806616226.tar.bz2
* blockframe.c (find_pc_partial_function): Inhibit mst_trampoline
symbol special handling when INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK is defined. * infrun.c (IN_SOLIB_CALL_TRAMPOLINE): Renamed from IN_SOLIB_TRAMPOLINE. All callers changed. (IN_SOLIB_RETURN_TRAMPOLINE): Provide default definition. (wait_for_inferior): Handle single stepping through trampolines on return paths from shared libraries. * config/pa/tm-hppa.h (IN_SOLIB_CALL_TRAMPOLINE): Use in_solib_call_trampoline. (IN_SOLIB_RETURN_TRAMPOLINE): Use in_solib_return_trampoline. (INHIBIT_SUNSOLIB_TRANSFER_TABLE_HACK): Define. * hppa-tdep.c (in_solib_call_trampoline): New function. (in_solib_return_trampoline): New function.
Diffstat (limited to 'gdb/hppa-tdep.c')
-rw-r--r--gdb/hppa-tdep.c80
1 files changed, 80 insertions, 0 deletions
diff --git a/gdb/hppa-tdep.c b/gdb/hppa-tdep.c
index 83772c6..a3f6994 100644
--- a/gdb/hppa-tdep.c
+++ b/gdb/hppa-tdep.c
@@ -1574,6 +1574,86 @@ pa_print_fp_reg (i)
}
}
+/* Return one if PC is in the call path of a shared library trampoline, else
+ return zero. */
+
+in_solib_call_trampoline (pc, name)
+ CORE_ADDR pc;
+ char *name;
+{
+ struct minimal_symbol *minsym;
+ struct unwind_table_entry *u;
+
+ /* Get the unwind descriptor corresponding to PC, return zero
+ if no unwind was found. */
+ u = find_unwind_entry (pc);
+ if (!u)
+ return 0;
+
+ /* If this isn't a linker stub, then return now. */
+ if (u->stub_type != IMPORT
+ && u->stub_type != EXPORT)
+ return 0;
+
+ /* The call and return path execute the same instructions within
+ an IMPORT stub! So an IMPORT stub is both a call and return
+ trampoline. */
+ if (u->stub_type == IMPORT)
+ return 1;
+
+ /* The linker may group many EXPORT stubs into one unwind entry. So
+ lookup the minimal symbol and use that as the beginning of this
+ particular stub. */
+ minsym = lookup_minimal_symbol_by_pc (pc);
+ if (minsym == NULL)
+ return 0;
+
+ /* Export stubs have distinct call and return paths. The first
+ two instructions are the call path, following four are the
+ return path. */
+ return (pc >= SYMBOL_VALUE (minsym) && pc < SYMBOL_VALUE (minsym) + 8);
+}
+
+/* Return one if PC is in the return path of a shared library trampoline,
+ else return zero. */
+
+in_solib_return_trampoline (pc, name)
+ CORE_ADDR pc;
+ char *name;
+{
+ struct minimal_symbol *minsym;
+ struct unwind_table_entry *u;
+
+ /* Get the unwind descriptor corresponding to PC, return zero
+ if no unwind was found. */
+ u = find_unwind_entry (pc);
+ if (!u)
+ return 0;
+
+ /* If this isn't a linker stub, then return now. */
+ if (u->stub_type != IMPORT
+ && u->stub_type != EXPORT)
+ return 0;
+
+ /* The call and return path execute the same instructions within
+ an IMPORT stub! So an IMPORT stub is both a call and return
+ trampoline. */
+ if (u->stub_type == IMPORT)
+ return 1;
+
+ /* The linker may group many EXPORT stubs into one unwind entry. So
+ lookup the minimal symbol and use that as the beginning of this
+ particular stub. */
+ minsym = lookup_minimal_symbol_by_pc (pc);
+ if (minsym == NULL)
+ return 0;
+
+ /* Export stubs have distinct call and return paths. The first
+ two instructions are the call path, following four are the
+ return path. */
+ return (pc >= SYMBOL_VALUE (minsym) + 8 && pc < SYMBOL_VALUE (minsym) + 20);
+}
+
/* Figure out if PC is in a trampoline, and if so find out where
the trampoline will jump to. If not in a trampoline, return zero.