diff options
author | bde <bde@FreeBSD.org> | 1998-01-18 12:35:48 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 1998-01-18 12:35:48 +0000 |
commit | 731bdc143f08722842da1c37feec854720379de2 (patch) | |
tree | ca1d0f0bd5a15ea4e52894bce953a6baef69b7b8 /gnu/usr.bin/gdb | |
parent | 473242b8c33420c612cda326f227ecb3a63f80cd (diff) | |
download | FreeBSD-src-731bdc143f08722842da1c37feec854720379de2.zip FreeBSD-src-731bdc143f08722842da1c37feec854720379de2.tar.gz |
Don't override FRAME_CHAIN(). If the current frame is valid, then
the previous frame is in the usual place even for traps, interrupts
and syscalls in the kernel, because the assembly language stubs
don't change the frame pointer. The previous frame is just not for
the calling function. We may as well depend on this as on magic to
determine the trap frame address. The magic is in FRAME_SAVED_PC()
which elides the correct number of stubs (1) to go back to a pc that
matches the previous frame.
Removing fbsd_kern_frame_chain() fixes bugs in it. Xsyscall was
misspelled as _Xsyscall (gdb removes one leading underscore), so
the tf_syscall frame type was never found. This was harmless
because tf_normal works in all cases in fbsd_kern_frame_chain()
and Xsyscall is spelled correctly in fbsd_kern_frame_saved_pc()
where it matters. There were style bugs on almost every line,
starting with a primary indent of 7.
Diffstat (limited to 'gnu/usr.bin/gdb')
-rw-r--r-- | gnu/usr.bin/gdb/gdb/kvm-fbsd.c | 38 | ||||
-rw-r--r-- | gnu/usr.bin/gdb/gdb/tm.h | 15 |
2 files changed, 0 insertions, 53 deletions
diff --git a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c index ed1504e..8004a38 100644 --- a/gnu/usr.bin/gdb/gdb/kvm-fbsd.c +++ b/gnu/usr.bin/gdb/gdb/kvm-fbsd.c @@ -162,44 +162,6 @@ struct frame_info *fr; } } -CORE_ADDR -fbsd_kern_frame_chain (fr) -struct frame_info *fr; -{ - struct minimal_symbol *sym; - CORE_ADDR this_saved_pc; - enum frametype frametype; - - this_saved_pc = read_memory_integer (fr->frame + 4, 4); - sym = lookup_minimal_symbol_by_pc (this_saved_pc); - frametype = tf_normal; - if (sym != NULL) { - if (strcmp (SYMBOL_NAME(sym), "calltrap") == 0) - frametype = tf_trap; - else if (strncmp (SYMBOL_NAME(sym), "Xresume", 7) == 0) - frametype = tf_interrupt; - else if (strcmp (SYMBOL_NAME(sym), "_Xsyscall") == 0) - frametype = tf_syscall; - } - - switch (frametype) { - case tf_normal: - return (read_memory_integer (fr->frame, 4)); - -#define oEBP offsetof(struct trapframe, tf_ebp) - - case tf_trap: - return (read_memory_integer (fr->frame + 8 + oEBP, 4)); - - case tf_interrupt: - return (read_memory_integer (fr->frame + 16 + oEBP, 4)); - - case tf_syscall: - return (read_memory_integer (fr->frame + 8 + oEBP, 4)); -#undef oEBP - } -} - static CORE_ADDR ksym_lookup (name) const char *name; diff --git a/gnu/usr.bin/gdb/gdb/tm.h b/gnu/usr.bin/gdb/gdb/tm.h index 6f5fc91..39fda77 100644 --- a/gnu/usr.bin/gdb/gdb/tm.h +++ b/gnu/usr.bin/gdb/gdb/tm.h @@ -35,21 +35,6 @@ extern void i386_float_info PARAMS ((void)); #define IN_SOLIB_CALL_TRAMPOLINE(pc, name) STREQ (name, "_DYNAMIC") -/* FRAME_CHAIN takes a frame's nominal address and produces the frame's - chain-pointer. - In the case of the i386, the frame's nominal address - is the address of a 4-byte word containing the calling frame's address. */ - -extern CORE_ADDR fbsd_kern_frame_chain (struct frame_info *); -#undef FRAME_CHAIN -#define FRAME_CHAIN(thisframe) \ - (kernel_debugging ? fbsd_kern_frame_chain(thisframe) : \ - ((thisframe)->signal_handler_caller \ - ? (thisframe)->frame \ - : (!inside_entry_file ((thisframe)->pc) \ - ? read_memory_integer ((thisframe)->frame, 4) \ - : 0))) - /* Saved Pc. Get it from sigcontext if within sigtramp. */ extern CORE_ADDR fbsd_kern_frame_saved_pc (struct frame_info *); |