From: Pedro Alves Date: Mon, 26 Jan 2009 19:09:58 +0000 (+0000) Subject: * frame.c (create_new_frame): Update the frame's cached PC before X-Git-Tag: sid-snapshot-20090201~57 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1e275f793e425abf454a7b8d98b411760115f52e;p=platform%2Fupstream%2Fbinutils.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 032afd8..4743846 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,13 @@ 2009-01-26 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. + +2009-01-26 Pedro Alves + * gdbtypes.c (alloc_type, alloc_type_instance, create_range_type) (create_array_type, create_set_type, init_flags_type) (copy_type_recursive): Replace pairs of calls to XALLOC and memset 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) { diff --git a/gdb/stack.c b/gdb/stack.c index c2b94f3..a1a7696 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -832,7 +832,7 @@ parse_frame_specification_1 (const char *frame_exp, const char *message, { 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