projects
/
deliverable
/
binutils-gdb.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Simplify show_source_or_disasm_and_command
[deliverable/binutils-gdb.git]
/
gdb
/
dwarf2-frame.c
diff --git
a/gdb/dwarf2-frame.c
b/gdb/dwarf2-frame.c
index 2d6116775eff25aad5b5e675089aab9f6fdec032..cad6b7b0ce0d4ada72d919ccd0f581a4fdc2e5ea 100644
(file)
--- a/
gdb/dwarf2-frame.c
+++ b/
gdb/dwarf2-frame.c
@@
-1,6
+1,6
@@
/* Frame unwinder for frames with DWARF Call Frame Information.
/* Frame unwinder for frames with DWARF Call Frame Information.
- Copyright (C) 2003-201
8
Free Software Foundation, Inc.
+ Copyright (C) 2003-201
9
Free Software Foundation, Inc.
Contributed by Mark Kettenis.
Contributed by Mark Kettenis.
@@
-40,7
+40,7
@@
#include "dwarf2loc.h"
#include "dwarf2-frame-tailcall.h"
#if GDB_SELF_TEST
#include "dwarf2loc.h"
#include "dwarf2-frame-tailcall.h"
#if GDB_SELF_TEST
-#include "selftest.h"
+#include "
gdbsupport/
selftest.h"
#include "selftest-arch.h"
#endif
#include "selftest-arch.h"
#endif
@@
-290,7
+290,7
@@
class dwarf_expr_executor : public dwarf_expr_context
CORE_ADDR get_addr_index (unsigned int index) override
{
CORE_ADDR get_addr_index (unsigned int index) override
{
- invalid ("DW_OP_GNU_addr_index");
+ invalid ("DW_OP_
addrx or DW_OP_
GNU_addr_index");
}
private:
}
private:
@@
-972,8
+972,7
@@
static struct dwarf2_frame_cache *
dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
{
struct gdbarch *gdbarch = get_frame_arch (this_frame);
- const int num_regs = gdbarch_num_regs (gdbarch)
- + gdbarch_num_pseudo_regs (gdbarch);
+ const int num_regs = gdbarch_num_cooked_regs (gdbarch);
struct dwarf2_frame_cache *cache;
struct dwarf2_fde *fde;
CORE_ADDR entry_pc;
struct dwarf2_frame_cache *cache;
struct dwarf2_fde *fde;
CORE_ADDR entry_pc;
@@
-1045,7
+1044,7
@@
dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
execute_cfa_program (fde, instr, fde->end, gdbarch,
get_frame_address_in_block (this_frame), &fs);
execute_cfa_program (fde, instr, fde->end, gdbarch,
get_frame_address_in_block (this_frame), &fs);
- TRY
+ try
{
/* Calculate the CFA. */
switch (fs.regs.cfa_how)
{
/* Calculate the CFA. */
switch (fs.regs.cfa_how)
@@
-1069,7
+1068,7
@@
dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
}
}
internal_error (__FILE__, __LINE__, _("Unknown CFA rule."));
}
}
-
CATCH (ex, RETURN_MASK_ERROR
)
+
catch (const gdb_exception_error &ex
)
{
if (ex.error == NOT_AVAILABLE_ERROR)
{
{
if (ex.error == NOT_AVAILABLE_ERROR)
{
@@
-1077,9
+1076,8
@@
dwarf2_frame_cache (struct frame_info *this_frame, void **this_cache)
return cache;
}
return cache;
}
- throw
_exception (ex)
;
+ throw;
}
}
- END_CATCH
/* Initialize the register state. */
{
/* Initialize the register state. */
{
@@
-1465,7
+1463,9
@@
dwarf2_frame_cfa (struct frame_info *this_frame)
return get_frame_base (this_frame);
}
\f
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)
static unsigned int
read_1_byte (bfd *abfd, const gdb_byte *buf)
@@
-1489,7
+1489,7
@@
static ULONGEST
read_initial_length (bfd *abfd, const gdb_byte *buf,
unsigned int *bytes_read_ptr)
{
read_initial_length (bfd *abfd, const gdb_byte *buf,
unsigned int *bytes_read_ptr)
{
- LONGEST result;
+
U
LONGEST result;
result = bfd_get_32 (abfd, buf);
if (result == 0xffffffff)
result = bfd_get_32 (abfd, buf);
if (result == 0xffffffff)
@@
-1703,22
+1703,18
@@
bsearch_fde_cmp (const void *key, const void *element)
static struct dwarf2_fde *
dwarf2_frame_find_fde (CORE_ADDR *pc, CORE_ADDR *out_offset)
{
static struct dwarf2_fde *
dwarf2_frame_find_fde (CORE_ADDR *pc, CORE_ADDR *out_offset)
{
- struct objfile *objfile;
-
- ALL_OBJFILES (objfile)
+ for (objfile *objfile : current_program_space->objfiles ())
{
struct dwarf2_fde_table *fde_table;
struct dwarf2_fde **p_fde;
CORE_ADDR offset;
CORE_ADDR seek_pc;
{
struct dwarf2_fde_table *fde_table;
struct dwarf2_fde **p_fde;
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);
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);
}
gdb_assert (fde_table != NULL);
@@
-1792,7
+1788,7
@@
decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
{
struct gdbarch *gdbarch = get_objfile_arch (unit->objfile);
const gdb_byte *buf, *end;
{
struct gdbarch *gdbarch = get_objfile_arch (unit->objfile);
const gdb_byte *buf, *end;
- LONGEST length;
+
U
LONGEST length;
unsigned int bytes_read;
int dwarf64_p;
ULONGEST cie_id;
unsigned int bytes_read;
int dwarf64_p;
ULONGEST cie_id;
@@
-1803,15
+1799,15
@@
decode_frame_entry_1 (struct comp_unit *unit, const gdb_byte *start,
buf = start;
length = read_initial_length (unit->abfd, buf, &bytes_read);
buf += bytes_read;
buf = start;
length = read_initial_length (unit->abfd, buf, &bytes_read);
buf += bytes_read;
- end = buf + length;
-
- /* Are we still within the section? */
- if (end > unit->dwarf_frame_buffer + unit->dwarf_frame_size)
- return NULL;
+ end = buf + (size_t) length;
if (length == 0)
return end;
if (length == 0)
return end;
+ /* Are we still within the section? */
+ if (end <= buf || end > unit->dwarf_frame_buffer + unit->dwarf_frame_size)
+ return NULL;
+
/* Distinguish between 32 and 64-bit encoded frame info. */
dwarf64_p = (bytes_read == 12);
/* Distinguish between 32 and 64-bit encoded frame info. */
dwarf64_p = (bytes_read == 12);
@@
-2248,7
+2244,7
@@
dwarf2_build_frame_info (struct objfile *objfile)
if (txt)
unit->tbase = txt->vma;
if (txt)
unit->tbase = txt->vma;
- TRY
+ try
{
frame_ptr = unit->dwarf_frame_buffer;
while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size)
{
frame_ptr = unit->dwarf_frame_buffer;
while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size)
@@
-2257,10
+2253,10
@@
dwarf2_build_frame_info (struct objfile *objfile)
EH_CIE_OR_FDE_TYPE_ID);
}
EH_CIE_OR_FDE_TYPE_ID);
}
-
CATCH (e, RETURN_MASK_ERROR
)
+
catch (const gdb_exception_error &e
)
{
warning (_("skipping .eh_frame info of %s: %s"),
{
warning (_("skipping .eh_frame info of %s: %s"),
- objfile_name (objfile), e.
message
);
+ objfile_name (objfile), e.
what ()
);
if (fde_table.num_entries != 0)
{
if (fde_table.num_entries != 0)
{
@@
-2270,7
+2266,6
@@
dwarf2_build_frame_info (struct objfile *objfile)
}
/* The cie_table is discarded by the next if. */
}
}
/* The cie_table is discarded by the next if. */
}
- END_CATCH
if (cie_table.num_entries != 0)
{
if (cie_table.num_entries != 0)
{
@@
-2290,7
+2285,7
@@
dwarf2_build_frame_info (struct objfile *objfile)
{
int num_old_fde_entries = fde_table.num_entries;
{
int num_old_fde_entries = fde_table.num_entries;
- TRY
+ try
{
frame_ptr = unit->dwarf_frame_buffer;
while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size)
{
frame_ptr = unit->dwarf_frame_buffer;
while (frame_ptr < unit->dwarf_frame_buffer + unit->dwarf_frame_size)
@@
-2298,10
+2293,10
@@
dwarf2_build_frame_info (struct objfile *objfile)
&cie_table, &fde_table,
EH_CIE_OR_FDE_TYPE_ID);
}
&cie_table, &fde_table,
EH_CIE_OR_FDE_TYPE_ID);
}
-
CATCH (e, RETURN_MASK_ERROR
)
+
catch (const gdb_exception_error &e
)
{
warning (_("skipping .debug_frame info of %s: %s"),
{
warning (_("skipping .debug_frame info of %s: %s"),
- objfile_name (objfile), e.
message
);
+ objfile_name (objfile), e.
what ()
);
if (fde_table.num_entries != 0)
{
if (fde_table.num_entries != 0)
{
@@
-2321,7
+2316,6
@@
dwarf2_build_frame_info (struct objfile *objfile)
fde_table.num_entries = num_old_fde_entries;
/* The cie_table is discarded by the next if. */
}
fde_table.num_entries = num_old_fde_entries;
/* The cie_table is discarded by the next if. */
}
- END_CATCH
}
/* Discard the cie_table, it is no longer needed. */
}
/* Discard the cie_table, it is no longer needed. */
@@
-2403,7
+2397,7
@@
dwarf2_build_frame_info (struct objfile *objfile)
xfree (fde_table.entries);
}
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'. */
}
/* Handle 'maintenance show dwarf unwinders'. */
@@
-2422,7
+2416,6
@@
void
_initialize_dwarf2_frame (void)
{
dwarf2_frame_data = gdbarch_data_register_pre_init (dwarf2_frame_init);
_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 , _("\
add_setshow_boolean_cmd ("unwinders", class_obscure,
&dwarf2_frame_unwinders_enabled_p , _("\
This page took
0.048416 seconds
and
4
git commands to generate.