aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Jacobowitz <drow@false.org>2010-02-01 19:46:46 +0000
committerDaniel Jacobowitz <drow@false.org>2010-02-01 19:46:46 +0000
commit7618e12bcb8f15e83c8c6abc5216f520f09bdbf9 (patch)
tree64c49f1c2a8dc82b8430eb6ec9db7ae8bc72d293
parentb381ea14bd6aa64d0412c4207658f545a9331965 (diff)
downloadgdb-7618e12bcb8f15e83c8c6abc5216f520f09bdbf9.zip
gdb-7618e12bcb8f15e83c8c6abc5216f520f09bdbf9.tar.gz
gdb-7618e12bcb8f15e83c8c6abc5216f520f09bdbf9.tar.bz2
* i386-tdep.c (i386_frame_cache): Assume valid anonymous
functions use a frame pointer.
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/i386-tdep.c14
2 files changed, 19 insertions, 1 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 991d3a6..b00c9a7 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2010-02-01 Michael Matz <matz@suse.de>
+ Daniel Jacobowitz <dan@codesourcery.com>
+
+ * i386-tdep.c (i386_frame_cache): Assume valid anonymous
+ functions use a frame pointer.
+
2010-02-01 Jan Kratochvil <jan.kratochvil@redhat.com>
* solib-svr4.c (scan_dyntag): New variable dyn_addr. Replace gdb_assert
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index eea4ff4..83aa81f 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -1395,12 +1395,24 @@ i386_frame_cache (struct frame_info *this_frame, void **this_cache)
/* This will be added back below. */
cache->saved_regs[I386_EIP_REGNUM] -= cache->base;
}
- else
+ else if (cache->pc != 0
+ || target_read_memory (get_frame_pc (this_frame), buf, 1))
{
+ /* We're in a known function, but did not find a frame
+ setup. Assume that the function does not use %ebp.
+ Alternatively, we may have jumped to an invalid
+ address; in that case there is definitely no new
+ frame in %ebp. */
get_frame_register (this_frame, I386_ESP_REGNUM, buf);
cache->base = extract_unsigned_integer (buf, 4, byte_order)
+ cache->sp_offset;
}
+ else
+ /* We're in an unknown function. We could not find the start
+ of the function to analyze the prologue; our best option is
+ to assume a typical frame layout with the caller's %ebp
+ saved. */
+ cache->saved_regs[I386_EBP_REGNUM] = 0;
}
/* Now that we have the base address for the stack frame we can