diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-11-27 23:33:07 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-11-27 23:33:07 +0000 |
commit | 35883a3f2ffd78d7d2f023258b0144ae692485d0 (patch) | |
tree | b5bf2d058e85509921400531cb88bf155e669cd5 /gdb | |
parent | fdec90e86d8640891d303320034b973e9a6a0a0c (diff) | |
download | gdb-35883a3f2ffd78d7d2f023258b0144ae692485d0.zip gdb-35883a3f2ffd78d7d2f023258b0144ae692485d0.tar.gz gdb-35883a3f2ffd78d7d2f023258b0144ae692485d0.tar.bz2 |
* x86-64-tdep.c (x86_64_frame_cache): Don't bail out if %rbp is
zero. Reorganize code a bit.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/x86-64-tdep.c | 18 |
2 files changed, 15 insertions, 8 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 5b7d4d2..b1bf864 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2003-11-28 Mark Kettenis <kettenis@gnu.org> + + * x86-64-tdep.c (x86_64_frame_cache): Don't bail out if %rbp is + zero. Reorganize code a bit. + 2003-11-27 Mark Kettenis <kettenis@gnu.org> * dwarf2-frame.c: Fix another comment. diff --git a/gdb/x86-64-tdep.c b/gdb/x86-64-tdep.c index 59d29f3..9c6da6c 100644 --- a/gdb/x86-64-tdep.c +++ b/gdb/x86-64-tdep.c @@ -1061,14 +1061,6 @@ x86_64_frame_cache (struct frame_info *next_frame, void **this_cache) cache = x86_64_alloc_frame_cache (); *this_cache = cache; - frame_unwind_register (next_frame, X86_64_RBP_REGNUM, buf); - cache->base = extract_unsigned_integer (buf, 8); - if (cache->base == 0) - return cache; - - /* For normal frames, %rip is stored at 8(%rbp). */ - cache->saved_regs[X86_64_RIP_REGNUM] = 8; - cache->pc = frame_func_unwind (next_frame); if (cache->pc != 0) x86_64_analyze_prologue (cache->pc, frame_pc_unwind (next_frame), cache); @@ -1086,11 +1078,21 @@ x86_64_frame_cache (struct frame_info *next_frame, void **this_cache) frame_unwind_register (next_frame, X86_64_RSP_REGNUM, buf); cache->base = extract_unsigned_integer (buf, 8) + cache->sp_offset; } + else + { + frame_unwind_register (next_frame, X86_64_RBP_REGNUM, buf); + cache->base = extract_unsigned_integer (buf, 8); + } /* Now that we have the base address for the stack frame we can calculate the value of %rsp in the calling frame. */ cache->saved_sp = cache->base + 16; + /* For normal frames, %rip is stored at 8(%rbp). If we don't have a + frame we find it at the same offset from the reconstructed base + address. */ + cache->saved_regs[X86_64_RIP_REGNUM] = 8; + /* Adjust all the saved registers such that they contain addresses instead of offsets. */ for (i = 0; i < X86_64_NUM_SAVED_REGS; i++) |