X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=gdb%2Finline-frame.c;h=f8ba249eb407cae9c2ad1ebd485ddd7b4750fcf2;hb=ec8f76882145c71bef81a9cadf0bf51ff9fa5b35;hp=05ba9ff8dbb3506be87e8ac6032b9c057bd039e0;hpb=ecd75fc8eed3bde86036141228074a20e55dcfc9;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c index 05ba9ff8db..f8ba249eb4 100644 --- a/gdb/inline-frame.c +++ b/gdb/inline-frame.c @@ -1,6 +1,6 @@ /* Inline frame unwinder for GDB. - Copyright (C) 2008-2014 Free Software Foundation, Inc. + Copyright (C) 2008-2016 Free Software Foundation, Inc. This file is part of GDB. @@ -26,8 +26,7 @@ #include "regcache.h" #include "symtab.h" #include "vec.h" - -#include "gdb_assert.h" +#include "frame.h" /* We need to save a few variables for every thread stopped at the virtual call site of an inlined function. If there was always a @@ -154,11 +153,11 @@ inline_frame_this_id (struct frame_info *this_frame, /* In order to have a stable frame ID for a given inline function, we must get the stack / special addresses from the underlying - real frame's this_id method. So we must call get_prev_frame. - Because we are inlined into some function, there must be previous - frames, so this is safe - as long as we're careful not to - create any cycles. */ - *this_id = get_frame_id (get_prev_frame (this_frame)); + real frame's this_id method. So we must call + get_prev_frame_always. Because we are inlined into some + function, there must be previous frames, so this is safe - as + long as we're careful not to create any cycles. */ + *this_id = get_frame_id (get_prev_frame_always (this_frame)); /* We need a valid frame ID, so we need to be based on a valid frame. FSF submission NOTE: this would be a good assertion to @@ -208,7 +207,7 @@ inline_frame_sniffer (const struct frame_unwind *self, void **this_cache) { CORE_ADDR this_pc; - struct block *frame_block, *cur_block; + const struct block *frame_block, *cur_block; int depth; struct frame_info *next_frame; struct inline_state *state = find_inline_frame_state (inferior_ptid); @@ -226,6 +225,8 @@ inline_frame_sniffer (const struct frame_unwind *self, { if (block_inlined_p (cur_block)) depth++; + else if (BLOCK_FUNCTION (cur_block) != NULL) + break; cur_block = BLOCK_SUPERBLOCK (cur_block); } @@ -273,16 +274,16 @@ const struct frame_unwind inline_frame_unwind = { before it). */ static int -block_starting_point_at (CORE_ADDR pc, struct block *block) +block_starting_point_at (CORE_ADDR pc, const struct block *block) { - struct blockvector *bv; + const struct blockvector *bv; struct block *new_block; bv = blockvector_for_pc (pc, NULL); if (BLOCKVECTOR_MAP (bv) == NULL) return 0; - new_block = addrmap_find (BLOCKVECTOR_MAP (bv), pc - 1); + new_block = (struct block *) addrmap_find (BLOCKVECTOR_MAP (bv), pc - 1); if (new_block == NULL) return 1; @@ -303,7 +304,7 @@ void skip_inline_frames (ptid_t ptid) { CORE_ADDR this_pc; - struct block *frame_block, *cur_block; + const struct block *frame_block, *cur_block; struct symbol *last_sym = NULL; int skip_count = 0; struct inline_state *state; @@ -332,6 +333,9 @@ skip_inline_frames (ptid_t ptid) else break; } + else if (BLOCK_FUNCTION (cur_block) != NULL) + break; + cur_block = BLOCK_SUPERBLOCK (cur_block); } }