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.
This commit is contained in:
parent
bbd559bc7a
commit
dcee4d2ab2
9
gnu/dist/toolchain/gdb/config/m68k/tm-nbsd.h
vendored
9
gnu/dist/toolchain/gdb/config/m68k/tm-nbsd.h
vendored
@ -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>
|
||||
|
27
gnu/dist/toolchain/gdb/m68k-tdep.c
vendored
27
gnu/dist/toolchain/gdb/m68k-tdep.c
vendored
@ -704,6 +704,33 @@ m68k_saved_pc_after_call (frame)
|
||||
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 ()
|
||||
|
Loading…
Reference in New Issue
Block a user