Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/gnu/dist/toolchain/gdb bring forward a change from the old gdb:



details:   https://anonhg.NetBSD.org/src/rev/02cd4b2879a4
branches:  trunk
changeset: 521966:02cd4b2879a4
user:      chs <chs%NetBSD.org@localhost>
date:      Sat Feb 09 19:37:38 2002 +0000

description:
bring forward a change from the old gdb:
Define IN_SIGTRAMP() as nbsd_in_sigtramp(), a new function which knows
how to find the address of the signal trampoline at runtime, thus allowing
one gdb binary to work on all NetBSD/m68k machines.

diffstat:

 gnu/dist/toolchain/gdb/config/m68k/tm-nbsd.h |   9 ++++-----
 gnu/dist/toolchain/gdb/m68k-tdep.c           |  27 +++++++++++++++++++++++++++
 2 files changed, 31 insertions(+), 5 deletions(-)

diffs (57 lines):

diff -r d3d22ca6d391 -r 02cd4b2879a4 gnu/dist/toolchain/gdb/config/m68k/tm-nbsd.h
--- a/gnu/dist/toolchain/gdb/config/m68k/tm-nbsd.h      Sat Feb 09 19:33:53 2002 +0000
+++ b/gnu/dist/toolchain/gdb/config/m68k/tm-nbsd.h      Sat Feb 09 19:37:38 2002 +0000
@@ -29,12 +29,11 @@
 
 #define BPT_VECTOR 0x2
 
-/* Address of end of stack space.  */
-#define STACK_END_ADDR USRSTACK
+/* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR,
+   but we don't know where that is until run-time!  */
 
-/* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR.  */
-#define SIGTRAMP_START(pc) (STACK_END_ADDR - 32)
-#define SIGTRAMP_END(pc) (STACK_END_ADDR)
+extern int nbsd_in_sigtramp(CORE_ADDR);
+#define IN_SIGTRAMP(pc, name) nbsd_in_sigtramp (pc)
 
 #include "m68k/tm-m68k.h"
 #include <tm-nbsd.h>
diff -r d3d22ca6d391 -r 02cd4b2879a4 gnu/dist/toolchain/gdb/m68k-tdep.c
--- a/gnu/dist/toolchain/gdb/m68k-tdep.c        Sat Feb 09 19:33:53 2002 +0000
+++ b/gnu/dist/toolchain/gdb/m68k-tdep.c        Sat Feb 09 19:37:38 2002 +0000
@@ -704,6 +704,33 @@
     return read_memory_integer (read_register (SP_REGNUM), 4);
 }
 
+/* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR,
+   but we don't know where that is until run-time!  */
+
+#ifdef TM_NBSD_H
+int
+nbsd_in_sigtramp (pc)
+     CORE_ADDR pc;
+{
+  static CORE_ADDR stack_end_addr;
+  struct minimal_symbol *msymbol;
+  CORE_ADDR pssaddr;
+  int rv;
+
+  if (stack_end_addr == 0) {
+    msymbol = lookup_minimal_symbol("__ps_strings", NULL, NULL);
+    if (msymbol == NULL)
+      pssaddr = 0x40a0; /* XXX return 0? */
+    else
+      pssaddr = SYMBOL_VALUE_ADDRESS(msymbol);
+    stack_end_addr = read_memory_integer (pssaddr, 4);
+    stack_end_addr = (stack_end_addr + 0xFF) & ~0xFF;
+  }
+  rv = ((pc >= (stack_end_addr - 32)) &&
+       (pc < stack_end_addr));
+  return rv;
+}
+#endif /* TM_NBSD_H */
 
 void
 _initialize_m68k_tdep ()



Home | Main Index | Thread Index | Old Index