GDB (xrefs)
Loading...
Searching...
No Matches
read.h
Go to the documentation of this file.
1/* DWARF 2 debugging format support for GDB.
2
3 Copyright (C) 1994-2023 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#ifndef DWARF2READ_H
21#define DWARF2READ_H
22
23#include <queue>
24#include <unordered_map>
26#include "dwarf2/cooked-index.h"
27#include "dwarf2/file-and-dir.h"
28#include "dwarf2/index-cache.h"
29#include "dwarf2/mapped-index.h"
30#include "dwarf2/section.h"
31#include "dwarf2/cu.h"
32#include "filename-seen-cache.h"
33#include "gdbsupport/gdb_obstack.h"
34#include "gdbsupport/hash_enum.h"
35#include "gdbsupport/function-view.h"
36#include "gdbsupport/packed.h"
37
38/* Hold 'maintenance (set|show) dwarf' commands. */
41
43{
49 int nr_tus;
50};
51
52struct dwarf2_cu;
54struct dwarf2_per_bfd;
56struct mapped_index;
58struct signatured_type;
59struct type_unit_group;
60
61/* One item on the queue of compilation units to read in full symbols
62 for. */
64{
66 enum language lang)
67 : per_cu (cu),
69 pretend_language (lang)
70 {
71 }
72
74
76
80};
81
82/* A deleter for dwarf2_per_cu_data that knows to downcast to
83 signatured_type as appropriate. This approach lets us avoid a
84 virtual destructor, which saves a bit of space. */
85
87{
89};
90
91/* A specialization of unique_ptr for dwarf2_per_cu_data and
92 subclasses. */
93typedef std::unique_ptr<dwarf2_per_cu_data, dwarf2_per_cu_data_deleter>
95
96/* Persistent data held for a compilation unit, even when not
97 processing it. We put a pointer to this structure in the
98 psymtab. */
99
101{
103 : queued (false),
104 is_debug_types (false),
105 is_dwz (false),
106 reading_dwo_directly (false),
107 tu_read (false),
108 m_header_read_in (false),
109 mark (false),
110 files_read (false),
111 scanned (false)
112 {
113 }
114
115 /* The start offset and length of this compilation unit.
116 NOTE: Unlike comp_unit_head.length, this length includes
117 initial_length_size.
118 If the DIE refers to a DWO file, this is always of the original die,
119 not the DWO file. */
120 sect_offset sect_off {};
121
122private:
123 unsigned int m_length = 0;
124
125 /* DWARF standard version this data has been read from (such as 4 or 5). */
126 unsigned char m_dwarf_version = 0;
127
128public:
129 /* Flag indicating this compilation unit will be read in before
130 any of the current compilation units are processed. */
131 unsigned int queued : 1;
132
133 /* Non-zero if this CU is from .debug_types.
134 Struct dwarf2_per_cu_data is contained in struct signatured_type iff
135 this is non-zero. */
136 unsigned int is_debug_types : 1;
137
138 /* Non-zero if this CU is from the .dwz file. */
139 unsigned int is_dwz : 1;
140
141 /* Non-zero if reading a TU directly from a DWO file, bypassing the stub.
142 This flag is only valid if is_debug_types is true.
143 We can't read a CU directly from a DWO file: There are required
144 attributes in the stub. */
145 unsigned int reading_dwo_directly : 1;
146
147 /* Non-zero if the TU has been read.
148 This is used to assist the "Stay in DWO Optimization" for Fission:
149 When reading a DWO, it's faster to read TUs from the DWO instead of
150 fetching them from random other DWOs (due to comdat folding).
151 If the TU has already been read, the optimization is unnecessary
152 (and unwise - we don't want to change where gdb thinks the TU lives
153 "midflight").
154 This flag is only valid if is_debug_types is true. */
155 unsigned int tu_read : 1;
156
157 /* True if HEADER has been read in.
158
159 Don't access this field directly. It should be private, but we can't make
160 it private at the moment. */
161 mutable bool m_header_read_in : 1;
162
163 /* A temporary mark bit used when iterating over all CUs in
164 expand_symtabs_matching. */
165 unsigned int mark : 1;
166
167 /* True if we've tried to read the file table. There will be no
168 point in trying to read it again next time. */
169 bool files_read : 1;
170
171 /* Wrap the following in struct packed instead of bitfields to avoid
172 data races when the bitfields end up on the same memory location
173 (per C++ memory model). */
174
175 /* If addresses have been read for this CU (usually from
176 .debug_aranges), then this flag is set. */
177 packed<bool, 1> addresses_seen = false;
178
179private:
180 /* The unit type of this CU. */
181 std::atomic<packed<dwarf_unit_type, 1>> m_unit_type {(dwarf_unit_type)0};
182
183 /* The language of this CU. */
184 std::atomic<packed<language, LANGUAGE_BYTES>> m_lang {language_unknown};
185
186public:
187 /* True if this CU has been scanned by the indexer; false if
188 not. */
189 std::atomic<bool> scanned;
190
191 /* Our index in the unshared "symtabs" vector. */
192 unsigned index = 0;
193
194 /* The section this CU/TU lives in.
195 If the DIE refers to a DWO file, this is always the original die,
196 not the DWO file. */
197 struct dwarf2_section_info *section = nullptr;
198
199 /* Backlink to the owner of this. */
201
202 /* DWARF header of this CU. Note that dwarf2_cu reads its own version of the
203 header, which may differ from this one, since it may pass rcuh_kind::TYPE
204 to read_comp_unit_head, whereas for dwarf2_per_cu_data we always pass
205 rcuh_kind::COMPILE.
206
207 Don't access this field directly, use the get_header method instead. It
208 should be private, but we can't make it private at the moment. */
210
211 /* The file and directory for this CU. This is cached so that we
212 don't need to re-examine the DWO in some situations. This may be
213 nullptr, depending on the CU; for example a partial unit won't
214 have one. */
215 std::unique_ptr<file_and_directory> fnd;
216
217 /* The file table. This can be NULL if there was no file table
218 or it's currently not read in.
219 NOTE: This points into dwarf2_per_objfile->per_bfd->quick_file_names_table. */
220 struct quick_file_names *file_names = nullptr;
221
222 /* The CUs we import using DW_TAG_imported_unit. This is filled in
223 while reading psymtabs, used to compute the psymtab dependencies,
224 and then cleared. Then it is filled in again while reading full
225 symbols, and only deleted when the objfile is destroyed.
226
227 This is also used to work around a difference between the way gold
228 generates .gdb_index version <=7 and the way gdb does. Arguably this
229 is a gold bug. For symbols coming from TUs, gold records in the index
230 the CU that includes the TU instead of the TU itself. This breaks
231 dw2_lookup_symbol: It assumes that if the index says symbol X lives
232 in CU/TU Y, then one need only expand Y and a subsequent lookup in Y
233 will find X. Alas TUs live in their own symtab, so after expanding CU Y
234 we need to look in TU Z to find X. Fortunately, this is akin to
235 DW_TAG_imported_unit, so we just use the same mechanism: For
236 .gdb_index version <=7 this also records the TUs that the CU referred
237 to. Concurrently with this change gdb was modified to emit version 8
238 indices so we only pay a price for gold generated indices.
239 http://sourceware.org/bugzilla/show_bug.cgi?id=15021.
240
241 This currently needs to be a public member due to how
242 dwarf2_per_cu_data is allocated and used. Ideally in future things
243 could be refactored to make this private. Until then please try to
244 avoid direct access to this member, and instead use the helper
245 functions above. */
246 std::vector <dwarf2_per_cu_data *> *imported_symtabs = nullptr;
247
248 /* Return true of IMPORTED_SYMTABS is empty or not yet allocated. */
250 {
251 return (imported_symtabs == nullptr || imported_symtabs->empty ());
252 }
253
254 /* Push P to the back of IMPORTED_SYMTABS, allocated IMPORTED_SYMTABS
255 first if required. */
257 {
258 if (imported_symtabs == nullptr)
259 imported_symtabs = new std::vector <dwarf2_per_cu_data *>;
260 imported_symtabs->push_back (p);
261 }
262
263 /* Return the size of IMPORTED_SYMTABS if it is allocated, otherwise
264 return 0. */
265 size_t imported_symtabs_size () const
266 {
267 if (imported_symtabs == nullptr)
268 return 0;
269 return imported_symtabs->size ();
270 }
271
272 /* Delete IMPORTED_SYMTABS and set the pointer back to nullptr. */
274 {
275 delete imported_symtabs;
276 imported_symtabs = nullptr;
277 }
278
279 /* Get the header of this per_cu, reading it if necessary. */
280 const comp_unit_head *get_header () const;
281
282 /* Return the address size given in the compilation unit header for
283 this CU. */
284 int addr_size () const;
285
286 /* Return the offset size given in the compilation unit header for
287 this CU. */
288 int offset_size () const;
289
290 /* Return the DW_FORM_ref_addr size given in the compilation unit
291 header for this CU. */
292 int ref_addr_size () const;
293
294 /* Return length of this CU. */
295 unsigned int length () const
296 {
297 /* Make sure it's set already. */
298 gdb_assert (m_length != 0);
299 return m_length;
300 }
301
302 void set_length (unsigned int length, bool strict_p = true)
303 {
304 if (m_length == 0)
305 /* Set if not set already. */
307 else if (strict_p)
308 /* If already set, verify that it's the same value. */
309 gdb_assert (m_length == length);
310 }
311
312 /* Return DWARF version number of this CU. */
313 short version () const
314 {
315 /* Make sure it's set already. */
316 gdb_assert (m_dwarf_version != 0);
317 return m_dwarf_version;
318 }
319
320 void set_version (short version)
321 {
322 if (m_dwarf_version == 0)
323 /* Set if not set already. */
325 else
326 /* If already set, verify that it's the same value. */
327 gdb_assert (m_dwarf_version == version);
328 }
329
330 dwarf_unit_type unit_type (bool strict_p = true) const
331 {
332 dwarf_unit_type ut = m_unit_type.load ();
333 if (strict_p)
334 gdb_assert (ut != 0);
335 return ut;
336 }
337
338 void set_unit_type (dwarf_unit_type unit_type)
339 {
340 /* Set if not set already. */
341 packed<dwarf_unit_type, 1> nope = (dwarf_unit_type)0;
342 if (m_unit_type.compare_exchange_strong (nope, unit_type))
343 return;
344
345 /* If already set, verify that it's the same value. */
346 nope = unit_type;
347 if (m_unit_type.compare_exchange_strong (nope, unit_type))
348 return;
349 gdb_assert_not_reached ();
350 }
351
352 enum language lang (bool strict_p = true) const
353 {
354 enum language l = m_lang.load ();
355 if (strict_p)
356 gdb_assert (l != language_unknown);
357 return l;
358 }
359
361 {
362 if (unit_type () == DW_UT_partial)
363 return;
364 /* Set if not set already. */
365 packed<language, LANGUAGE_BYTES> nope = language_unknown;
366 if (m_lang.compare_exchange_strong (nope, lang))
367 return;
368 /* If already set, verify that it's the same value. */
369 nope = lang;
370 if (m_lang.compare_exchange_strong (nope, lang))
371 return;
372 gdb_assert_not_reached ();
373 }
374
375 /* Free any cached file names. */
377};
378
379/* Entry in the signatured_types hash table. */
380
382{
385 {}
386
387 /* The type's signature. */
388 ULONGEST signature;
389
390 /* Offset in the TU of the type's DIE, as read from the TU header.
391 If this TU is a DWO stub and the definition lives in a DWO file
392 (specified by DW_AT_GNU_dwo_name), this value is unusable. */
393 cu_offset type_offset_in_tu {};
394
395 /* Offset in the section of the type's DIE.
396 If the definition lives in a DWO file, this is the offset in the
397 .debug_types.dwo section.
398 The value is zero until the actual value is known.
399 Zero is otherwise not a valid section offset. */
401
402 /* Type units are grouped by their DW_AT_stmt_list entry so that they
403 can share them. This points to the containing symtab. */
405
406 /* Containing DWO unit.
407 This field is valid iff per_cu.reading_dwo_directly. */
408 struct dwo_unit *dwo_unit = nullptr;
409};
410
411using signatured_type_up = std::unique_ptr<signatured_type>;
412
413/* Some DWARF data can be shared across objfiles who share the same BFD,
414 this data is stored in this object.
415
416 Two dwarf2_per_objfile objects representing objfiles sharing the same BFD
417 will point to the same instance of dwarf2_per_bfd, unless the BFD requires
418 relocation. */
419
421{
422 /* Construct a dwarf2_per_bfd for OBFD. NAMES points to the
423 dwarf2 section names, or is NULL if the standard ELF names are
424 used. CAN_COPY is true for formats where symbol
425 interposition is possible and so symbol values must follow copy
426 relocation rules. */
427 dwarf2_per_bfd (bfd *obfd, const dwarf2_debug_sections *names, bool can_copy);
428
430
432
433 /* Return the CU given its index. */
434 dwarf2_per_cu_data *get_cu (int index) const
435 {
436 return this->all_units[index].get ();
437 }
438
439 /* A convenience function to allocate a dwarf2_per_cu_data. The
440 returned object has its "index" field set properly. The object
441 is allocated on the dwarf2_per_bfd obstack. */
443
444 /* A convenience function to allocate a signatured_type. The
445 returned object has its "index" field set properly. The object
446 is allocated on the dwarf2_per_bfd obstack. */
447 signatured_type_up allocate_signatured_type (ULONGEST signature);
448
449 /* Map all the DWARF section data needed when scanning
450 .debug_info. */
451 void map_info_sections (struct objfile *objfile);
452
453private:
454 /* This function is mapped across the sections and remembers the
455 offset and size of each of the debugging sections we are
456 interested in. */
457 void locate_sections (bfd *abfd, asection *sectp,
458 const dwarf2_debug_sections &names);
459
460public:
461 /* The corresponding BFD. */
462 bfd *obfd;
463
464 /* Objects that can be shared across objfiles may be stored in this
465 obstack, while objects that are objfile-specific are stored on
466 the objfile obstack. */
467 auto_obstack obstack;
468
487
488 std::vector<dwarf2_section_info> types;
489
490 /* Table of all the compilation units. This is used to locate
491 the target compilation unit of a particular reference. */
492 std::vector<dwarf2_per_cu_data_up> all_units;
493
494 /* The all_units vector contains both CUs and TUs. Provide views on the
495 vector that are limited to either the CU part or the TU part. */
496 gdb::array_view<dwarf2_per_cu_data_up> all_comp_units;
497 gdb::array_view<dwarf2_per_cu_data_up> all_type_units;
498
499 /* Table of struct type_unit_group objects.
500 The hash key is the DW_AT_stmt_list value. */
502
503 /* A table mapping .debug_types signatures to its signatured_type entry.
504 This is NULL if the .debug_types section hasn't been read in yet. */
506
507 /* Type unit statistics, to see how well the scaling improvements
508 are doing. */
510
511 /* A table mapping DW_AT_dwo_name values to struct dwo_file objects.
512 This is NULL if the table hasn't been allocated yet. */
513 htab_up dwo_files;
514
515 /* True if we've checked for whether there is a DWP file. */
516 bool dwp_checked = false;
517
518 /* The DWP file if there is one, or NULL. */
519 std::unique_ptr<struct dwp_file> dwp_file;
520
521 /* The shared '.dwz' file, if one exists. This is used when the
522 original data was compressed using 'dwz -m'. */
523 std::unique_ptr<struct dwz_file> dwz_file;
524
525 /* Whether copy relocations are supported by this object format. */
527
528 /* A flag indicating whether this objfile has a section loaded at a
529 VMA of 0. */
531
532 /* The mapped index, or NULL in the readnow case. */
533 std::unique_ptr<dwarf_scanner_base> index_table;
534
535 /* When using index_table, this keeps track of all quick_file_names entries.
536 TUs typically share line table entries with a CU, so we maintain a
537 separate table of all line table entries to support the sharing.
538 Note that while there can be way more TUs than CUs, we've already
539 sorted all the TUs into "type unit groups", grouped by their
540 DW_AT_stmt_list value. Therefore the only sharing done here is with a
541 CU and its associated TU group if there is one. */
543
544 /* The CUs we recently read. */
545 std::vector<dwarf2_per_cu_data *> just_read_cus;
546
547 /* If we loaded the index from an external file, this contains the
548 resources associated to the open file, memory mapping, etc. */
549 std::unique_ptr<index_cache_resource> index_cache_res;
550
551 /* Mapping from abstract origin DIE to concrete DIEs that reference it as
552 DW_AT_abstract_origin. */
553 std::unordered_map<sect_offset, std::vector<sect_offset>,
554 gdb::hash_enum<sect_offset>>
556
557 /* The address map that is used by the DWARF index code. */
558 struct addrmap *index_addrmap = nullptr;
559};
560
561/* This is the per-objfile data associated with a type_unit_group. */
562
564{
565 /* The compunit symtab.
566 Type units in a group needn't all be defined in the same source file,
567 so we create an essentially anonymous symtab as the compunit symtab. */
569
570 /* The number of symtabs from the line header.
571 The value here must match line_header.num_file_names. */
572 unsigned int num_symtabs = 0;
573
574 /* The symbol tables for this TU (obtained from the files listed in
575 DW_AT_stmt_list).
576 WARNING: The order of entries here must match the order of entries
577 in the line header. After the first TU using this type_unit_group, the
578 line header for the subsequent TUs is recreated from this. This is done
579 because we need to use the same symtabs for each TU using the same
580 DW_AT_stmt_list value. Also note that symtabs may be repeated here,
581 there's no guarantee the line header doesn't have duplicate entries. */
582 struct symtab **symtabs = nullptr;
583};
584
585/* Collection of data recorded per objfile.
586 This hangs off of dwarf2_objfile_data_key.
587
588 Some DWARF data cannot (currently) be shared across objfiles. Such
589 data is stored in this object. */
590
592{
595 {}
596
598
599 /* Return pointer to string at .debug_line_str offset as read from BUF.
600 BUF is assumed to be in a compilation unit described by CU_HEADER.
601 Return *BYTES_READ_PTR count of bytes read from BUF. */
602 const char *read_line_string (const gdb_byte *buf,
603 const struct comp_unit_head *cu_header,
604 unsigned int *bytes_read_ptr);
605
606 /* Return pointer to string at .debug_line_str offset as read from BUF.
607 The offset_size is OFFSET_SIZE. */
608 const char *read_line_string (const gdb_byte *buf,
609 unsigned int offset_size);
610
611 /* Return true if the symtab corresponding to PER_CU has been set,
612 false otherwise. */
613 bool symtab_set_p (const dwarf2_per_cu_data *per_cu) const;
614
615 /* Return the compunit_symtab associated to PER_CU, if it has been created. */
616 compunit_symtab *get_symtab (const dwarf2_per_cu_data *per_cu) const;
617
618 /* Set the compunit_symtab associated to PER_CU. */
620
621 /* Get the type_unit_group_unshareable corresponding to TU_GROUP. If one
622 does not exist, create it. */
624 (type_unit_group *tu_group);
625
626 struct type *get_type_for_signatured_type (signatured_type *sig_type) const;
627
629 struct type *type);
630
631 /* Get the dwarf2_cu matching PER_CU for this objfile. */
633
634 /* Set the dwarf2_cu matching PER_CU for this objfile. */
635 void set_cu (dwarf2_per_cu_data *per_cu, std::unique_ptr<dwarf2_cu> cu);
636
637 /* Remove/free the dwarf2_cu matching PER_CU for this objfile. */
638 void remove_cu (dwarf2_per_cu_data *per_cu);
639
640 /* Free all cached compilation units. */
641 void remove_all_cus ();
642
643 /* Increase the age counter on each CU compilation unit and free
644 any that are too old. */
645 void age_comp_units ();
646
647 /* Back link. */
649
650 /* Pointer to the data that is (possibly) shared between this objfile and
651 other objfiles backed by the same BFD. */
653
654 /* Table mapping type DIEs to their struct type *.
655 This is nullptr if not allocated yet.
656 The mapping is done via (CU/TU + DIE offset) -> type. */
658
659 /* Table containing line_header indexed by offset and offset_in_dwz. */
661
662 /* The CU containing the m_builder in scope. */
663 dwarf2_cu *sym_cu = nullptr;
664
665 /* CUs that are queued to be read. */
666 gdb::optional<std::queue<dwarf2_queue_item>> queue;
667
668private:
669 /* Hold the corresponding compunit_symtab for each CU or TU. This
670 is indexed by dwarf2_per_cu_data::index. A NULL value means
671 that the CU/TU has not been expanded yet. */
672 std::vector<compunit_symtab *> m_symtabs;
673
674 /* Map from a type unit group to the corresponding unshared
675 structure. */
676 typedef std::unique_ptr<type_unit_group_unshareable>
678
679 std::unordered_map<type_unit_group *, type_unit_group_unshareable_up>
681
682 /* Map from signatured types to the corresponding struct type. */
683 std::unordered_map<signatured_type *, struct type *> m_type_map;
684
685 /* Map from the objfile-independent dwarf2_per_cu_data instances to the
686 corresponding objfile-dependent dwarf2_cu instances. */
687 std::unordered_map<dwarf2_per_cu_data *,
688 std::unique_ptr<dwarf2_cu>> m_dwarf2_cus;
689};
690
691/* Get the dwarf2_per_objfile associated to OBJFILE. */
692
694
695/* Return the type of the DIE at DIE_OFFSET in the CU named by
696 PER_CU. */
697
698struct type *dwarf2_get_die_type (cu_offset die_offset,
699 dwarf2_per_cu_data *per_cu,
700 dwarf2_per_objfile *per_objfile);
701
702/* Given an index in .debug_addr, fetch the value.
703 NOTE: This can be called during dwarf expression evaluation,
704 long after the debug information has been read, and thus per_cu->cu
705 may no longer exist. */
706
708 dwarf2_per_objfile *per_objfile,
709 unsigned int addr_index);
710
711/* Return DWARF block referenced by DW_AT_location of DIE at SECT_OFF at PER_CU.
712 Returned value is intended for DW_OP_call*. Returned
713 dwarf2_locexpr_baton->data has lifetime of
714 PER_CU->DWARF2_PER_OBJFILE->OBJFILE. */
715
717 (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
719 gdb::function_view<CORE_ADDR ()> get_frame_pc,
720 bool resolve_abstract_p = false);
721
722/* Like dwarf2_fetch_die_loc_sect_off, but take a CU
723 offset. */
724
726 (cu_offset offset_in_cu, dwarf2_per_cu_data *per_cu,
728 gdb::function_view<CORE_ADDR ()> get_frame_pc);
729
730/* If the DIE at SECT_OFF in PER_CU has a DW_AT_const_value, return a
731 pointer to the constant bytes and set LEN to the length of the
732 data. If memory is needed, allocate it on OBSTACK. If the DIE
733 does not have a DW_AT_const_value, return NULL. */
734
735extern const gdb_byte *dwarf2_fetch_constant_bytes
736 (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
737 dwarf2_per_objfile *per_objfile, obstack *obstack,
738 LONGEST *len);
739
740/* Return the type of the die at SECT_OFF in PER_CU. Return NULL if no
741 valid type for this die is found. If VAR_NAME is non-null, and if
742 the DIE in question is a variable declaration (definitions are
743 excluded), then *VAR_NAME is set to the variable's name. */
744
746 (sect_offset sect_off, dwarf2_per_cu_data *per_cu,
747 dwarf2_per_objfile *per_objfile,
748 const char **var_name = nullptr);
749
750/* When non-zero, dump line number entries as they are read in. */
751extern unsigned int dwarf_line_debug;
752
753/* Dwarf2 sections that can be accessed by dwarf2_get_section_info. */
758
759extern void dwarf2_get_section_info (struct objfile *,
761 asection **, const gdb_byte **,
762 bfd_size_type *);
763
764/* Return true if the producer of the inferior is clang. */
765extern bool producer_is_clang (struct dwarf2_cu *cu);
766
767#endif /* DWARF2READ_H */
language
Definition: defs.h:211
@ language_unknown
Definition: defs.h:212
CORE_ADDR get_frame_pc(frame_info_ptr frame)
Definition: frame.c:2592
bfd * obfd
Definition: gdbarch-gen.h:894
CORE_ADDR dwarf2_read_addr_index(dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, unsigned int addr_index)
Definition: read.c:19453
struct type * dwarf2_fetch_die_type_sect_off(sect_offset sect_off, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, const char **var_name=nullptr)
Definition: read.c:22754
const gdb_byte * dwarf2_fetch_constant_bytes(sect_offset sect_off, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, obstack *obstack, LONGEST *len)
Definition: read.c:22617
bool producer_is_clang(struct dwarf2_cu *cu)
Definition: read.c:9505
std::unique_ptr< signatured_type > signatured_type_up
Definition: read.h:411
struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_cu_off(cu_offset offset_in_cu, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, gdb::function_view< CORE_ADDR()> get_frame_pc)
Definition: read.c:22584
void dwarf2_get_section_info(struct objfile *, enum dwarf2_section_enum, asection **, const gdb_byte **, bfd_size_type *)
Definition: read.c:1732
dwarf2_section_enum
Definition: read.h:754
@ DWARF2_EH_FRAME
Definition: read.h:756
@ DWARF2_DEBUG_FRAME
Definition: read.h:755
struct cmd_list_element * set_dwarf_cmdlist
Definition: read.c:24047
std::unique_ptr< dwarf2_per_cu_data, dwarf2_per_cu_data_deleter > dwarf2_per_cu_data_up
Definition: read.h:94
struct cmd_list_element * show_dwarf_cmdlist
Definition: read.c:24048
struct type * dwarf2_get_die_type(cu_offset die_offset, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile)
Definition: read.c:22780
struct dwarf2_locexpr_baton dwarf2_fetch_die_loc_sect_off(sect_offset sect_off, dwarf2_per_cu_data *per_cu, dwarf2_per_objfile *per_objfile, gdb::function_view< CORE_ADDR()> get_frame_pc, bool resolve_abstract_p=false)
Definition: read.c:22479
dwarf2_per_objfile * get_dwarf2_per_objfile(struct objfile *objfile)
Definition: read.c:311
unsigned int dwarf_line_debug
Definition: read.c:118
Definition: cu.h:50
struct dwarf2_per_cu_data * per_cu
Definition: loc.h:176
dwarf2_per_objfile * per_objfile
Definition: loc.h:172
dwarf2_section_info rnglists
Definition: read.h:480
dwarf2_section_info loclists
Definition: read.h:473
dwarf2_section_info macro
Definition: read.h:475
DISABLE_COPY_AND_ASSIGN(dwarf2_per_bfd)
htab_up type_unit_groups
Definition: read.h:501
htab_up quick_file_names_table
Definition: read.h:542
auto_obstack obstack
Definition: read.h:467
struct addrmap * index_addrmap
Definition: read.h:558
dwarf2_per_cu_data_up allocate_per_cu()
Definition: read.c:2095
bool has_section_at_zero
Definition: read.h:530
dwarf2_section_info str
Definition: read.h:476
dwarf2_section_info macinfo
Definition: read.h:474
bfd * obfd
Definition: read.h:462
htab_up signatured_types
Definition: read.h:505
gdb::array_view< dwarf2_per_cu_data_up > all_comp_units
Definition: read.h:496
dwarf2_per_cu_data * get_cu(int index) const
Definition: read.h:434
void map_info_sections(struct objfile *objfile)
Definition: read.c:1771
void locate_sections(bfd *abfd, asection *sectp, const dwarf2_debug_sections &names)
Definition: read.c:1605
bool can_copy
Definition: read.h:526
dwarf2_section_info ranges
Definition: read.h:479
std::unique_ptr< dwarf_scanner_base > index_table
Definition: read.h:533
htab_up dwo_files
Definition: read.h:513
bool dwp_checked
Definition: read.h:516
gdb::array_view< dwarf2_per_cu_data_up > all_type_units
Definition: read.h:497
std::unique_ptr< struct dwz_file > dwz_file
Definition: read.h:523
dwarf2_section_info str_offsets
Definition: read.h:477
std::vector< dwarf2_section_info > types
Definition: read.h:488
dwarf2_section_info addr
Definition: read.h:481
dwarf2_section_info line_str
Definition: read.h:478
dwarf2_section_info frame
Definition: read.h:482
signatured_type_up allocate_signatured_type(ULONGEST signature)
Definition: read.c:2106
dwarf2_section_info eh_frame
Definition: read.h:483
dwarf2_section_info debug_aranges
Definition: read.h:486
std::unordered_map< sect_offset, std::vector< sect_offset >, gdb::hash_enum< sect_offset > > abstract_to_concrete
Definition: read.h:555
std::unique_ptr< struct dwp_file > dwp_file
Definition: read.h:519
dwarf2_section_info abbrev
Definition: read.h:470
dwarf2_section_info gdb_index
Definition: read.h:484
std::unique_ptr< index_cache_resource > index_cache_res
Definition: read.h:549
~dwarf2_per_bfd()
Definition: read.c:1468
dwarf2_section_info loc
Definition: read.h:472
dwarf2_section_info line
Definition: read.h:471
dwarf2_section_info info
Definition: read.h:469
std::vector< dwarf2_per_cu_data_up > all_units
Definition: read.h:492
std::vector< dwarf2_per_cu_data * > just_read_cus
Definition: read.h:545
void operator()(dwarf2_per_cu_data *data)
Definition: read.c:1275
unsigned index
Definition: read.h:192
std::atomic< bool > scanned
Definition: read.h:189
struct dwarf2_section_info * section
Definition: read.h:197
bool imported_symtabs_empty() const
Definition: read.h:249
unsigned int queued
Definition: read.h:131
unsigned int reading_dwo_directly
Definition: read.h:145
sect_offset sect_off
Definition: read.h:120
bool m_header_read_in
Definition: read.h:161
short version() const
Definition: read.h:313
bool files_read
Definition: read.h:169
void set_version(short version)
Definition: read.h:320
void set_lang(enum language lang)
Definition: read.h:360
unsigned int is_dwz
Definition: read.h:139
void imported_symtabs_free()
Definition: read.h:273
unsigned char m_dwarf_version
Definition: read.h:126
std::unique_ptr< file_and_directory > fnd
Definition: read.h:215
int offset_size() const
Definition: read.c:23588
struct quick_file_names * file_names
Definition: read.h:220
const comp_unit_head * get_header() const
Definition: read.c:23559
unsigned int m_length
Definition: read.h:123
dwarf_unit_type unit_type(bool strict_p=true) const
Definition: read.h:330
void set_length(unsigned int length, bool strict_p=true)
Definition: read.h:302
std::vector< dwarf2_per_cu_data * > * imported_symtabs
Definition: read.h:246
void imported_symtabs_push(dwarf2_per_cu_data *p)
Definition: read.h:256
enum language lang(bool strict_p=true) const
Definition: read.h:352
size_t imported_symtabs_size() const
Definition: read.h:265
dwarf2_per_bfd * per_bfd
Definition: read.h:200
packed< bool, 1 > addresses_seen
Definition: read.h:177
comp_unit_head m_header
Definition: read.h:209
void free_cached_file_names()
Definition: read.c:2900
std::atomic< packed< dwarf_unit_type, 1 > > m_unit_type
Definition: read.h:181
unsigned int mark
Definition: read.h:165
int addr_size() const
Definition: read.c:23580
unsigned int is_debug_types
Definition: read.h:136
int ref_addr_size() const
Definition: read.c:23596
std::atomic< packed< language, LANGUAGE_BYTES > > m_lang
Definition: read.h:184
unsigned int tu_read
Definition: read.h:155
unsigned int length() const
Definition: read.h:295
dwarf2_per_cu_data()
Definition: read.h:102
void set_unit_type(dwarf_unit_type unit_type)
Definition: read.h:338
struct objfile * objfile
Definition: read.h:648
std::unordered_map< type_unit_group *, type_unit_group_unshareable_up > m_type_units
Definition: read.h:680
std::unordered_map< signatured_type *, struct type * > m_type_map
Definition: read.h:683
compunit_symtab * get_symtab(const dwarf2_per_cu_data *per_cu) const
Definition: read.c:1526
type_unit_group_unshareable * get_type_unit_group_unshareable(type_unit_group *tu_group)
Definition: read.c:8266
void remove_cu(dwarf2_per_cu_data *per_cu)
Definition: read.c:23854
const char * read_line_string(const gdb_byte *buf, const struct comp_unit_head *cu_header, unsigned int *bytes_read_ptr)
Definition: read.c:19389
void age_comp_units()
Definition: read.c:23809
dwarf2_cu * sym_cu
Definition: read.h:663
std::unique_ptr< type_unit_group_unshareable > type_unit_group_unshareable_up
Definition: read.h:677
void set_type_for_signatured_type(signatured_type *sig_type, struct type *type)
Definition: read.c:8290
void set_cu(dwarf2_per_cu_data *per_cu, std::unique_ptr< dwarf2_cu > cu)
Definition: read.c:23798
struct type * get_type_for_signatured_type(signatured_type *sig_type) const
Definition: read.c:8280
gdb::optional< std::queue< dwarf2_queue_item > > queue
Definition: read.h:666
std::unordered_map< dwarf2_per_cu_data *, std::unique_ptr< dwarf2_cu > > m_dwarf2_cus
Definition: read.h:688
htab_up die_type_hash
Definition: read.h:657
void set_symtab(const dwarf2_per_cu_data *per_cu, compunit_symtab *symtab)
Definition: read.c:1536
struct dwarf2_per_bfd * per_bfd
Definition: read.h:652
void remove_all_cus()
Definition: read.c:1482
htab_up line_header_hash
Definition: read.h:660
bool symtab_set_p(const dwarf2_per_cu_data *per_cu) const
Definition: read.c:1516
std::vector< compunit_symtab * > m_symtabs
Definition: read.h:672
dwarf2_cu * get_cu(dwarf2_per_cu_data *per_cu)
Definition: read.c:23786
dwarf2_per_objfile(struct objfile *objfile, dwarf2_per_bfd *per_bfd)
Definition: read.h:593
~dwarf2_queue_item()
Definition: read.c:1261
dwarf2_queue_item(dwarf2_per_cu_data *cu, dwarf2_per_objfile *per_objfile, enum language lang)
Definition: read.h:65
dwarf2_per_objfile * per_objfile
Definition: read.h:78
DISABLE_COPY_AND_ASSIGN(dwarf2_queue_item)
enum language pretend_language
Definition: read.h:79
dwarf2_per_cu_data * per_cu
Definition: read.h:77
Definition: read.c:450
signatured_type(ULONGEST signature)
Definition: read.h:383
ULONGEST signature
Definition: read.h:388
sect_offset type_offset_in_section
Definition: read.h:400
cu_offset type_offset_in_tu
Definition: read.h:393
Definition: read.h:43
int nr_stmt_less_type_units
Definition: read.h:47
int nr_all_type_units_reallocs
Definition: read.h:48
int nr_tus
Definition: read.h:49
int nr_uniq_abbrev_tables
Definition: read.h:44
int nr_symtabs
Definition: read.h:45
int nr_symtab_sharers
Definition: read.h:46
struct symtab ** symtabs
Definition: read.h:582
unsigned int num_symtabs
Definition: read.h:572
Definition: gdbtypes.h:922