aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2')
-rw-r--r--gdb/dwarf2/aranges.c10
-rw-r--r--gdb/dwarf2/read.c10
-rw-r--r--gdb/dwarf2/read.h2
3 files changed, 14 insertions, 8 deletions
diff --git a/gdb/dwarf2/aranges.c b/gdb/dwarf2/aranges.c
index 7016eee..ac530ab 100644
--- a/gdb/dwarf2/aranges.c
+++ b/gdb/dwarf2/aranges.c
@@ -59,6 +59,7 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
gdb::unordered_set<sect_offset> debug_info_offset_seen;
const bfd_endian dwarf5_byte_order = gdbarch_byte_order (gdbarch);
+ const int signed_addr_p = bfd_get_sign_extend_vma (abfd);
const gdb_byte *addr = section->buffer;
while (addr < section->buffer + section->size)
{
@@ -167,8 +168,13 @@ read_addrmap_from_aranges (dwarf2_per_objfile *per_objfile,
plongest (entry_addr - section->buffer));
return false;
}
- ULONGEST start = extract_unsigned_integer (addr, address_size,
- dwarf5_byte_order);
+ ULONGEST start;
+ if (signed_addr_p)
+ start = extract_signed_integer (addr, address_size,
+ dwarf5_byte_order);
+ else
+ start = extract_unsigned_integer (addr, address_size,
+ dwarf5_byte_order);
addr += address_size;
ULONGEST length = extract_unsigned_integer (addr, address_size,
dwarf5_byte_order);
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index 17f06ff..71fd352 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -2970,7 +2970,7 @@ cutu_reader::cutu_reader (dwarf2_per_cu &this_cu,
dwarf2_cu *existing_cu,
bool skip_partial,
enum language pretend_language,
- const abbrev_table_cache *cache)
+ const abbrev_table_cache *abbrev_cache)
{
struct objfile *objfile = per_objfile.objfile;
struct dwarf2_section_info *section = this_cu.section;
@@ -3030,7 +3030,7 @@ cutu_reader::cutu_reader (dwarf2_per_cu &this_cu,
indexer. This assert is avoided in this case because (1) it
is irrelevant, and (2) the get_cu method is not
thread-safe. */
- gdb_assert (cache != nullptr
+ gdb_assert (abbrev_cache != nullptr
|| per_objfile.get_cu (&this_cu) == nullptr);
m_new_cu = std::make_unique<dwarf2_cu> (&this_cu, &per_objfile);
cu = m_new_cu.get ();
@@ -3092,9 +3092,9 @@ cutu_reader::cutu_reader (dwarf2_per_cu &this_cu,
gdb_assert (cu->header.abbrev_sect_off == abbrev_table->sect_off);
else
{
- if (cache != nullptr)
- abbrev_table = cache->find (abbrev_section,
- cu->header.abbrev_sect_off);
+ if (abbrev_cache != nullptr)
+ abbrev_table = abbrev_cache->find (abbrev_section,
+ cu->header.abbrev_sect_off);
if (abbrev_table == nullptr)
{
abbrev_section->read (objfile);
diff --git a/gdb/dwarf2/read.h b/gdb/dwarf2/read.h
index 7f56dac..b13e42d 100644
--- a/gdb/dwarf2/read.h
+++ b/gdb/dwarf2/read.h
@@ -927,7 +927,7 @@ public:
dwarf2_cu *existing_cu,
bool skip_partial,
enum language pretend_language,
- const abbrev_table_cache *cache = nullptr);
+ const abbrev_table_cache *abbrev_cache = nullptr);
cutu_reader (dwarf2_per_cu &this_cu,
dwarf2_per_objfile &per_objfile,