#include "dwarf2loc.h"
#include "dwarf2-frame-tailcall.h"
#if GDB_SELF_TEST
-#include "common/selftest.h"
+#include "gdbsupport/selftest.h"
#include "selftest-arch.h"
#endif
/* Save the initialized register set. */
fs.initial = fs.regs;
- if (get_frame_func_if_available (this_frame, &entry_pc))
+ /* Fetching the entry pc for THIS_FRAME won't necessarily result
+ in an address that's within the range of FDE locations. This
+ is due to the possibility of the function occupying non-contiguous
+ ranges. */
+ if (get_frame_func_if_available (this_frame, &entry_pc)
+ && fde->initial_location <= entry_pc
+ && entry_pc < fde->initial_location + fde->address_range)
{
/* Decode the insns in the FDE up to the entry PC. */
instr = execute_cfa_program (fde, fde->instructions, fde->end, gdbarch,
return get_frame_base (this_frame);
}
\f
-const struct objfile_data *dwarf2_frame_objfile_data;
+const struct objfile_key<dwarf2_fde_table,
+ gdb::noop_deleter<dwarf2_fde_table>>
+ dwarf2_frame_objfile_data;
static unsigned int
read_1_byte (bfd *abfd, const gdb_byte *buf)
CORE_ADDR offset;
CORE_ADDR seek_pc;
- fde_table = ((struct dwarf2_fde_table *)
- objfile_data (objfile, dwarf2_frame_objfile_data));
+ fde_table = dwarf2_frame_objfile_data.get (objfile);
if (fde_table == NULL)
{
dwarf2_build_frame_info (objfile);
- fde_table = ((struct dwarf2_fde_table *)
- objfile_data (objfile, dwarf2_frame_objfile_data));
+ fde_table = dwarf2_frame_objfile_data.get (objfile);
}
gdb_assert (fde_table != NULL);
xfree (fde_table.entries);
}
- set_objfile_data (objfile, dwarf2_frame_objfile_data, fde_table2);
+ dwarf2_frame_objfile_data.set (objfile, fde_table2);
}
/* Handle 'maintenance show dwarf unwinders'. */
_initialize_dwarf2_frame (void)
{
dwarf2_frame_data = gdbarch_data_register_pre_init (dwarf2_frame_init);
- dwarf2_frame_objfile_data = register_objfile_data ();
add_setshow_boolean_cmd ("unwinders", class_obscure,
&dwarf2_frame_unwinders_enabled_p , _("\