2004-10-31 Andrew Cagney <cagney@gnu.org>
authorAndrew Cagney <cagney@redhat.com>
Sun, 31 Oct 2004 21:09:28 +0000 (21:09 +0000)
committerAndrew Cagney <cagney@redhat.com>
Sun, 31 Oct 2004 21:09:28 +0000 (21:09 +0000)
* hppa-tdep.c (hppa_stub_unwind_sniffer): Replace
IN_SOLIB_CALL_TRAMPOLINE with tdep.in_solib_call_trampoline.
* hppa-tdep.h (struct gdbarch_tdep): Add in_solib_call_trampoline.
* hppa-hpux-tdep.c (hppa_hpux_init_abi): Set same.
* hppa-linux-tdep.c (hppa_linux_init_abi): Ditto.

gdb/ChangeLog
gdb/hppa-hpux-tdep.c
gdb/hppa-linux-tdep.c
gdb/hppa-tdep.c
gdb/hppa-tdep.h

index 4432e4879a8d0d776156fc0f5e1f993473c25dc0..ecdf2c603a88f4c314d26b2351f2fdff454982fe 100644 (file)
@@ -1,3 +1,11 @@
+2004-10-31  Andrew Cagney  <cagney@gnu.org>
+
+       * hppa-tdep.c (hppa_stub_unwind_sniffer): Replace
+       IN_SOLIB_CALL_TRAMPOLINE with tdep.in_solib_call_trampoline.
+       * hppa-tdep.h (struct gdbarch_tdep): Add in_solib_call_trampoline.
+       * hppa-hpux-tdep.c (hppa_hpux_init_abi): Set same.
+       * hppa-linux-tdep.c (hppa_linux_init_abi): Ditto.
+
 2004-10-31  Mark Kettenis  <kettenis@gnu.org>
 
        * mipsnbsd-nat.c: Include "target.h" and "inf-ptrace.h".
index 78f3e2abf85477a3c7e97aaf4cccbee313a71e72..9623abeb759c049388f968d7b6daf13dd19cdbf7 100644 (file)
@@ -1407,11 +1407,9 @@ hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (tdep->bytes_per_address == 4)
-    set_gdbarch_in_solib_call_trampoline (gdbarch, 
-                                         hppa32_hpux_in_solib_call_trampoline);
+    tdep->in_solib_call_trampoline = hppa32_hpux_in_solib_call_trampoline;
   else
-    set_gdbarch_in_solib_call_trampoline (gdbarch, 
-                                         hppa64_hpux_in_solib_call_trampoline);
+    tdep->in_solib_call_trampoline = hppa64_hpux_in_solib_call_trampoline;
 
   set_gdbarch_in_solib_return_trampoline (gdbarch,
                                          hppa_hpux_in_solib_return_trampoline);
index 7f32236274d6fb9d0e2644093eff1b51d31bc46a..b7a00bcd2483d2251065bae927496bd5bad237b6 100644 (file)
@@ -563,8 +563,7 @@ hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_solib_svr4_fetch_link_map_offsets
     (gdbarch, svr4_ilp32_fetch_link_map_offsets);
 
-  set_gdbarch_in_solib_call_trampoline
-        (gdbarch, hppa_linux_in_solib_call_trampoline);
+  tdep->in_solib_call_trampoline = hppa_linux_in_solib_call_trampoline;
   set_gdbarch_skip_trampoline_code
        (gdbarch, hppa_linux_skip_trampoline_code);
 
index db15a1b30839776fb291a5054c7547c1d23ca31f..ee936ed6d527a44e6a3f8e616445abfafb6b6f6b 100644 (file)
@@ -2096,9 +2096,12 @@ static const struct frame_unwind *
 hppa_stub_unwind_sniffer (struct frame_info *next_frame)
 {
   CORE_ADDR pc = frame_pc_unwind (next_frame);
+  struct gdbarch *gdbarch = get_frame_arch (next_frame);
+  struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
   if (pc == 0
-      || IN_SOLIB_CALL_TRAMPOLINE (pc, NULL)
+      || (tdep->in_solib_call_trampoline != NULL
+         && tdep->in_solib_call_trampoline (pc, NULL))
       || IN_SOLIB_RETURN_TRAMPOLINE (pc, NULL))
     return &hppa_stub_frame_unwind;
   return NULL;
index 26a7556a68607ed4287821fa210ffab97d64c0bf..857b87433aff37ef6e4ed6461893d387fea7b242 100644 (file)
@@ -82,6 +82,12 @@ struct gdbarch_tdep
   /* Given a function address, try to find the global pointer for the 
      corresponding shared object.  */
   CORE_ADDR (*find_global_pointer) (struct value *);
+
+  /* For shared libraries, each call goes through a small piece of
+     trampoline code in the ".plt", or equivalent, section.
+     IN_SOLIB_CALL_TRAMPOLINE evaluates to nonzero if we are currently
+     stopped in one of these.  */
+  int (*in_solib_call_trampoline) (CORE_ADDR pc, char *name);
 };
 
 /*