aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2/comp-unit.h
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-02-08 13:40:54 -0700
committerTom Tromey <tom@tromey.com>2020-02-08 13:43:24 -0700
commit8266302dc32a88c9e05b4e451e3c2c1516603132 (patch)
tree11332dff1c23623a3de7431ec7b1282bdb0772bb /gdb/dwarf2/comp-unit.h
parent4057dfde49d7867ad41906ed11705e450a08b4cf (diff)
downloadbinutils-8266302dc32a88c9e05b4e451e3c2c1516603132.zip
binutils-8266302dc32a88c9e05b4e451e3c2c1516603132.tar.gz
binutils-8266302dc32a88c9e05b4e451e3c2c1516603132.tar.bz2
Convert read_offset to method on comp_unit_head
This changes one of the read_offset overloads to be a method on comp_unit_head. 2020-02-08 Tom Tromey <tom@tromey.com> * dwarf2/read.c (read_attribute_value, read_indirect_string) (read_indirect_line_string): Update. * dwarf2/comp-unit.c (read_offset): Remove. (read_comp_unit_head): Update. * dwarf2/comp-unit.h (struct comp_unit_head) <read_offset>: New method. (read_offset): Don't declare. Change-Id: Ia595702a5748337b7c031352bc437956baab9990
Diffstat (limited to 'gdb/dwarf2/comp-unit.h')
-rw-r--r--gdb/dwarf2/comp-unit.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/gdb/dwarf2/comp-unit.h b/gdb/dwarf2/comp-unit.h
index b4483ac..e61b100 100644
--- a/gdb/dwarf2/comp-unit.h
+++ b/gdb/dwarf2/comp-unit.h
@@ -27,6 +27,7 @@
#ifndef GDB_DWARF2_COMP_UNIT_H
#define GDB_DWARF2_COMP_UNIT_H
+#include "dwarf2/leb.h"
#include "gdbtypes.h"
/* The data in a compilation unit header, after target2host
@@ -78,6 +79,16 @@ struct comp_unit_head
sect_offset top = sect_off + get_length ();
return off >= bottom && off < top;
}
+
+ /* Read an offset from the data stream. The size of the offset is
+ given by cu_header->offset_size. */
+ LONGEST read_offset (bfd *abfd, const gdb_byte *buf,
+ unsigned int *bytes_read) const
+ {
+ LONGEST offset = ::read_offset (abfd, buf, offset_size);
+ *bytes_read = offset_size;
+ return offset;
+ }
};
/* Expected enum dwarf_unit_type for read_comp_unit_head. */
@@ -104,11 +115,4 @@ extern const gdb_byte *read_and_check_comp_unit_head
const gdb_byte *info_ptr,
rcuh_kind section_kind);
-/* Read an offset from the data stream. The size of the offset is
- given by cu_header->offset_size. */
-
-extern LONGEST read_offset (bfd *abfd, const gdb_byte *buf,
- const struct comp_unit_head *cu_header,
- unsigned int *bytes_read);
-
#endif /* GDB_DWARF2_COMP_UNIT_H */