+2020-02-08 Tom Tromey <tom@tromey.com>
+
+ * dwarf2/loc.c (dwarf2_find_location_expression)
+ (dwarf_evaluate_loc_desc::get_tls_address)
+ (dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value)
+ (rw_pieced_value, dwarf2_evaluate_loc_desc_full)
+ (dwarf2_locexpr_baton_eval, dwarf2_evaluate_property)
+ (dwarf2_compile_property_to_c)
+ (dwarf2_loc_desc_get_symbol_read_needs)
+ (dwarf2_compile_expr_to_ax, locexpr_describe_location)
+ (locexpr_tracepoint_var_ref, locexpr_generate_c_location)
+ (loclist_describe_location, loclist_tracepoint_var_ref)
+ (loclist_generate_c_location): Update.
+ * compile/compile-loc2c.c (do_compile_dwarf_expr_to_c): Update.
+ * dwarf2/loc.h (dwarf2_per_cu_objfile, dwarf2_per_cu_addr_size)
+ (dwarf2_per_cu_ref_addr_size, dwarf2_per_cu_offset_size)
+ (dwarf2_per_cu_text_offset, dwarf2_version): Don't declare.
+ * dwarf2/read.c (dwarf2_per_cu_data::objfile)
+ (dwarf2_per_cu_data::addr_size)
+ (dwarf2_per_cu_data::ref_addr_size)
+ (dwarf2_per_cu_data::text_offset)
+ (dwarf2_per_cu_data::addr_type): Now methods.
+ (per_cu_header_read_in): Make per_cu "const".
+ (dwarf2_version): Remove.
+ (dwarf2_per_cu_data::int_type): Now a method.
+ (dwarf2_per_cu_data::_addr_sized_int_type): Likewise.
+ (set_die_type, read_array_type, read_subrange_index_type)
+ (read_tag_string_type, read_subrange_type): Update.
+ * dwarf2/read.h (struct dwarf2_per_cu_data) <addr_size,
+ offset_size, ref_addr_size, text_offset, addr_type, version,
+ objfile, int_type, addr_sized_int_type>: Declare methods.
+
2020-02-08 Tom Tromey <tom@tromey.com>
* dwarf2/read.h (struct dwarf2_per_cu_data) <imported_symtabs>:
#include "dwarf2.h"
#include "dwarf2/expr.h"
#include "dwarf2/loc.h"
+#include "dwarf2/read.h"
#include "ui-file.h"
#include "utils.h"
#include "compile-internal.h"
index, not an address. We don't support things like
branching between the address and the TLS op. */
if (op_ptr >= op_end || *op_ptr != DW_OP_GNU_push_tls_address)
- uoffset += dwarf2_per_cu_text_offset (per_cu);
+ uoffset += per_cu->text_offset ();
push (indent, stream, uoffset);
break;
dwarf2_find_location_expression (struct dwarf2_loclist_baton *baton,
size_t *locexpr_length, CORE_ADDR pc)
{
- struct objfile *objfile = dwarf2_per_cu_objfile (baton->per_cu);
+ struct objfile *objfile = baton->per_cu->objfile ();
struct gdbarch *gdbarch = get_objfile_arch (objfile);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- unsigned int addr_size = dwarf2_per_cu_addr_size (baton->per_cu);
+ unsigned int addr_size = baton->per_cu->addr_size ();
int signed_addr_p = bfd_get_sign_extend_vma (objfile->obfd);
/* Adjust base_address for relocatable objects. */
- CORE_ADDR base_offset = dwarf2_per_cu_text_offset (baton->per_cu);
+ CORE_ADDR base_offset = baton->per_cu->text_offset ();
CORE_ADDR base_address = baton->base_address + base_offset;
const gdb_byte *loc_ptr, *buf_end;
kind = decode_debug_loc_dwo_addresses (baton->per_cu,
loc_ptr, buf_end, &new_ptr,
&low, &high, byte_order);
- else if (dwarf2_version (baton->per_cu) < 5)
+ else if (baton->per_cu->version () < 5)
kind = decode_debug_loc_addresses (loc_ptr, buf_end, &new_ptr,
&low, &high,
byte_order, addr_size,
high += base_address;
}
- if (dwarf2_version (baton->per_cu) < 5)
+ if (baton->per_cu->version () < 5)
{
length = extract_unsigned_integer (loc_ptr, 2, byte_order);
loc_ptr += 2;
current thread's thread-local storage with offset OFFSET. */
CORE_ADDR get_tls_address (CORE_ADDR offset) override
{
- struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
+ struct objfile *objfile = per_cu->objfile ();
return target_translate_tls_address (objfile, offset);
}
(CORE_ADDR) 0);
scoped_restore save_arch = make_scoped_restore (&this->gdbarch);
- this->gdbarch
- = get_objfile_arch (dwarf2_per_cu_objfile (per_cu));
+ this->gdbarch = get_objfile_arch (per_cu->objfile ());
scoped_restore save_addr_size = make_scoped_restore (&this->addr_size);
- this->addr_size = dwarf2_per_cu_addr_size (per_cu);
+ this->addr_size = per_cu->addr_size ();
scoped_restore save_offset = make_scoped_restore (&this->offset);
- this->offset = dwarf2_per_cu_text_offset (per_cu);
+ this->offset = per_cu->text_offset ();
this->eval (data_src, size);
}
break;
}
- struct objfile *objfile = dwarf2_per_cu_objfile (c->per_cu);
+ struct objfile *objfile = c->per_cu->objfile ();
struct gdbarch *objfile_gdbarch = get_objfile_arch (objfile);
ULONGEST stack_value_size_bits
= 8 * TYPE_LENGTH (value_type (p->v.value));
LONGEST subobj_byte_offset)
{
struct value *retval;
- struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
+ struct objfile *objfile = per_cu->objfile ();
if (subobj_type == NULL)
{
scoped_value_mark free_values;
ctx.gdbarch = get_objfile_arch (objfile);
- ctx.addr_size = dwarf2_per_cu_addr_size (per_cu);
- ctx.ref_addr_size = dwarf2_per_cu_ref_addr_size (per_cu);
- ctx.offset = dwarf2_per_cu_text_offset (per_cu);
+ ctx.addr_size = per_cu->addr_size ();
+ ctx.ref_addr_size = per_cu->ref_addr_size ();
+ ctx.offset = per_cu->text_offset ();
try
{
ctx.per_cu = dlbaton->per_cu;
ctx.obj_address = addr;
- objfile = dwarf2_per_cu_objfile (dlbaton->per_cu);
+ objfile = dlbaton->per_cu->objfile ();
ctx.gdbarch = get_objfile_arch (objfile);
- ctx.addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
- ctx.ref_addr_size = dwarf2_per_cu_ref_addr_size (dlbaton->per_cu);
- ctx.offset = dwarf2_per_cu_text_offset (dlbaton->per_cu);
+ ctx.addr_size = dlbaton->per_cu->addr_size ();
+ ctx.ref_addr_size = dlbaton->per_cu->ref_addr_size ();
+ ctx.offset = dlbaton->per_cu->text_offset ();
try
{
CORE_ADDR on 64bit machine has 8 bytes but address
size of an 32bit application is bytes. */
const int addr_size
- = (dwarf2_per_cu_addr_size (baton->locexpr.per_cu)
+ = (baton->locexpr.per_cu->addr_size ()
* TARGET_CHAR_BIT);
const CORE_ADDR neg_mask
= (~((CORE_ADDR) 0) << (addr_size - 1));
compile_dwarf_bounds_to_c (stream, result_name, prop, sym, pc,
gdbarch, registers_used,
- dwarf2_per_cu_addr_size (per_cu),
+ per_cu->addr_size (),
data, data + size, per_cu);
}
struct dwarf2_per_cu_data *per_cu)
{
int in_reg;
- struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
+ struct objfile *objfile = per_cu->objfile ();
scoped_value_mark free_values;
ctx.needs = SYMBOL_NEEDS_NONE;
ctx.per_cu = per_cu;
ctx.gdbarch = get_objfile_arch (objfile);
- ctx.addr_size = dwarf2_per_cu_addr_size (per_cu);
- ctx.ref_addr_size = dwarf2_per_cu_ref_addr_size (per_cu);
- ctx.offset = dwarf2_per_cu_text_offset (per_cu);
+ ctx.addr_size = per_cu->addr_size ();
+ ctx.ref_addr_size = per_cu->ref_addr_size ();
+ ctx.offset = per_cu->text_offset ();
ctx.eval (data, size);
index, not an address. We don't support things like
branching between the address and the TLS op. */
if (op_ptr >= op_end || *op_ptr != DW_OP_GNU_push_tls_address)
- uoffset += dwarf2_per_cu_text_offset (per_cu);
+ uoffset += per_cu->text_offset ();
ax_const_l (expr, uoffset);
break;
{
struct dwarf2_locexpr_baton *dlbaton
= (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol);
- struct objfile *objfile = dwarf2_per_cu_objfile (dlbaton->per_cu);
- unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
- int offset_size = dwarf2_per_cu_offset_size (dlbaton->per_cu);
+ struct objfile *objfile = dlbaton->per_cu->objfile ();
+ unsigned int addr_size = dlbaton->per_cu->addr_size ();
+ int offset_size = dlbaton->per_cu->offset_size ();
locexpr_describe_location_1 (symbol, addr, stream,
dlbaton->data, dlbaton->size,
{
struct dwarf2_locexpr_baton *dlbaton
= (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (symbol);
- unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
+ unsigned int addr_size = dlbaton->per_cu->addr_size ();
if (dlbaton->size == 0)
value->optimized_out = 1;
{
struct dwarf2_locexpr_baton *dlbaton
= (struct dwarf2_locexpr_baton *) SYMBOL_LOCATION_BATON (sym);
- unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
+ unsigned int addr_size = dlbaton->per_cu->addr_size ();
if (dlbaton->size == 0)
error (_("symbol \"%s\" is optimized out"), sym->natural_name ());
struct dwarf2_loclist_baton *dlbaton
= (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (symbol);
const gdb_byte *loc_ptr, *buf_end;
- struct objfile *objfile = dwarf2_per_cu_objfile (dlbaton->per_cu);
+ struct objfile *objfile = dlbaton->per_cu->objfile ();
struct gdbarch *gdbarch = get_objfile_arch (objfile);
enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
- unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
- int offset_size = dwarf2_per_cu_offset_size (dlbaton->per_cu);
+ unsigned int addr_size = dlbaton->per_cu->addr_size ();
+ int offset_size = dlbaton->per_cu->offset_size ();
int signed_addr_p = bfd_get_sign_extend_vma (objfile->obfd);
/* Adjust base_address for relocatable objects. */
- CORE_ADDR base_offset = dwarf2_per_cu_text_offset (dlbaton->per_cu);
+ CORE_ADDR base_offset = dlbaton->per_cu->text_offset ();
CORE_ADDR base_address = dlbaton->base_address + base_offset;
int done = 0;
= (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (symbol);
const gdb_byte *data;
size_t size;
- unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
+ unsigned int addr_size = dlbaton->per_cu->addr_size ();
data = dwarf2_find_location_expression (dlbaton, &size, ax->scope);
if (size == 0)
{
struct dwarf2_loclist_baton *dlbaton
= (struct dwarf2_loclist_baton *) SYMBOL_LOCATION_BATON (sym);
- unsigned int addr_size = dwarf2_per_cu_addr_size (dlbaton->per_cu);
+ unsigned int addr_size = dlbaton->per_cu->addr_size ();
const gdb_byte *data;
size_t size;
/* `set debug entry-values' setting. */
extern unsigned int entry_values_debug;
-/* Return the OBJFILE associated with the compilation unit CU. If CU
- came from a separate debuginfo file, then the master objfile is
- returned. */
-struct objfile *dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *cu);
-
-/* Return the address size given in the compilation unit header for CU. */
-int dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *cu);
-
-/* Return the DW_FORM_ref_addr size given in the compilation unit header for
- CU. */
-int dwarf2_per_cu_ref_addr_size (struct dwarf2_per_cu_data *cu);
-
-/* Return the offset size given in the compilation unit header for CU. */
-int dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *cu);
-
-/* Return the text offset of the CU. The returned offset comes from
- this CU's objfile. If this objfile came from a separate debuginfo
- file, then the offset may be different from the corresponding
- offset in the parent objfile. */
-CORE_ADDR dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *cu);
-
-short dwarf2_version (struct dwarf2_per_cu_data *per_cu);
-
/* Find a particular location expression from a location list. */
const gdb_byte *dwarf2_find_location_expression
(struct dwarf2_loclist_baton *baton,
static void process_queue (struct dwarf2_per_objfile *dwarf2_per_objfile);
-static struct type *dwarf2_per_cu_addr_type (struct dwarf2_per_cu_data *per_cu);
-static struct type *dwarf2_per_cu_addr_sized_int_type
- (struct dwarf2_per_cu_data *per_cu, bool unsigned_p);
-static struct type *dwarf2_per_cu_int_type
- (struct dwarf2_per_cu_data *per_cu, int size_in_bytes,
- bool unsigned_p);
-
/* Class, the destructor of which frees all allocated queue entries. This
will only have work to do if an error was thrown while processing the
dwarf. If no error was thrown then the queue entries should have all
newobj->static_link
= XOBNEW (&objfile->objfile_obstack, struct dynamic_prop);
attr_to_dynamic_prop (attr, die, cu, newobj->static_link,
- dwarf2_per_cu_addr_type (cu->per_cu));
+ cu->per_cu->addr_type ());
}
cu->list_in_scope = cu->get_builder ()->get_local_symbols ();
if (attr != NULL)
{
int stride_ok;
- struct type *prop_type
- = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ struct type *prop_type = cu->per_cu->addr_sized_int_type (false);
byte_stride_prop
= (struct dynamic_prop *) alloca (sizeof (struct dynamic_prop));
/* Pass 0 as the default as we know this attribute is constant
and the default value will not be returned. */
LONGEST sz = dwarf2_get_attr_constant_value (len, 0);
- prop_type = dwarf2_per_cu_int_type (cu->per_cu, sz, true);
+ prop_type = cu->per_cu->int_type (sz, true);
}
else
{
/* If the size is not specified then we assume it is the size of
an address on this target. */
- prop_type = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, true);
+ prop_type = cu->per_cu->addr_sized_int_type (true);
}
/* Convert the attribute into a dynamic property. */
return 1;
}
-/* Find an integer type SIZE_IN_BYTES bytes in size and return it.
- UNSIGNED_P controls if the integer is unsigned or not. */
+/* See read.h. */
-static struct type *
-dwarf2_per_cu_int_type (struct dwarf2_per_cu_data *per_cu,
- int size_in_bytes, bool unsigned_p)
+struct type *
+dwarf2_per_cu_data::int_type (int size_in_bytes, bool unsigned_p) const
{
- struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = dwarf2_per_objfile->objfile;
struct type *int_type;
/* Helper macro to examine the various builtin types. */
gdb_assert_not_reached ("unable to find suitable integer type");
}
-/* Find an integer type the same size as the address size given in the
- compilation unit header for PER_CU. UNSIGNED_P controls if the integer
- is unsigned or not. */
+/* See read.h. */
-static struct type *
-dwarf2_per_cu_addr_sized_int_type (struct dwarf2_per_cu_data *per_cu,
- bool unsigned_p)
+struct type *
+dwarf2_per_cu_data::addr_sized_int_type (bool unsigned_p) const
{
- int addr_size = dwarf2_per_cu_addr_size (per_cu);
- return dwarf2_per_cu_int_type (per_cu, addr_size, unsigned_p);
+ int addr_size = this->addr_size ();
+ return int_type (addr_size, unsigned_p);
}
/* Read the DW_AT_type attribute for a sub-range. If this attribute is not
FIXME: muller/2010-05-28: Possible references to object for low bound,
high bound or count are not yet handled by this code. */
if (TYPE_CODE (index_type) == TYPE_CODE_VOID)
- index_type = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ index_type = cu->per_cu->addr_sized_int_type (false);
return index_type;
}
attribute *attr_byte_stride = dwarf2_attr (die, DW_AT_byte_stride, cu);
if (attr_byte_stride != nullptr)
{
- struct type *prop_type
- = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ struct type *prop_type = cu->per_cu->addr_sized_int_type (false);
attr_to_dynamic_prop (attr_byte_stride, die, cu, &byte_stride_prop,
prop_type);
}
}
else
{
- struct type *prop_type
- = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ struct type *prop_type = cu->per_cu->addr_sized_int_type (false);
attr_to_dynamic_prop (attr_bit_stride, die, cu, &bit_stride_prop,
prop_type);
}
}
}
-/* Return the OBJFILE associated with the compilation unit CU. If CU
- came from a separate debuginfo file, then the master objfile is
- returned. */
+/* See read.h. */
struct objfile *
-dwarf2_per_cu_objfile (struct dwarf2_per_cu_data *per_cu)
+dwarf2_per_cu_data::objfile () const
{
- struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = dwarf2_per_objfile->objfile;
/* Return the master objfile, so that we can report and look up the
correct file containing this variable. */
static const struct comp_unit_head *
per_cu_header_read_in (struct comp_unit_head *cu_headerp,
- struct dwarf2_per_cu_data *per_cu)
+ const struct dwarf2_per_cu_data *per_cu)
{
const gdb_byte *info_ptr;
return cu_headerp;
}
-/* Return the address size given in the compilation unit header for CU. */
+/* See read.h. */
int
-dwarf2_per_cu_addr_size (struct dwarf2_per_cu_data *per_cu)
+dwarf2_per_cu_data::addr_size () const
{
struct comp_unit_head cu_header_local;
const struct comp_unit_head *cu_headerp;
- cu_headerp = per_cu_header_read_in (&cu_header_local, per_cu);
+ cu_headerp = per_cu_header_read_in (&cu_header_local, this);
return cu_headerp->addr_size;
}
-/* Return the offset size given in the compilation unit header for CU. */
+/* See read.h. */
int
-dwarf2_per_cu_offset_size (struct dwarf2_per_cu_data *per_cu)
+dwarf2_per_cu_data::offset_size () const
{
struct comp_unit_head cu_header_local;
const struct comp_unit_head *cu_headerp;
- cu_headerp = per_cu_header_read_in (&cu_header_local, per_cu);
+ cu_headerp = per_cu_header_read_in (&cu_header_local, this);
return cu_headerp->offset_size;
}
-/* See its dwarf2loc.h declaration. */
+/* See read.h. */
int
-dwarf2_per_cu_ref_addr_size (struct dwarf2_per_cu_data *per_cu)
+dwarf2_per_cu_data::ref_addr_size () const
{
struct comp_unit_head cu_header_local;
const struct comp_unit_head *cu_headerp;
- cu_headerp = per_cu_header_read_in (&cu_header_local, per_cu);
+ cu_headerp = per_cu_header_read_in (&cu_header_local, this);
if (cu_headerp->version == 2)
return cu_headerp->addr_size;
return cu_headerp->offset_size;
}
-/* Return the text offset of the CU. The returned offset comes from
- this CU's objfile. If this objfile came from a separate debuginfo
- file, then the offset may be different from the corresponding
- offset in the parent objfile. */
+/* See read.h. */
CORE_ADDR
-dwarf2_per_cu_text_offset (struct dwarf2_per_cu_data *per_cu)
+dwarf2_per_cu_data::text_offset () const
{
- return per_cu->dwarf2_per_objfile->objfile->text_section_offset ();
+ struct objfile *objfile = dwarf2_per_objfile->objfile;
+
+ return objfile->text_section_offset ();
}
-/* Return a type that is a generic pointer type, the size of which matches
- the address size given in the compilation unit header for PER_CU. */
-static struct type *
-dwarf2_per_cu_addr_type (struct dwarf2_per_cu_data *per_cu)
+/* See read.h. */
+
+struct type *
+dwarf2_per_cu_data::addr_type () const
{
- struct objfile *objfile = per_cu->dwarf2_per_objfile->objfile;
+ struct objfile *objfile = dwarf2_per_objfile->objfile;
struct type *void_type = objfile_type (objfile)->builtin_void;
struct type *addr_type = lookup_pointer_type (void_type);
- int addr_size = dwarf2_per_cu_addr_size (per_cu);
+ int addr_size = this->addr_size ();
if (TYPE_LENGTH (addr_type) == addr_size)
return addr_type;
- addr_type
- = dwarf2_per_cu_addr_sized_int_type (per_cu, TYPE_UNSIGNED (addr_type));
+ addr_type = addr_sized_int_type (TYPE_UNSIGNED (addr_type));
return addr_type;
}
-/* Return DWARF version number of PER_CU. */
-
-short
-dwarf2_version (struct dwarf2_per_cu_data *per_cu)
-{
- return per_cu->dwarf_version;
-}
-
/* Locate the .debug_info compilation unit from CU's objfile which contains
the DIE at OFFSET. Raises an error on failure. */
attr = dwarf2_attr (die, DW_AT_allocated, cu);
if (attr != NULL && attr->form_is_block ())
{
- struct type *prop_type
- = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ struct type *prop_type = cu->per_cu->addr_sized_int_type (false);
if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
add_dyn_prop (DYN_PROP_ALLOCATED, prop, type);
}
attr = dwarf2_attr (die, DW_AT_associated, cu);
if (attr != NULL && attr->form_is_block ())
{
- struct type *prop_type
- = dwarf2_per_cu_addr_sized_int_type (cu->per_cu, false);
+ struct type *prop_type = cu->per_cu->addr_sized_int_type (false);
if (attr_to_dynamic_prop (attr, die, cu, &prop, prop_type))
add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type);
}
/* Read DW_AT_data_location and set in type. */
attr = dwarf2_attr (die, DW_AT_data_location, cu);
if (attr_to_dynamic_prop (attr, die, cu, &prop,
- dwarf2_per_cu_addr_type (cu->per_cu)))
+ cu->per_cu->addr_type ()))
add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type);
if (dwarf2_per_objfile->die_type_hash == NULL)
delete imported_symtabs;
imported_symtabs = nullptr;
}
+
+ /* Return the OBJFILE associated with this compilation unit. If
+ this compilation unit came from a separate debuginfo file, then
+ the master objfile is returned. */
+ struct objfile *objfile () const;
+
+ /* Return the address size given in the compilation unit header for
+ this CU. */
+ int addr_size () const;
+
+ /* Return the offset size given in the compilation unit header for
+ this CU. */
+ int offset_size () const;
+
+ /* Return the DW_FORM_ref_addr size given in the compilation unit
+ header for this CU. */
+ int ref_addr_size () const;
+
+ /* Return the text offset of the CU. The returned offset comes from
+ this CU's objfile. If this objfile came from a separate
+ debuginfo file, then the offset may be different from the
+ corresponding offset in the parent objfile. */
+ CORE_ADDR text_offset () const;
+
+ /* Return a type that is a generic pointer type, the size of which
+ matches the address size given in the compilation unit header for
+ this CU. */
+ struct type *addr_type () const;
+
+ /* Find an integer type SIZE_IN_BYTES bytes in size and return it.
+ UNSIGNED_P controls if the integer is unsigned or not. */
+ struct type *int_type (int size_in_bytes, bool unsigned_p) const;
+
+ /* Find an integer type the same size as the address size given in
+ the compilation unit header for this CU. UNSIGNED_P controls if
+ the integer is unsigned or not. */
+ struct type *addr_sized_int_type (bool unsigned_p) const;
+
+ /* Return DWARF version number of this CU. */
+ short version () const
+ {
+ return dwarf_version;
+ }
};
/* Entry in the signatured_types hash table. */