X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fdwarf2read.h;h=ae1f74ab678d7737c625059f4310b9d7b4b2824f;hb=df08b5881b4972d78f9a2069955dad5b12bc972e;hp=9251bde125926bcb7d5d81d0a664f2b65012f47c;hpb=fd5866f6aad7336f7a2b59578b9deef81383ea3b;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/dwarf2read.h b/gdb/dwarf2read.h index 9251bde125..ae1f74ab67 100644 --- a/gdb/dwarf2read.h +++ b/gdb/dwarf2read.h @@ -1,6 +1,6 @@ /* DWARF 2 debugging format support for GDB. - Copyright (C) 1994-2019 Free Software Foundation, Inc. + Copyright (C) 1994-2020 Free Software Foundation, Inc. This file is part of GDB. @@ -24,14 +24,13 @@ #include "dwarf-index-cache.h" #include "filename-seen-cache.h" #include "gdb_obstack.h" -#include "common/hash_enum.h" +#include "gdbsupport/hash_enum.h" /* Hold 'maintenance (set|show) dwarf' commands. */ extern struct cmd_list_element *set_dwarf_cmdlist; extern struct cmd_list_element *show_dwarf_cmdlist; -typedef struct dwarf2_per_cu_data *dwarf2_per_cu_ptr; -DEF_VEC_P (dwarf2_per_cu_ptr); +extern bool dwarf_always_disassemble; /* A descriptor for dwarf sections. @@ -104,9 +103,12 @@ struct dwarf2_per_objfile { /* Construct a dwarf2_per_objfile for OBJFILE. NAMES points to the dwarf2 section names, or is NULL if the standard ELF names are - used. */ + used. CAN_COPY is true for formats where symbol + interposition is possible and so symbol values must follow copy + relocation rules. */ dwarf2_per_objfile (struct objfile *objfile, - const dwarf2_debug_sections *names); + const dwarf2_debug_sections *names, + bool can_copy); ~dwarf2_per_objfile (); @@ -206,6 +208,9 @@ public: original data was compressed using 'dwz -m'. */ std::unique_ptr dwz_file; + /* Whether copy relocations are supported by this object format. */ + bool can_copy; + /* A flag indicating whether this objfile has a section loaded at a VMA of 0. */ bool has_section_at_zero = false; @@ -254,8 +259,8 @@ public: /* Mapping from abstract origin DIE to concrete DIEs that reference it as DW_AT_abstract_origin. */ - std::unordered_map, \ - gdb::hash_enum> \ + std::unordered_map, + gdb::hash_enum> abstract_to_concrete; }; @@ -339,6 +344,37 @@ struct dwarf2_per_cu_data struct dwarf2_per_cu_quick_data *quick; } v; + /* Return true of IMPORTED_SYMTABS is empty or not yet allocated. */ + bool imported_symtabs_empty () const + { + return (imported_symtabs == nullptr || imported_symtabs->empty ()); + } + + /* Push P to the back of IMPORTED_SYMTABS, allocated IMPORTED_SYMTABS + first if required. */ + void imported_symtabs_push (dwarf2_per_cu_data *p) + { + if (imported_symtabs == nullptr) + imported_symtabs = new std::vector ; + imported_symtabs->push_back (p); + } + + /* Return the size of IMPORTED_SYMTABS if it is allocated, otherwise + return 0. */ + size_t imported_symtabs_size () const + { + if (imported_symtabs == nullptr) + return 0; + return imported_symtabs->size (); + } + + /* Delete IMPORTED_SYMTABS and set the pointer back to nullptr. */ + void imported_symtabs_free () + { + delete imported_symtabs; + imported_symtabs = nullptr; + } + /* The CUs we import using DW_TAG_imported_unit. This is filled in while reading psymtabs, used to compute the psymtab dependencies, and then cleared. Then it is filled in again while reading full @@ -356,8 +392,14 @@ struct dwarf2_per_cu_data .gdb_index version <=7 this also records the TUs that the CU referred to. Concurrently with this change gdb was modified to emit version 8 indices so we only pay a price for gold generated indices. - http://sourceware.org/bugzilla/show_bug.cgi?id=15021. */ - VEC (dwarf2_per_cu_ptr) *imported_symtabs; + http://sourceware.org/bugzilla/show_bug.cgi?id=15021. + + This currently needs to be a public member due to how + dwarf2_per_cu_data is allocated and used. Ideally in future things + could be refactored to make this private. Until then please try to + avoid direct access to this member, and instead use the helper + functions above. */ + std::vector *imported_symtabs; }; /* Entry in the signatured_types hash table. */ @@ -399,9 +441,6 @@ struct signatured_type struct dwo_unit *dwo_unit; }; -typedef struct signatured_type *sig_type_ptr; -DEF_VEC_P (sig_type_ptr); - ULONGEST read_unsigned_leb128 (bfd *, const gdb_byte *, unsigned int *); /* This represents a '.dwz' file. */ @@ -415,7 +454,7 @@ struct dwz_file const char *filename () const { - return bfd_get_filename (this->dwz_bfd); + return bfd_get_filename (this->dwz_bfd.get ()); } /* A dwz file can only contain a few sections. */