aboutsummaryrefslogtreecommitdiff
path: root/gdb/frame.c
diff options
context:
space:
mode:
authorPedro Alves <palves@redhat.com>2009-01-26 19:09:58 +0000
committerPedro Alves <palves@redhat.com>2009-01-26 19:09:58 +0000
commit1e275f793e425abf454a7b8d98b411760115f52e (patch)
tree8a42d7ad211f3bd66c8aab825a6639e067b6c88c /gdb/frame.c
parent1deafd4ea5ec0948407fe58c3ea5d1737e000133 (diff)
downloadgdb-1e275f793e425abf454a7b8d98b411760115f52e.zip
gdb-1e275f793e425abf454a7b8d98b411760115f52e.tar.gz
gdb-1e275f793e425abf454a7b8d98b411760115f52e.tar.bz2
* frame.c (create_new_frame): Update the frame's cached PC before
finding its unwinder. Use frame_id_build to build the new frame's id. * stack.c (parse_frame_specification_1): Correct setting ``addrs'' array values from the ``args'' array values.
Diffstat (limited to 'gdb/frame.c')
-rw-r--r--gdb/frame.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gdb/frame.c b/gdb/frame.c
index 7afb70f..7f67d2e 100644
--- a/gdb/frame.c
+++ b/gdb/frame.c
@@ -1106,17 +1106,19 @@ create_new_frame (CORE_ADDR addr, CORE_ADDR pc)
fi->next = create_sentinel_frame (get_current_regcache ());
+ /* Set/update this frame's cached PC value, found in the next frame.
+ Do this before looking for this frame's unwinder. A sniffer is
+ very likely to read this, and the corresponding unwinder is
+ entitled to rely that the PC doesn't magically change. */
+ fi->next->prev_pc.value = pc;
+ fi->next->prev_pc.p = 1;
+
/* Select/initialize both the unwind function and the frame's type
based on the PC. */
fi->unwind = frame_unwind_find_by_frame (fi, &fi->prologue_cache);
fi->this_id.p = 1;
- fi->this_id.value.stack_addr = addr;
- /* While we're at it, update this frame's cached PC value, found
- in the next frame. Oh for the day when "struct frame_info"
- is opaque and this hack on hack can just go away. */
- fi->next->prev_pc.value = pc;
- fi->next->prev_pc.p = 1;
+ fi->this_id.value = frame_id_build (addr, pc);
if (frame_debug)
{