/* Inline frame unwinder for GDB.
- Copyright (C) 2008-2018 Free Software Foundation, Inc.
+ Copyright (C) 2008-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbthread.h"
#include "regcache.h"
#include "symtab.h"
-#include "vec.h"
#include "frame.h"
#include <algorithm>
in the frame ID (and eventually, to set breakpoints). */
func = get_frame_function (this_frame);
gdb_assert (func != NULL);
- (*this_id).code_addr = BLOCK_START (SYMBOL_BLOCK_VALUE (func));
+ (*this_id).code_addr = BLOCK_ENTRY_PC (SYMBOL_BLOCK_VALUE (func));
(*this_id).artificial_depth++;
}
block_starting_point_at (CORE_ADDR pc, const struct block *block)
{
const struct blockvector *bv;
- struct block *new_block;
+ const struct block *new_block;
bv = blockvector_for_pc (pc, NULL);
if (BLOCKVECTOR_MAP (bv) == NULL)
return 0;
- new_block = (struct block *) addrmap_find (BLOCKVECTOR_MAP (bv), pc - 1);
+ new_block = (const struct block *) addrmap_find (BLOCKVECTOR_MAP (bv),
+ pc - 1);
if (new_block == NULL)
return 1;
bp_location *loc = s->bp_location_at;
enum bp_loc_type t = loc->loc_type;
- if ((t == bp_loc_software_breakpoint
- || t == bp_loc_hardware_breakpoint)
- && frame_block == SYMBOL_BLOCK_VALUE (loc->symbol))
- return true;
+ if (t == bp_loc_software_breakpoint
+ || t == bp_loc_hardware_breakpoint)
+ {
+ /* If the location has a function symbol, check whether
+ the frame was for that inlined function. If it has
+ no function symbol, then assume it is. I.e., default
+ to presenting the stop at the innermost inline
+ function. */
+ if (loc->symbol == nullptr
+ || frame_block == SYMBOL_BLOCK_VALUE (loc->symbol))
+ return true;
+ }
}
}
if (block_inlined_p (cur_block))
{
/* See comments in inline_frame_this_id about this use
- of BLOCK_START. */
- if (BLOCK_START (cur_block) == this_pc
+ of BLOCK_ENTRY_PC. */
+ if (BLOCK_ENTRY_PC (cur_block) == this_pc
|| block_starting_point_at (this_pc, cur_block))
{
/* Do not skip the inlined frame if execution