2009-01-25 Pedro Alves * 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. --- gdb/frame.c | 14 ++++++++------ gdb/stack.c | 2 +- 2 files changed, 9 insertions(+), 7 deletions(-) Index: src/gdb/frame.c =================================================================== --- src.orig/gdb/frame.c 2009-01-25 16:26:08.000000000 +0000 +++ src/gdb/frame.c 2009-01-25 16:26:24.000000000 +0000 @@ -1106,17 +1106,19 @@ create_new_frame (CORE_ADDR addr, CORE_A 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) { Index: src/gdb/stack.c =================================================================== --- src.orig/gdb/stack.c 2009-01-25 16:26:07.000000000 +0000 +++ src/gdb/stack.c 2009-01-25 16:26:24.000000000 +0000 @@ -832,7 +832,7 @@ parse_frame_specification_1 (const char { int i; for (i = 0; i < numargs; i++) - addrs[i] = value_as_address (args[0]); + addrs[i] = value_as_address (args[i]); } /* Assume that the single arg[0] is an address, use that to identify