diff options
author | Doug Evans <dje@google.com> | 2012-06-29 00:28:23 +0000 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2012-06-29 00:28:23 +0000 |
commit | 3b80fe9b7535a7619d0654ad73baacd910d4233e (patch) | |
tree | c10716bcc492f15f41b710630061464e15fc6863 | |
parent | 7f4c1aab46fd660bd0bf99b420b65dda25f10c50 (diff) | |
download | gdb-3b80fe9b7535a7619d0654ad73baacd910d4233e.zip gdb-3b80fe9b7535a7619d0654ad73baacd910d4233e.tar.gz gdb-3b80fe9b7535a7619d0654ad73baacd910d4233e.tar.bz2 |
* dwarf2read.c (dwarf2_find_base_address): Move definition.
-rw-r--r-- | gdb/ChangeLog | 2 | ||||
-rw-r--r-- | gdb/dwarf2read.c | 62 |
2 files changed, 33 insertions, 31 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 3a619ff..558fdea 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,7 @@ 2012-06-28 Doug Evans <dje@google.com> + * dwarf2read.c (dwarf2_find_base_address): Move definition. + * dwarf2read.c (ABBREV_HASH_SIZE): Remove enclosing #ifndef/#endif. (struct abbrev_table): Define. (dwarf2_cu): Replace members dwarf2_abbrevs, abbrev_obstack with diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 9dc763f..43f3537 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -3371,6 +3371,37 @@ offset_in_cu_p (const struct comp_unit_head *cu_header, sect_offset offset) return (offset.sect_off >= bottom.sect_off && offset.sect_off < top.sect_off); } +/* Find the base address of the compilation unit for range lists and + location lists. It will normally be specified by DW_AT_low_pc. + In DWARF-3 draft 4, the base address could be overridden by + DW_AT_entry_pc. It's been removed, but GCC still uses this for + compilation units with discontinuous ranges. */ + +static void +dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu) +{ + struct attribute *attr; + + cu->base_known = 0; + cu->base_address = 0; + + attr = dwarf2_attr (die, DW_AT_entry_pc, cu); + if (attr) + { + cu->base_address = DW_ADDR (attr); + cu->base_known = 1; + } + else + { + attr = dwarf2_attr (die, DW_AT_low_pc, cu); + if (attr) + { + cu->base_address = DW_ADDR (attr); + cu->base_known = 1; + } + } +} + /* Read in the comp unit header information from the debug_info at info_ptr. NOTE: This leaves members offset, first_die_offset to be filled in by the caller. */ @@ -3832,37 +3863,6 @@ init_cu_die_reader (struct die_reader_specs *reader, reader->buffer_end = section->buffer + section->size; } -/* Find the base address of the compilation unit for range lists and - location lists. It will normally be specified by DW_AT_low_pc. - In DWARF-3 draft 4, the base address could be overridden by - DW_AT_entry_pc. It's been removed, but GCC still uses this for - compilation units with discontinuous ranges. */ - -static void -dwarf2_find_base_address (struct die_info *die, struct dwarf2_cu *cu) -{ - struct attribute *attr; - - cu->base_known = 0; - cu->base_address = 0; - - attr = dwarf2_attr (die, DW_AT_entry_pc, cu); - if (attr) - { - cu->base_address = DW_ADDR (attr); - cu->base_known = 1; - } - else - { - attr = dwarf2_attr (die, DW_AT_low_pc, cu); - if (attr) - { - cu->base_address = DW_ADDR (attr); - cu->base_known = 1; - } - } -} - /* Initialize a CU (or TU) and read its DIEs. If the CU defers to a DWO file, read the DWO file as well. |