mirror of
https://github.com/darlinghq/darling-gdb.git
synced 2024-12-04 02:02:22 +00:00
* dwarf2read.c (comp_unit_head): Rename first_die_ptr to
first_die_offset. All uses updated. Delete unused members cu_head_ptr, next. Move members base_known, base_address to ... (dwarf2_cu) ... here. All uses updated.
This commit is contained in:
parent
51add5c3c0
commit
d00adf3917
@ -1,3 +1,11 @@
|
|||||||
|
2008-09-12 Doug Evans <dje@google.com>
|
||||||
|
|
||||||
|
* dwarf2read.c (comp_unit_head): Rename first_die_ptr to
|
||||||
|
first_die_offset. All uses updated.
|
||||||
|
Delete unused members cu_head_ptr, next.
|
||||||
|
Move members base_known, base_address to ...
|
||||||
|
(dwarf2_cu) ... here. All uses updated.
|
||||||
|
|
||||||
2008-09-12 Pedro Alves <pedro@codesourcery.com>
|
2008-09-12 Pedro Alves <pedro@codesourcery.com>
|
||||||
|
|
||||||
* Makefile.in (generated_files): Add $(NAT_GENERATED_FILES).
|
* Makefile.in (generated_files): Add $(NAT_GENERATED_FILES).
|
||||||
|
@ -247,22 +247,9 @@ struct comp_unit_head
|
|||||||
.debug_info section, for resolving relative reference dies. */
|
.debug_info section, for resolving relative reference dies. */
|
||||||
unsigned int offset;
|
unsigned int offset;
|
||||||
|
|
||||||
/* Pointer to this compilation unit header in the .debug_info
|
/* Offset to first die in this cu from the start of the cu.
|
||||||
section. */
|
This will be the first byte following the compilation unit header. */
|
||||||
gdb_byte *cu_head_ptr;
|
unsigned int first_die_offset;
|
||||||
|
|
||||||
/* Pointer to the first die of this compilation unit. This will be
|
|
||||||
the first byte following the compilation unit header. */
|
|
||||||
gdb_byte *first_die_ptr;
|
|
||||||
|
|
||||||
/* Pointer to the next compilation unit header in the program. */
|
|
||||||
struct comp_unit_head *next;
|
|
||||||
|
|
||||||
/* Base address of this compilation unit. */
|
|
||||||
CORE_ADDR base_address;
|
|
||||||
|
|
||||||
/* Non-zero if base_address has been set. */
|
|
||||||
int base_known;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Internal state when decoding a particular compilation unit. */
|
/* Internal state when decoding a particular compilation unit. */
|
||||||
@ -271,12 +258,15 @@ struct dwarf2_cu
|
|||||||
/* The objfile containing this compilation unit. */
|
/* The objfile containing this compilation unit. */
|
||||||
struct objfile *objfile;
|
struct objfile *objfile;
|
||||||
|
|
||||||
/* The header of the compilation unit.
|
/* The header of the compilation unit. */
|
||||||
|
|
||||||
FIXME drow/2003-11-10: Some of the things from the comp_unit_head
|
|
||||||
should logically be moved to the dwarf2_cu structure. */
|
|
||||||
struct comp_unit_head header;
|
struct comp_unit_head header;
|
||||||
|
|
||||||
|
/* Base address of this compilation unit. */
|
||||||
|
CORE_ADDR base_address;
|
||||||
|
|
||||||
|
/* Non-zero if base_address has been set. */
|
||||||
|
int base_known;
|
||||||
|
|
||||||
struct function_range *first_fn, *last_fn, *cached_fn;
|
struct function_range *first_fn, *last_fn, *cached_fn;
|
||||||
|
|
||||||
/* The language we are debugging. */
|
/* The language we are debugging. */
|
||||||
@ -1493,8 +1483,7 @@ dwarf2_build_psymtabs_hard (struct objfile *objfile, int mainline)
|
|||||||
|
|
||||||
/* Complete the cu_header */
|
/* Complete the cu_header */
|
||||||
cu.header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer;
|
cu.header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer;
|
||||||
cu.header.first_die_ptr = info_ptr;
|
cu.header.first_die_offset = info_ptr - beg_of_comp_unit;
|
||||||
cu.header.cu_head_ptr = beg_of_comp_unit;
|
|
||||||
|
|
||||||
cu.list_in_scope = &file_symbols;
|
cu.list_in_scope = &file_symbols;
|
||||||
|
|
||||||
@ -1660,8 +1649,7 @@ load_comp_unit (struct dwarf2_per_cu_data *this_cu, struct objfile *objfile)
|
|||||||
|
|
||||||
/* Complete the cu_header. */
|
/* Complete the cu_header. */
|
||||||
cu->header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer;
|
cu->header.offset = beg_of_comp_unit - dwarf2_per_objfile->info_buffer;
|
||||||
cu->header.first_die_ptr = info_ptr;
|
cu->header.first_die_offset = info_ptr - beg_of_comp_unit;
|
||||||
cu->header.cu_head_ptr = beg_of_comp_unit;
|
|
||||||
|
|
||||||
/* Read the abbrevs for this compilation unit into a table. */
|
/* Read the abbrevs for this compilation unit into a table. */
|
||||||
dwarf2_read_abbrevs (abfd, cu);
|
dwarf2_read_abbrevs (abfd, cu);
|
||||||
@ -2649,22 +2637,22 @@ process_full_comp_unit (struct dwarf2_per_cu_data *per_cu)
|
|||||||
DW_AT_entry_pc. It's been removed, but GCC still uses this for
|
DW_AT_entry_pc. It's been removed, but GCC still uses this for
|
||||||
compilation units with discontinuous ranges. */
|
compilation units with discontinuous ranges. */
|
||||||
|
|
||||||
cu->header.base_known = 0;
|
cu->base_known = 0;
|
||||||
cu->header.base_address = 0;
|
cu->base_address = 0;
|
||||||
|
|
||||||
attr = dwarf2_attr (cu->dies, DW_AT_entry_pc, cu);
|
attr = dwarf2_attr (cu->dies, DW_AT_entry_pc, cu);
|
||||||
if (attr)
|
if (attr)
|
||||||
{
|
{
|
||||||
cu->header.base_address = DW_ADDR (attr);
|
cu->base_address = DW_ADDR (attr);
|
||||||
cu->header.base_known = 1;
|
cu->base_known = 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
attr = dwarf2_attr (cu->dies, DW_AT_low_pc, cu);
|
attr = dwarf2_attr (cu->dies, DW_AT_low_pc, cu);
|
||||||
if (attr)
|
if (attr)
|
||||||
{
|
{
|
||||||
cu->header.base_address = DW_ADDR (attr);
|
cu->base_address = DW_ADDR (attr);
|
||||||
cu->header.base_known = 1;
|
cu->base_known = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3132,8 +3120,8 @@ dwarf2_ranges_read (unsigned offset, CORE_ADDR *low_return,
|
|||||||
CORE_ADDR high = 0;
|
CORE_ADDR high = 0;
|
||||||
CORE_ADDR baseaddr;
|
CORE_ADDR baseaddr;
|
||||||
|
|
||||||
found_base = cu_header->base_known;
|
found_base = cu->base_known;
|
||||||
base = cu_header->base_address;
|
base = cu->base_address;
|
||||||
|
|
||||||
if (offset >= dwarf2_per_objfile->ranges_size)
|
if (offset >= dwarf2_per_objfile->ranges_size)
|
||||||
{
|
{
|
||||||
@ -3400,8 +3388,8 @@ dwarf2_record_block_ranges (struct die_info *die, struct block *block,
|
|||||||
'baseaddr' argument, which GDB uses to relocate debugging
|
'baseaddr' argument, which GDB uses to relocate debugging
|
||||||
information from a shared library based on the address at
|
information from a shared library based on the address at
|
||||||
which the library was loaded. */
|
which the library was loaded. */
|
||||||
CORE_ADDR base = cu->header.base_address;
|
CORE_ADDR base = cu->base_address;
|
||||||
int base_known = cu->header.base_known;
|
int base_known = cu->base_known;
|
||||||
|
|
||||||
if (offset >= dwarf2_per_objfile->ranges_size)
|
if (offset >= dwarf2_per_objfile->ranges_size)
|
||||||
{
|
{
|
||||||
@ -5886,11 +5874,11 @@ read_partial_die (struct partial_die_info *part_die,
|
|||||||
|| dwarf2_per_objfile->has_section_at_zero))
|
|| dwarf2_per_objfile->has_section_at_zero))
|
||||||
part_die->has_pc_info = 1;
|
part_die->has_pc_info = 1;
|
||||||
|
|
||||||
if (base_address_type != base_address_none && !cu->header.base_known)
|
if (base_address_type != base_address_none && !cu->base_known)
|
||||||
{
|
{
|
||||||
gdb_assert (part_die->tag == DW_TAG_compile_unit);
|
gdb_assert (part_die->tag == DW_TAG_compile_unit);
|
||||||
cu->header.base_known = 1;
|
cu->base_known = 1;
|
||||||
cu->header.base_address = base_address;
|
cu->base_address = base_address;
|
||||||
}
|
}
|
||||||
|
|
||||||
return info_ptr;
|
return info_ptr;
|
||||||
@ -5955,7 +5943,9 @@ find_partial_die (unsigned long offset, struct dwarf2_cu *cu)
|
|||||||
dwarf2_read_abbrevs (per_cu->cu->objfile->obfd, per_cu->cu);
|
dwarf2_read_abbrevs (per_cu->cu->objfile->obfd, per_cu->cu);
|
||||||
back_to = make_cleanup (dwarf2_free_abbrev_table, per_cu->cu);
|
back_to = make_cleanup (dwarf2_free_abbrev_table, per_cu->cu);
|
||||||
}
|
}
|
||||||
info_ptr = per_cu->cu->header.first_die_ptr;
|
info_ptr = (dwarf2_per_objfile->info_buffer
|
||||||
|
+ per_cu->cu->header.offset
|
||||||
|
+ per_cu->cu->header.first_die_offset);
|
||||||
abbrev = peek_die_abbrev (info_ptr, &bytes_read, per_cu->cu);
|
abbrev = peek_die_abbrev (info_ptr, &bytes_read, per_cu->cu);
|
||||||
info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read,
|
info_ptr = read_partial_die (&comp_unit_die, abbrev, bytes_read,
|
||||||
per_cu->cu->objfile->obfd, info_ptr,
|
per_cu->cu->objfile->obfd, info_ptr,
|
||||||
@ -9916,8 +9906,8 @@ dwarf2_symbol_mark_computed (struct attribute *attr, struct symbol *sym,
|
|||||||
don't run off the edge of the section. */
|
don't run off the edge of the section. */
|
||||||
baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr);
|
baton->size = dwarf2_per_objfile->loc_size - DW_UNSND (attr);
|
||||||
baton->data = dwarf2_per_objfile->loc_buffer + DW_UNSND (attr);
|
baton->data = dwarf2_per_objfile->loc_buffer + DW_UNSND (attr);
|
||||||
baton->base_address = cu->header.base_address;
|
baton->base_address = cu->base_address;
|
||||||
if (cu->header.base_known == 0)
|
if (cu->base_known == 0)
|
||||||
complaint (&symfile_complaints,
|
complaint (&symfile_complaints,
|
||||||
_("Location list used without specifying the CU base address."));
|
_("Location list used without specifying the CU base address."));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user