GDB (xrefs)
Loading...
Searching...
No Matches
symtab.h
Go to the documentation of this file.
1/* Symbol table definitions for GDB.
2
3 Copyright (C) 1986-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#if !defined (SYMTAB_H)
21#define SYMTAB_H 1
22
23#include <array>
24#include <vector>
25#include <string>
26#include <set>
27#include "gdbsupport/gdb_vecs.h"
28#include "gdbtypes.h"
29#include "gdbsupport/gdb_obstack.h"
30#include "gdbsupport/gdb_regex.h"
31#include "gdbsupport/enum-flags.h"
32#include "gdbsupport/function-view.h"
33#include "gdbsupport/gdb_optional.h"
34#include "gdbsupport/gdb_string_view.h"
35#include "gdbsupport/next-iterator.h"
36#include "gdbsupport/iterator-range.h"
37#include "completer.h"
38#include "gdb-demangle.h"
39#include "split-name.h"
40#include "frame.h"
41
42/* Opaque declarations. */
43struct ui_file;
44class frame_info_ptr;
45struct symbol;
46struct obstack;
47struct objfile;
48struct block;
49struct blockvector;
50struct axs_value;
51struct agent_expr;
52struct program_space;
53struct language_defn;
54struct common_block;
55struct obj_section;
56struct cmd_list_element;
57class probe;
58struct lookup_name_info;
59struct code_breakpoint;
60
61/* How to match a lookup name against a symbol search name. */
63{
64 /* Wild matching. Matches unqualified symbol names in all
65 namespace/module/packages, etc. */
66 WILD,
67
68 /* Full matching. The lookup name indicates a fully-qualified name,
69 and only matches symbol search names in the specified
70 namespace/module/package. */
71 FULL,
72
73 /* Search name matching. This is like FULL, but the search name did
74 not come from the user; instead it is already a search name
75 retrieved from a search_name () call.
76 For Ada, this avoids re-encoding an already-encoded search name
77 (which would potentially incorrectly lowercase letters in the
78 linkage/search name that should remain uppercase). For C++, it
79 avoids trying to demangle a name we already know is
80 demangled. */
82
83 /* Expression matching. The same as FULL matching in most
84 languages. The same as WILD matching in Ada. */
86};
87
88/* Hash the given symbol search name according to LANGUAGE's
89 rules. */
90extern unsigned int search_name_hash (enum language language,
91 const char *search_name);
92
93/* Ada-specific bits of a lookup_name_info object. This is lazily
94 constructed on demand. */
95
97{
98 public:
99 /* Construct. */
101
102 /* Compare SYMBOL_SEARCH_NAME with our lookup name, using MATCH_TYPE
103 as name match type. Returns true if there's a match, false
104 otherwise. If non-NULL, store the matching results in MATCH. */
105 bool matches (const char *symbol_search_name,
106 symbol_name_match_type match_type,
107 completion_match_result *comp_match_res) const;
108
109 /* The Ada-encoded lookup name. */
110 const std::string &lookup_name () const
111 { return m_encoded_name; }
112
113 /* Return true if we're supposed to be doing a wild match look
114 up. */
115 bool wild_match_p () const
116 { return m_wild_match_p; }
117
118 /* Return true if we're looking up a name inside package
119 Standard. */
120 bool standard_p () const
121 { return m_standard_p; }
122
123 /* Return true if doing a verbatim match. */
124 bool verbatim_p () const
125 { return m_verbatim_p; }
126
127 /* A wrapper for ::split_name that handles some Ada-specific
128 peculiarities. */
129 std::vector<gdb::string_view> split_name () const
130 {
132 {
133 std::vector<gdb::string_view> result;
134 if (m_standard_p)
135 result.emplace_back ("standard");
136 result.emplace_back (m_encoded_name);
137 return result;
138 }
139 return ::split_name (m_encoded_name.c_str (), split_style::UNDERSCORE);
140 }
141
142private:
143 /* The Ada-encoded lookup name. */
144 std::string m_encoded_name;
145
146 /* Whether the user-provided lookup name was Ada encoded. If so,
147 then return encoded names in the 'matches' method's 'completion
148 match result' output. */
149 bool m_encoded_p : 1;
150
151 /* True if really doing wild matching. Even if the user requests
152 wild matching, some cases require full matching. */
154
155 /* True if doing a verbatim match. This is true if the decoded
156 version of the symbol name is wrapped in '<'/'>'. This is an
157 escape hatch users can use to look up symbols the Ada encoding
158 does not understand. */
159 bool m_verbatim_p : 1;
160
161 /* True if the user specified a symbol name that is inside package
162 Standard. Symbol names inside package Standard are handled
163 specially. We always do a non-wild match of the symbol name
164 without the "standard__" prefix, and only search static and
165 global symbols. This was primarily introduced in order to allow
166 the user to specifically access the standard exceptions using,
167 for instance, Standard.Constraint_Error when Constraint_Error is
168 ambiguous (due to the user defining its own Constraint_Error
169 entity inside its program). */
170 bool m_standard_p : 1;
171};
172
173/* Language-specific bits of a lookup_name_info object, for languages
174 that do name searching using demangled names (C++/D/Go). This is
175 lazily constructed on demand. */
176
178{
179public:
181 language lang);
182
183 /* The demangled lookup name. */
184 const std::string &lookup_name () const
185 { return m_demangled_name; }
186
187private:
188 /* The demangled lookup name. */
189 std::string m_demangled_name;
190};
191
192/* Object that aggregates all information related to a symbol lookup
193 name. I.e., the name that is matched against the symbol's search
194 name. Caches per-language information so that it doesn't require
195 recomputing it for every symbol comparison, like for example the
196 Ada encoded name and the symbol's name hash for a given language.
197 The object is conceptually immutable once constructed, and thus has
198 no setters. This is to prevent some code path from tweaking some
199 property of the lookup name for some local reason and accidentally
200 altering the results of any continuing search(es).
201 lookup_name_info objects are generally passed around as a const
202 reference to reinforce that. (They're not passed around by value
203 because they're not small.) */
205{
206 public:
207 /* We delete this overload so that the callers are required to
208 explicitly handle the lifetime of the name. */
209 lookup_name_info (std::string &&name,
211 bool completion_mode = false,
212 bool ignore_parameters = false) = delete;
213
214 /* This overload requires that NAME have a lifetime at least as long
215 as the lifetime of this object. */
225
226 /* This overload requires that NAME have a lifetime at least as long
227 as the lifetime of this object. */
237
238 /* Getters. See description of each corresponding field. */
240 bool completion_mode () const { return m_completion_mode; }
241 gdb::string_view name () const { return m_name; }
242 const bool ignore_parameters () const { return m_ignore_parameters; }
243
244 /* Like the "name" method but guarantees that the returned string is
245 \0-terminated. */
246 const char *c_str () const
247 {
248 /* Actually this is always guaranteed due to how the class is
249 constructed. */
250 return m_name.data ();
251 }
252
253 /* Return a version of this lookup name that is usable with
254 comparisons against symbols have no parameter info, such as
255 psymbols and GDB index symbols. */
257 {
259 true /* ignore params */);
260 }
261
262 /* Get the search name hash for searches in language LANG. */
263 unsigned int search_name_hash (language lang) const
264 {
265 /* Only compute each language's hash once. */
266 if (!m_demangled_hashes_p[lang])
267 {
270 m_demangled_hashes_p[lang] = true;
271 }
272 return m_demangled_hashes[lang];
273 }
274
275 /* Get the search name for searches in language LANG. */
276 const char *language_lookup_name (language lang) const
277 {
278 switch (lang)
279 {
280 case language_ada:
281 return ada ().lookup_name ().c_str ();
282 case language_cplus:
283 return cplus ().lookup_name ().c_str ();
284 case language_d:
285 return d ().lookup_name ().c_str ();
286 case language_go:
287 return go ().lookup_name ().c_str ();
288 default:
289 return m_name.data ();
290 }
291 }
292
293 /* A wrapper for ::split_name (see split-name.h) that splits this
294 name, and that handles any language-specific peculiarities. */
295 std::vector<gdb::string_view> split_name (language lang) const
296 {
297 if (lang == language_ada)
298 return ada ().split_name ();
300 switch (lang)
301 {
302 case language_cplus:
303 case language_rust:
304 style = split_style::CXX;
305 break;
306 case language_d:
307 case language_go:
309 break;
310 }
311 return ::split_name (language_lookup_name (lang), style);
312 }
313
314 /* Get the Ada-specific lookup info. */
315 const ada_lookup_name_info &ada () const
316 {
318 return *m_ada;
319 }
320
321 /* Get the C++-specific lookup info. */
323 {
325 return *m_cplus;
326 }
327
328 /* Get the D-specific lookup info. */
330 {
332 return *m_d;
333 }
334
335 /* Get the Go-specific lookup info. */
337 {
339 return *m_go;
340 }
341
342 /* Get a reference to a lookup_name_info object that matches any
343 symbol name. */
344 static const lookup_name_info &match_any ();
345
346private:
347 /* Initialize FIELD, if not initialized yet. */
348 template<typename Field, typename... Args>
349 void maybe_init (Field &field, Args&&... args) const
350 {
351 if (!field)
352 field.emplace (*this, std::forward<Args> (args)...);
353 }
354
355 /* The lookup info as passed to the ctor. */
359 gdb::string_view m_name;
360
361 /* Language-specific info. These fields are filled lazily the first
362 time a lookup is done in the corresponding language. They're
363 mutable because lookup_name_info objects are typically passed
364 around by const reference (see intro), and they're conceptually
365 "cache" that can always be reconstructed from the non-mutable
366 fields. */
367 mutable gdb::optional<ada_lookup_name_info> m_ada;
368 mutable gdb::optional<demangle_for_lookup_info> m_cplus;
369 mutable gdb::optional<demangle_for_lookup_info> m_d;
370 mutable gdb::optional<demangle_for_lookup_info> m_go;
371
372 /* The demangled hashes. Stored in an array with one entry for each
373 possible language. The second array records whether we've
374 already computed the each language's hash. (These are separate
375 arrays instead of a single array of optional<unsigned> to avoid
376 alignment padding). */
377 mutable std::array<unsigned int, nr_languages> m_demangled_hashes;
378 mutable std::array<bool, nr_languages> m_demangled_hashes_p {};
379};
380
381/* Comparison function for completion symbol lookup.
382
383 Returns true if the symbol name matches against LOOKUP_NAME.
384
385 SYMBOL_SEARCH_NAME should be a symbol's "search" name.
386
387 On success and if non-NULL, COMP_MATCH_RES->match is set to point
388 to the symbol name as should be presented to the user as a
389 completion match list element. In most languages, this is the same
390 as the symbol's search name, but in some, like Ada, the display
391 name is dynamically computed within the comparison routine.
392
393 Also, on success and if non-NULL, COMP_MATCH_RES->match_for_lcd
394 points the part of SYMBOL_SEARCH_NAME that was considered to match
395 LOOKUP_NAME. E.g., in C++, in linespec/wild mode, if the symbol is
396 "foo::function()" and LOOKUP_NAME is "function(", MATCH_FOR_LCD
397 points to "function()" inside SYMBOL_SEARCH_NAME. */
399 (const char *symbol_search_name,
400 const lookup_name_info &lookup_name,
401 completion_match_result *comp_match_res);
402
403/* Some of the structures in this file are space critical.
404 The space-critical structures are:
405
406 struct general_symbol_info
407 struct symbol
408 struct partial_symbol
409
410 These structures are laid out to encourage good packing.
411 They use ENUM_BITFIELD and short int fields, and they order the
412 structure members so that fields less than a word are next
413 to each other so they can be packed together. */
414
415/* Rearranged: used ENUM_BITFIELD and rearranged field order in
416 all the space critical structures (plus struct minimal_symbol).
417 Memory usage dropped from 99360768 bytes to 90001408 bytes.
418 I measured this with before-and-after tests of
419 "HEAD-old-gdb -readnow HEAD-old-gdb" and
420 "HEAD-new-gdb -readnow HEAD-old-gdb" on native i686-pc-linux-gnu,
421 red hat linux 8, with LD_LIBRARY_PATH=/usr/lib/debug,
422 typing "maint space 1" at the first command prompt.
423
424 Here is another measurement (from andrew c):
425 # no /usr/lib/debug, just plain glibc, like a normal user
426 gdb HEAD-old-gdb
427 (gdb) break internal_error
428 (gdb) run
429 (gdb) maint internal-error
430 (gdb) backtrace
431 (gdb) maint space 1
432
433 gdb gdb_6_0_branch 2003-08-19 space used: 8896512
434 gdb HEAD 2003-08-19 space used: 8904704
435 gdb HEAD 2003-08-21 space used: 8396800 (+symtab.h)
436 gdb HEAD 2003-08-21 space used: 8265728 (+gdbtypes.h)
437
438 The third line shows the savings from the optimizations in symtab.h.
439 The fourth line shows the savings from the optimizations in
440 gdbtypes.h. Both optimizations are in gdb HEAD now.
441
442 --chastain 2003-08-21 */
443
444/* Define a structure for the information that is common to all symbol types,
445 including minimal symbols, partial symbols, and full symbols. In a
446 multilanguage environment, some language specific information may need to
447 be recorded along with each symbol. */
448
449/* This structure is space critical. See space comments at the top. */
450
452{
453 /* Short version as to when to use which name accessor:
454 Use natural_name () to refer to the name of the symbol in the original
455 source code. Use linkage_name () if you want to know what the linker
456 thinks the symbol's name is. Use print_name () for output. Use
457 demangled_name () if you specifically need to know whether natural_name ()
458 and linkage_name () are different. */
459
460 const char *linkage_name () const
461 { return m_name; }
462
463 /* Return SYMBOL's "natural" name, i.e. the name that it was called in
464 the original source code. In languages like C++ where symbols may
465 be mangled for ease of manipulation by the linker, this is the
466 demangled name. */
467 const char *natural_name () const;
468
469 /* Returns a version of the name of a symbol that is
470 suitable for output. In C++ this is the "demangled" form of the
471 name if demangle is on and the "mangled" form of the name if
472 demangle is off. In other languages this is just the symbol name.
473 The result should never be NULL. Don't use this for internal
474 purposes (e.g. storing in a hashtable): it's only suitable for output. */
475 const char *print_name () const
476 { return demangle ? natural_name () : linkage_name (); }
477
478 /* Return the demangled name for a symbol based on the language for
479 that symbol. If no demangled name exists, return NULL. */
480 const char *demangled_name () const;
481
482 /* Returns the name to be used when sorting and searching symbols.
483 In C++, we search for the demangled form of a name,
484 and so sort symbols accordingly. In Ada, however, we search by mangled
485 name. If there is no distinct demangled name, then this
486 returns the same value (same pointer) as linkage_name (). */
487 const char *search_name () const;
488
489 /* Set just the linkage name of a symbol; do not try to demangle
490 it. Used for constructs which do not have a mangled name,
491 e.g. struct tags. Unlike compute_and_set_names, linkage_name must
492 be terminated and either already on the objfile's obstack or
493 permanently allocated. */
495 { m_name = linkage_name; }
496
497 /* Set the demangled name of this symbol to NAME. NAME must be
498 already correctly allocated. If the symbol's language is Ada,
499 then the name is ignored and the obstack is set. */
500 void set_demangled_name (const char *name, struct obstack *obstack);
501
502 enum language language () const
503 { return m_language; }
504
505 /* Initializes the language dependent portion of a symbol
506 depending upon the language for the symbol. */
507 void set_language (enum language language, struct obstack *obstack);
508
509 /* Set the linkage and natural names of a symbol, by demangling
510 the linkage name. If linkage_name may not be nullterminated,
511 copy_name must be set to true. */
512 void compute_and_set_names (gdb::string_view linkage_name, bool copy_name,
513 struct objfile_per_bfd_storage *per_bfd,
514 gdb::optional<hashval_t> hash
515 = gdb::optional<hashval_t> ());
516
517 CORE_ADDR value_address () const
518 {
519 return m_value.address;
520 }
521
522 void set_value_address (CORE_ADDR address)
523 {
524 m_value.address = address;
525 }
526
527 /* Return the unrelocated address of this symbol. */
528 unrelocated_addr unrelocated_address () const
529 {
530 return m_value.unrel_addr;
531 }
532
533 /* Set the unrelocated address of this symbol. */
534 void set_unrelocated_address (unrelocated_addr addr)
535 {
536 m_value.unrel_addr = addr;
537 }
538
539 /* Name of the symbol. This is a required field. Storage for the
540 name is allocated on the objfile_obstack for the associated
541 objfile. For languages like C++ that make a distinction between
542 the mangled name and demangled name, this is the mangled
543 name. */
544
545 const char *m_name;
546
547 /* Value of the symbol. Which member of this union to use, and what
548 it means, depends on what kind of symbol this is and its
549 SYMBOL_CLASS. See comments there for more details. All of these
550 are in host byte order (though what they point to might be in
551 target byte order, e.g. LOC_CONST_BYTES). */
552
553 union
554 {
555 LONGEST ivalue;
556
557 const struct block *block;
558
559 const gdb_byte *bytes;
560
561 CORE_ADDR address;
562
563 /* The address, if unrelocated. An unrelocated symbol does not
564 have the runtime section offset applied. */
565 unrelocated_addr unrel_addr;
566
567 /* A common block. Used with LOC_COMMON_BLOCK. */
568
570
571 /* For opaque typedef struct chain. */
572
573 struct symbol *chain;
574 }
576
577 /* Since one and only one language can apply, wrap the language specific
578 information inside a union. */
579
580 union
581 {
582 /* A pointer to an obstack that can be used for storage associated
583 with this symbol. This is only used by Ada, and only when the
584 'ada_mangled' field is zero. */
586
587 /* This is used by languages which wish to store a demangled name.
588 currently used by Ada, C++, and Objective C. */
589 const char *demangled_name;
590 }
592
593 /* Record the source code language that applies to this symbol.
594 This is used to select one of the fields from the language specific
595 union above. */
596
598
599 /* This is only used by Ada. If set, then the 'demangled_name' field
600 of language_specific is valid. Otherwise, the 'obstack' field is
601 valid. */
602 unsigned int ada_mangled : 1;
603
604 /* Which section is this symbol in? This is an index into
605 section_offsets for this objfile. Negative means that the symbol
606 does not get relocated relative to a section. */
607
609
610 /* Set the index into the obj_section list (within the containing
611 objfile) for the section that contains this symbol. See M_SECTION
612 for more details. */
613
614 void set_section_index (short idx)
615 { m_section = idx; }
616
617 /* Return the index into the obj_section list (within the containing
618 objfile) for the section that contains this symbol. See M_SECTION
619 for more details. */
620
621 short section_index () const
622 { return m_section; }
623
624 /* Return the obj_section from OBJFILE for this symbol. The symbol
625 returned is based on the SECTION member variable, and can be nullptr
626 if SECTION is negative. */
627
628 struct obj_section *obj_section (const struct objfile *objfile) const;
629};
630
631extern CORE_ADDR symbol_overlayed_address (CORE_ADDR, struct obj_section *);
632
633/* Return the address of SYM. The MAYBE_COPIED flag must be set on
634 SYM. If SYM appears in the main program's minimal symbols, then
635 that minsym's address is returned; otherwise, SYM's address is
636 returned. This should generally only be used via the
637 SYMBOL_VALUE_ADDRESS macro. */
638
639extern CORE_ADDR get_symbol_address (const struct symbol *sym);
640
641/* Try to determine the demangled name for a symbol, based on the
642 language of that symbol. If the language is set to language_auto,
643 it will attempt to find any demangling algorithm that works and
644 then set the language appropriately. The returned name is allocated
645 by the demangler and should be xfree'd. */
646
647extern gdb::unique_xmalloc_ptr<char> symbol_find_demangled_name
648 (struct general_symbol_info *gsymbol, const char *mangled);
649
650/* Return true if NAME matches the "search" name of GSYMBOL, according
651 to the symbol's language. */
653 (const struct general_symbol_info *gsymbol,
654 const lookup_name_info &name);
655
656/* Compute the hash of the given symbol search name of a symbol of
657 language LANGUAGE. */
658extern unsigned int search_name_hash (enum language language,
659 const char *search_name);
660
661/* Classification types for a minimal symbol. These should be taken as
662 "advisory only", since if gdb can't easily figure out a
663 classification it simply selects mst_unknown. It may also have to
664 guess when it can't figure out which is a better match between two
665 types (mst_data versus mst_bss) for example. Since the minimal
666 symbol info is sometimes derived from the BFD library's view of a
667 file, we need to live with what information bfd supplies. */
668
670{
671 mst_unknown = 0, /* Unknown type, the default */
672 mst_text, /* Generally executable instructions */
673
674 /* A GNU ifunc symbol, in the .text section. GDB uses to know
675 whether the user is setting a breakpoint on a GNU ifunc function,
676 and thus GDB needs to actually set the breakpoint on the target
677 function. It is also used to know whether the program stepped
678 into an ifunc resolver -- the resolver may get a separate
679 symbol/alias under a different name, but it'll have the same
680 address as the ifunc symbol. */
681 mst_text_gnu_ifunc, /* Executable code returning address
682 of executable code */
683
684 /* A GNU ifunc function descriptor symbol, in a data section
685 (typically ".opd"). Seen on architectures that use function
686 descriptors, like PPC64/ELFv1. In this case, this symbol's value
687 is the address of the descriptor. There'll be a corresponding
688 mst_text_gnu_ifunc synthetic symbol for the text/entry
689 address. */
690 mst_data_gnu_ifunc, /* Executable code returning address
691 of executable code */
692
693 mst_slot_got_plt, /* GOT entries for .plt sections */
694 mst_data, /* Generally initialized data */
695 mst_bss, /* Generally uninitialized data */
696 mst_abs, /* Generally absolute (nonrelocatable) */
697 /* GDB uses mst_solib_trampoline for the start address of a shared
698 library trampoline entry. Breakpoints for shared library functions
699 are put there if the shared library is not yet loaded.
700 After the shared library is loaded, lookup_minimal_symbol will
701 prefer the minimal symbol from the shared library (usually
702 a mst_text symbol) over the mst_solib_trampoline symbol, and the
703 breakpoints will be moved to their true address in the shared
704 library via breakpoint_re_set. */
705 mst_solib_trampoline, /* Shared library trampoline code */
706 /* For the mst_file* types, the names are only guaranteed to be unique
707 within a given .o file. */
708 mst_file_text, /* Static version of mst_text */
709 mst_file_data, /* Static version of mst_data */
710 mst_file_bss, /* Static version of mst_bss */
713
714/* The number of enum minimal_symbol_type values, with some padding for
715 reasonable growth. */
716#define MINSYM_TYPE_BITS 4
718
719/* Return the address of MINSYM, which comes from OBJF. The
720 MAYBE_COPIED flag must be set on MINSYM. If MINSYM appears in the
721 main program's minimal symbols, then that minsym's address is
722 returned; otherwise, MINSYM's address is returned. This should
723 generally only be used via the MSYMBOL_VALUE_ADDRESS macro. */
724
725extern CORE_ADDR get_msymbol_address (struct objfile *objf,
726 const struct minimal_symbol *minsym);
727
728/* Define a simple structure used to hold some very basic information about
729 all defined global symbols (text, data, bss, abs, etc). The only required
730 information is the general_symbol_info.
731
732 In many cases, even if a file was compiled with no special options for
733 debugging at all, as long as was not stripped it will contain sufficient
734 information to build a useful minimal symbol table using this structure.
735 Even when a file contains enough debugging information to build a full
736 symbol table, these minimal symbols are still useful for quickly mapping
737 between names and addresses, and vice versa. They are also sometimes
738 used to figure out what full symbol table entries need to be read in. */
739
741{
742 LONGEST value_longest () const
743 {
744 return m_value.ivalue;
745 }
746
747 /* The relocated address of the minimal symbol, using the section
748 offsets from OBJFILE. */
749 CORE_ADDR value_address (objfile *objfile) const;
750
751 /* It does not make sense to call this for minimal symbols, as they
752 are stored unrelocated. */
753 CORE_ADDR value_address () const = delete;
754
755 /* The unrelocated address of the minimal symbol. */
756 unrelocated_addr unrelocated_address () const
757 {
758 return m_value.unrel_addr;
759 }
760
761 /* The unrelocated address just after the end of the the minimal
762 symbol. */
763 unrelocated_addr unrelocated_end_address () const
764 {
765 return unrelocated_addr (CORE_ADDR (unrelocated_address ()) + size ());
766 }
767
768 /* Return this minimal symbol's type. */
769
771 {
772 return m_type;
773 }
774
775 /* Set this minimal symbol's type. */
776
778 {
779 m_type = type;
780 }
781
782 /* Return this minimal symbol's size. */
783
784 unsigned long size () const
785 {
786 return m_size;
787 }
788
789 /* Set this minimal symbol's size. */
790
791 void set_size (unsigned long size)
792 {
793 m_size = size;
794 m_has_size = 1;
795 }
796
797 /* Return true if this minimal symbol's size is known. */
798
799 bool has_size () const
800 {
801 return m_has_size;
802 }
803
804 /* Return this minimal symbol's first target-specific flag. */
805
806 bool target_flag_1 () const
807 {
808 return m_target_flag_1;
809 }
810
811 /* Set this minimal symbol's first target-specific flag. */
812
817
818 /* Return this minimal symbol's second target-specific flag. */
819
820 bool target_flag_2 () const
821 {
822 return m_target_flag_2;
823 }
824
825 /* Set this minimal symbol's second target-specific flag. */
826
831
832 /* Size of this symbol. dbx_end_psymtab in dbxread.c uses this
833 information to calculate the end of the partial symtab based on the
834 address of the last symbol plus the size of the last symbol. */
835
836 unsigned long m_size;
837
838 /* Which source file is this symbol in? Only relevant for mst_file_*. */
839 const char *filename;
840
841 /* Classification type for this minimal symbol. */
842
844
845 /* Non-zero if this symbol was created by gdb.
846 Such symbols do not appear in the output of "info var|fun". */
847 unsigned int created_by_gdb : 1;
848
849 /* Two flag bits provided for the use of the target. */
850 unsigned int m_target_flag_1 : 1;
851 unsigned int m_target_flag_2 : 1;
852
853 /* Nonzero iff the size of the minimal symbol has been set.
854 Symbol size information can sometimes not be determined, because
855 the object file format may not carry that piece of information. */
856 unsigned int m_has_size : 1;
857
858 /* Non-zero if this symbol ever had its demangled name set (even if
859 it was set to NULL). */
860 unsigned int name_set : 1;
861
862 /* Minimal symbols with the same hash key are kept on a linked
863 list. This is the link. */
864
866
867 /* Minimal symbols are stored in two different hash tables. This is
868 the `next' pointer for the demangled hash table. */
869
871
872 /* True if this symbol is of some data type. */
873
874 bool data_p () const;
875
876 /* True if MSYMBOL is of some text type. */
877
878 bool text_p () const;
879
880 /* For data symbols only, given an objfile, if 'maybe_copied'
881 evaluates to 'true' for that objfile, then the symbol might be
882 subject to copy relocation. In this case, a minimal symbol
883 matching the symbol's linkage name is first looked for in the
884 main objfile. If found, then that address is used; otherwise the
885 address in this symbol is used. */
886
888};
889
890#include "minsyms.h"
891
892
893
894/* Represent one symbol name; a variable, constant, function or typedef. */
895
896/* Different name domains for symbols. Looking up a symbol specifies a
897 domain and ignores symbol definitions in other name domains. */
898
900{
901 /* UNDEF_DOMAIN is used when a domain has not been discovered or
902 none of the following apply. This usually indicates an error either
903 in the symbol information or in gdb's handling of symbols. */
904
906
907 /* VAR_DOMAIN is the usual domain. In C, this contains variables,
908 function names, typedef names and enum type values. */
909
911
912 /* STRUCT_DOMAIN is used in C to hold struct, union and enum type names.
913 Thus, if `struct foo' is used in a C program, it produces a symbol named
914 `foo' in the STRUCT_DOMAIN. */
915
917
918 /* MODULE_DOMAIN is used in Fortran to hold module type names. */
919
921
922 /* LABEL_DOMAIN may be used for names of labels (for gotos). */
923
925
926 /* Fortran common blocks. Their naming must be separate from VAR_DOMAIN.
927 They also always use LOC_COMMON_BLOCK. */
929
930 /* This must remain last. */
933
934/* The number of bits in a symbol used to represent the domain. */
935
936#define SYMBOL_DOMAIN_BITS 3
938
939extern const char *domain_name (domain_enum);
940
941/* Searching domains, used when searching for symbols. Element numbers are
942 hardcoded in GDB, check all enum uses before changing it. */
943
945{
946 /* Everything in VAR_DOMAIN minus FUNCTIONS_DOMAIN and
947 TYPES_DOMAIN. */
949
950 /* All functions -- for some reason not methods, though. */
952
953 /* All defined types */
955
956 /* All modules. */
958
959 /* Any type. */
960 ALL_DOMAIN = 4
962
963extern const char *search_domain_name (enum search_domain);
964
965/* An address-class says where to find the value of a symbol. */
966
968{
969 /* Not used; catches errors. */
970
972
973 /* Value is constant int SYMBOL_VALUE, host byteorder. */
974
976
977 /* Value is at fixed address SYMBOL_VALUE_ADDRESS. */
978
980
981 /* Value is in register. SYMBOL_VALUE is the register number
982 in the original debug format. SYMBOL_REGISTER_OPS holds a
983 function that can be called to transform this into the
984 actual register number this represents in a specific target
985 architecture (gdbarch).
986
987 For some symbol formats (stabs, for some compilers at least),
988 the compiler generates two symbols, an argument and a register.
989 In some cases we combine them to a single LOC_REGISTER in symbol
990 reading, but currently not for all cases (e.g. it's passed on the
991 stack and then loaded into a register). */
992
994
995 /* It's an argument; the value is at SYMBOL_VALUE offset in arglist. */
996
998
999 /* Value address is at SYMBOL_VALUE offset in arglist. */
1000
1002
1003 /* Value is in specified register. Just like LOC_REGISTER except the
1004 register holds the address of the argument instead of the argument
1005 itself. This is currently used for the passing of structs and unions
1006 on sparc and hppa. It is also used for call by reference where the
1007 address is in a register, at least by mipsread.c. */
1008
1010
1011 /* Value is a local variable at SYMBOL_VALUE offset in stack frame. */
1012
1014
1015 /* Value not used; definition in SYMBOL_TYPE. Symbols in the domain
1016 STRUCT_DOMAIN all have this class. */
1017
1019
1020 /* Value is address SYMBOL_VALUE_ADDRESS in the code. */
1021
1023
1024 /* In a symbol table, value is SYMBOL_BLOCK_VALUE of a `struct block'.
1025 In a partial symbol table, SYMBOL_VALUE_ADDRESS is the start address
1026 of the block. Function names have this class. */
1027
1029
1030 /* Value is a constant byte-sequence pointed to by SYMBOL_VALUE_BYTES, in
1031 target byte order. */
1032
1034
1035 /* Value is at fixed address, but the address of the variable has
1036 to be determined from the minimal symbol table whenever the
1037 variable is referenced.
1038 This happens if debugging information for a global symbol is
1039 emitted and the corresponding minimal symbol is defined
1040 in another object file or runtime common storage.
1041 The linker might even remove the minimal symbol if the global
1042 symbol is never referenced, in which case the symbol remains
1043 unresolved.
1044
1045 GDB would normally find the symbol in the minimal symbol table if it will
1046 not find it in the full symbol table. But a reference to an external
1047 symbol in a local block shadowing other definition requires full symbol
1048 without possibly having its address available for LOC_STATIC. Testcase
1049 is provided as `gdb.dwarf2/dw2-unresolved.exp'.
1050
1051 This is also used for thread local storage (TLS) variables. In
1052 this case, the address of the TLS variable must be determined
1053 when the variable is referenced, from the msymbol's address,
1054 which is the offset of the TLS variable in the thread local
1055 storage of the shared library/object. */
1056
1058
1059 /* The variable does not actually exist in the program.
1060 The value is ignored. */
1061
1063
1064 /* The variable's address is computed by a set of location
1065 functions (see "struct symbol_computed_ops" below). */
1067
1068 /* The variable uses general_symbol_info->value->common_block field.
1069 It also always uses COMMON_BLOCK_DOMAIN. */
1071
1072 /* Not used, just notes the boundary of the enum. */
1075
1076/* The number of bits needed for values in enum address_class, with some
1077 padding for reasonable growth, and room for run-time registered address
1078 classes. See symtab.c:MAX_SYMBOL_IMPLS.
1079 This is a #define so that we can have a assertion elsewhere to
1080 verify that we have reserved enough space for synthetic address
1081 classes. */
1082#define SYMBOL_ACLASS_BITS 5
1084
1085/* The methods needed to implement LOC_COMPUTED. These methods can
1086 use the symbol's .aux_value for additional per-symbol information.
1087
1088 At present this is only used to implement location expressions. */
1089
1091{
1092
1093 /* Return the value of the variable SYMBOL, relative to the stack
1094 frame FRAME. If the variable has been optimized out, return
1095 zero.
1096
1097 Iff `read_needs_frame (SYMBOL)' is not SYMBOL_NEEDS_FRAME, then
1098 FRAME may be zero. */
1099
1100 struct value *(*read_variable) (struct symbol * symbol,
1101 frame_info_ptr frame);
1102
1103 /* Read variable SYMBOL like read_variable at (callee) FRAME's function
1104 entry. SYMBOL should be a function parameter, otherwise
1105 NO_ENTRY_VALUE_ERROR will be thrown. */
1106 struct value *(*read_variable_at_entry) (struct symbol *symbol,
1107 frame_info_ptr frame);
1108
1109 /* Find the "symbol_needs_kind" value for the given symbol. This
1110 value determines whether reading the symbol needs memory (e.g., a
1111 global variable), just registers (a thread-local), or a frame (a
1112 local variable). */
1114
1115 /* Write to STREAM a natural-language description of the location of
1116 SYMBOL, in the context of ADDR. */
1117 void (*describe_location) (struct symbol * symbol, CORE_ADDR addr,
1118 struct ui_file * stream);
1119
1120 /* Non-zero if this symbol's address computation is dependent on PC. */
1122
1123 /* Tracepoint support. Append bytecodes to the tracepoint agent
1124 expression AX that push the address of the object SYMBOL. Set
1125 VALUE appropriately. Note --- for objects in registers, this
1126 needn't emit any code; as long as it sets VALUE properly, then
1127 the caller will generate the right code in the process of
1128 treating this as an lvalue or rvalue. */
1129
1130 void (*tracepoint_var_ref) (struct symbol *symbol, struct agent_expr *ax,
1131 struct axs_value *value);
1132
1133 /* Generate C code to compute the location of SYMBOL. The C code is
1134 emitted to STREAM. GDBARCH is the current architecture and PC is
1135 the PC at which SYMBOL's location should be evaluated.
1136 REGISTERS_USED is a vector indexed by register number; the
1137 generator function should set an element in this vector if the
1138 corresponding register is needed by the location computation.
1139 The generated C code must assign the location to a local
1140 variable; this variable's name is RESULT_NAME. */
1141
1143 struct gdbarch *gdbarch,
1144 std::vector<bool> &registers_used,
1145 CORE_ADDR pc, const char *result_name);
1146
1147};
1148
1149/* The methods needed to implement LOC_BLOCK for inferior functions.
1150 These methods can use the symbol's .aux_value for additional
1151 per-symbol information. */
1152
1154{
1155 /* Fill in *START and *LENGTH with DWARF block data of function
1156 FRAMEFUNC valid for inferior context address PC. Set *LENGTH to
1157 zero if such location is not valid for PC; *START is left
1158 uninitialized in such case. */
1159 void (*find_frame_base_location) (struct symbol *framefunc, CORE_ADDR pc,
1160 const gdb_byte **start, size_t *length);
1161
1162 /* Return the frame base address. FRAME is the frame for which we want to
1163 compute the base address while FRAMEFUNC is the symbol for the
1164 corresponding function. Return 0 on failure (FRAMEFUNC may not hold the
1165 information we need).
1166
1167 This method is designed to work with static links (nested functions
1168 handling). Static links are function properties whose evaluation returns
1169 the frame base address for the enclosing frame. However, there are
1170 multiple definitions for "frame base": the content of the frame base
1171 register, the CFA as defined by DWARF unwinding information, ...
1172
1173 So this specific method is supposed to compute the frame base address such
1174 as for nested functions, the static link computes the same address. For
1175 instance, considering DWARF debugging information, the static link is
1176 computed with DW_AT_static_link and this method must be used to compute
1177 the corresponding DW_AT_frame_base attribute. */
1178 CORE_ADDR (*get_frame_base) (struct symbol *framefunc,
1179 frame_info_ptr frame);
1180
1181 /* Return the block for this function. So far, this is used to
1182 implement function aliases. So, if this is set, then it's not
1183 necessary to set the other functions in this structure; and vice
1184 versa. */
1185 const block *(*get_block_value) (const struct symbol *sym);
1186};
1187
1188/* Functions used with LOC_REGISTER and LOC_REGPARM_ADDR. */
1189
1191{
1192 int (*register_number) (struct symbol *symbol, struct gdbarch *gdbarch);
1193};
1194
1195/* Objects of this type are used to find the address class and the
1196 various computed ops vectors of a symbol. */
1197
1199{
1201
1202 /* Used with LOC_COMPUTED. */
1204
1205 /* Used with LOC_BLOCK. */
1207
1208 /* Used with LOC_REGISTER and LOC_REGPARM_ADDR. */
1210};
1211
1212/* struct symbol has some subclasses. This enum is used to
1213 differentiate between them. */
1214
1216{
1217 /* Plain struct symbol. */
1219
1220 /* struct template_symbol. */
1222
1223 /* struct rust_vtable_symbol. */
1226
1227extern gdb::array_view<const struct symbol_impl> symbol_impls;
1228
1229bool symbol_matches_domain (enum language symbol_language,
1230 domain_enum symbol_domain,
1231 domain_enum domain);
1232
1233/* This structure is space critical. See space comments at the top. */
1234
1235struct symbol : public general_symbol_info, public allocate_on_obstack
1236{
1238 /* Class-initialization of bitfields is only allowed in C++20. */
1240 m_aclass_index (0),
1242 m_is_argument (0),
1243 m_is_inlined (0),
1244 maybe_copied (0),
1246 m_artificial (false)
1247 {
1248 /* We can't use an initializer list for members of a base class, and
1249 general_symbol_info needs to stay a POD type. */
1250 m_name = nullptr;
1251 m_value.ivalue = 0;
1252 language_specific.obstack = nullptr;
1254 ada_mangled = 0;
1255 m_section = -1;
1256 /* GCC 4.8.5 (on CentOS 7) does not correctly compile class-
1257 initialization of unions, so we initialize it manually here. */
1258 owner.symtab = nullptr;
1259 }
1260
1261 symbol (const symbol &) = default;
1262 symbol &operator= (const symbol &) = default;
1263
1264 void set_aclass_index (unsigned int aclass_index)
1265 {
1266 m_aclass_index = aclass_index;
1267 }
1268
1269 const symbol_impl &impl () const
1270 {
1271 return symbol_impls[this->m_aclass_index];
1272 }
1273
1275 {
1276 return this->impl ().aclass;
1277 }
1278
1279 /* Call symbol_matches_domain on this symbol, using the symbol's
1280 domain. */
1281 bool matches (domain_enum d) const
1282 {
1283 return symbol_matches_domain (language (), domain (), d);
1284 }
1285
1287 {
1288 return m_domain;
1289 }
1290
1292 {
1293 m_domain = domain;
1294 }
1295
1296 bool is_objfile_owned () const
1297 {
1298 return m_is_objfile_owned;
1299 }
1300
1305
1306 bool is_argument () const
1307 {
1308 return m_is_argument;
1309 }
1310
1312 {
1314 }
1315
1316 bool is_inlined () const
1317 {
1318 return m_is_inlined;
1319 }
1320
1322 {
1324 }
1325
1327 {
1328 return this->subclass == SYMBOL_TEMPLATE;
1329 }
1330
1331 struct type *type () const
1332 {
1333 return m_type;
1334 }
1335
1336 void set_type (struct type *type)
1337 {
1338 m_type = type;
1339 }
1340
1341 unsigned int line () const
1342 {
1343 return m_line;
1344 }
1345
1346 void set_line (unsigned int line)
1347 {
1348 m_line = line;
1349 }
1350
1351 LONGEST value_longest () const
1352 {
1353 return m_value.ivalue;
1354 }
1355
1357 {
1358 m_value.ivalue = value;
1359 }
1360
1361 CORE_ADDR value_address () const
1362 {
1363 if (this->maybe_copied)
1364 return get_symbol_address (this);
1365 else
1366 return m_value.address;
1367 }
1368
1370 {
1371 m_value.address = address;
1372 }
1373
1374 const gdb_byte *value_bytes () const
1375 {
1376 return m_value.bytes;
1377 }
1378
1379 void set_value_bytes (const gdb_byte *bytes)
1380 {
1381 m_value.bytes = bytes;
1382 }
1383
1385 {
1386 return m_value.common_block;
1387 }
1388
1390 {
1391 m_value.common_block = common_block;
1392 }
1393
1394 const block *value_block () const;
1395
1397 {
1398 m_value.block = block;
1399 }
1400
1402 {
1403 return m_value.chain;
1404 }
1405
1407 {
1408 m_value.chain = sym;
1409 }
1410
1411 /* Return true if this symbol was marked as artificial. */
1412 bool is_artificial () const
1413 {
1414 return m_artificial;
1415 }
1416
1417 /* Set the 'artificial' flag on this symbol. */
1418 void set_is_artificial (bool artificial)
1419 {
1420 m_artificial = artificial;
1421 }
1422
1423 /* Return the OBJFILE of this symbol. It is an error to call this
1424 if is_objfile_owned is false, which only happens for
1425 architecture-provided types. */
1426
1427 struct objfile *objfile () const;
1428
1429 /* Return the ARCH of this symbol. */
1430
1431 struct gdbarch *arch () const;
1432
1433 /* Return the symtab of this symbol. It is an error to call this if
1434 is_objfile_owned is false, which only happens for
1435 architecture-provided types. */
1436
1437 struct symtab *symtab () const;
1438
1439 /* Set the symtab of this symbol to SYMTAB. It is an error to call
1440 this if is_objfile_owned is false, which only happens for
1441 architecture-provided types. */
1442
1443 void set_symtab (struct symtab *symtab);
1444
1445 /* Data type of value */
1446
1447 struct type *m_type = nullptr;
1448
1449 /* The owner of this symbol.
1450 Which one to use is defined by symbol.is_objfile_owned. */
1451
1452 union
1453 {
1454 /* The symbol table containing this symbol. This is the file associated
1455 with LINE. It can be NULL during symbols read-in but it is never NULL
1456 during normal operation. */
1458
1459 /* For types defined by the architecture. */
1460 struct gdbarch *arch;
1462
1463 /* Domain code. */
1464
1466
1467 /* Address class. This holds an index into the 'symbol_impls'
1468 table. The actual enum address_class value is stored there,
1469 alongside any per-class ops vectors. */
1470
1472
1473 /* If non-zero then symbol is objfile-owned, use owner.symtab.
1474 Otherwise symbol is arch-owned, use owner.arch. */
1475
1476 unsigned int m_is_objfile_owned : 1;
1477
1478 /* Whether this is an argument. */
1479
1480 unsigned m_is_argument : 1;
1481
1482 /* Whether this is an inlined function (class LOC_BLOCK only). */
1483 unsigned m_is_inlined : 1;
1484
1485 /* For LOC_STATIC only, if this is set, then the symbol might be
1486 subject to copy relocation. In this case, a minimal symbol
1487 matching the symbol's linkage name is first looked for in the
1488 main objfile. If found, then that address is used; otherwise the
1489 address in this symbol is used. */
1490
1491 unsigned maybe_copied : 1;
1492
1493 /* The concrete type of this symbol. */
1494
1495 ENUM_BITFIELD (symbol_subclass_kind) subclass : 2;
1496
1497 /* Whether this symbol is artificial. */
1498
1500
1501 /* Line number of this symbol's definition, except for inlined
1502 functions. For an inlined function (class LOC_BLOCK and
1503 SYMBOL_INLINED set) this is the line number of the function's call
1504 site. Inlined function symbols are not definitions, and they are
1505 never found by symbol table lookup.
1506 If this symbol is arch-owned, LINE shall be zero. */
1507
1508 unsigned int m_line = 0;
1509
1510 /* An arbitrary data pointer, allowing symbol readers to record
1511 additional information on a per-symbol basis. Note that this data
1512 must be allocated using the same obstack as the symbol itself. */
1513 /* So far it is only used by:
1514 LOC_COMPUTED: to find the location information
1515 LOC_BLOCK (DWARF2 function): information used internally by the
1516 DWARF 2 code --- specifically, the location expression for the frame
1517 base for this function. */
1518 /* FIXME drow/2003-02-21: For the LOC_BLOCK case, it might be better
1519 to add a magic symbol to the block containing this information,
1520 or to have a generic debug info annotation slot for symbols. */
1521
1522 void *aux_value = nullptr;
1523
1524 struct symbol *hash_next = nullptr;
1525};
1526
1527/* Several lookup functions return both a symbol and the block in which the
1528 symbol is found. This structure is used in these cases. */
1529
1531{
1532 /* The symbol that was found, or NULL if no symbol was found. */
1534
1535 /* If SYMBOL is not NULL, then this is the block in which the symbol is
1536 defined. */
1537 const struct block *block;
1538};
1539
1540/* Note: There is no accessor macro for symbol.owner because it is
1541 "private". */
1542
1543#define SYMBOL_COMPUTED_OPS(symbol) ((symbol)->impl ().ops_computed)
1544#define SYMBOL_BLOCK_OPS(symbol) ((symbol)->impl ().ops_block)
1545#define SYMBOL_REGISTER_OPS(symbol) ((symbol)->impl ().ops_register)
1546#define SYMBOL_LOCATION_BATON(symbol) (symbol)->aux_value
1547
1548inline const block *
1550{
1551 if (SYMBOL_BLOCK_OPS (this) != nullptr
1552 && SYMBOL_BLOCK_OPS (this)->get_block_value != nullptr)
1553 return SYMBOL_BLOCK_OPS (this)->get_block_value (this);
1554 return m_value.block;
1555}
1556
1558 const struct symbol_computed_ops *);
1559
1560extern int register_symbol_block_impl (enum address_class aclass,
1561 const struct symbol_block_ops *ops);
1562
1564 const struct symbol_register_ops *);
1565
1566/* An instance of this type is used to represent a C++ template
1567 function. A symbol is really of this type iff
1568 symbol::is_cplus_template_function is true. */
1569
1571{
1572 /* The number of template arguments. */
1574
1575 /* The template arguments. This is an array with
1576 N_TEMPLATE_ARGUMENTS elements. */
1577 struct symbol **template_arguments = nullptr;
1578};
1579
1580/* A symbol that represents a Rust virtual table object. */
1581
1583{
1584 /* The concrete type for which this vtable was created; that is, in
1585 "impl Trait for Type", this is "Type". */
1586 struct type *concrete_type = nullptr;
1587};
1588
1589
1590/* Each item represents a line-->pc (or the reverse) mapping. This is
1591 somewhat more wasteful of space than one might wish, but since only
1592 the files which are actually debugged are read in to core, we don't
1593 waste much space. */
1594
1596{
1597 /* Set the (unrelocated) PC for this entry. */
1598 void set_unrelocated_pc (unrelocated_addr pc)
1599 { m_pc = pc; }
1600
1601 /* Return the unrelocated PC for this entry. */
1602 unrelocated_addr unrelocated_pc () const
1603 { return m_pc; }
1604
1605 /* Return the relocated PC for this entry. */
1606 CORE_ADDR pc (const struct objfile *objfile) const;
1607
1608 bool operator< (const linetable_entry &other) const
1609 {
1610 if (m_pc == other.m_pc
1611 && (line != 0) != (other.line != 0))
1612 return line == 0;
1613 return m_pc < other.m_pc;
1614 }
1615
1616 /* Two entries are equal if they have the same line and PC. The
1617 other members are ignored. */
1618 bool operator== (const linetable_entry &other) const
1619 { return line == other.line && m_pc == other.m_pc; }
1620
1621 /* The line number for this entry. */
1622 int line;
1623
1624 /* True if this PC is a good location to place a breakpoint for LINE. */
1625 bool is_stmt : 1;
1626
1627 /* True if this location is a good location to place a breakpoint after a
1628 function prologue. */
1630
1631private:
1632
1633 /* The address for this entry. */
1634 unrelocated_addr m_pc;
1635};
1636
1637/* The order of entries in the linetable is significant. They should
1638 be sorted by increasing values of the pc field. If there is more than
1639 one entry for a given pc, then I'm not sure what should happen (and
1640 I not sure whether we currently handle it the best way).
1641
1642 Example: a C for statement generally looks like this
1643
1644 10 0x100 - for the init/test part of a for stmt.
1645 20 0x200
1646 30 0x300
1647 10 0x400 - for the increment part of a for stmt.
1648
1649 If an entry has a line number of zero, it marks the start of a PC
1650 range for which no line number information is available. It is
1651 acceptable, though wasteful of table space, for such a range to be
1652 zero length. */
1653
1655{
1657
1658 /* Actually NITEMS elements. If you don't like this use of the
1659 `struct hack', you can shove it up your ANSI (seriously, if the
1660 committee tells us how to do it, we can probably go along). */
1662};
1663
1664/* How to relocate the symbols from each section in a symbol file.
1665 The ordering and meaning of the offsets is file-type-dependent;
1666 typically it is indexed by section numbers or symbol types or
1667 something like that. */
1668
1669typedef std::vector<CORE_ADDR> section_offsets;
1670
1671/* Each source file or header is represented by a struct symtab.
1672 The name "symtab" is historical, another name for it is "filetab".
1673 These objects are chained through the `next' field. */
1674
1676{
1677 struct compunit_symtab *compunit () const
1678 {
1679 return m_compunit;
1680 }
1681
1683 {
1685 }
1686
1687 const struct linetable *linetable () const
1688 {
1689 return m_linetable;
1690 }
1691
1692 void set_linetable (const struct linetable *linetable)
1693 {
1695 }
1696
1697 enum language language () const
1698 {
1699 return m_language;
1700 }
1701
1703 {
1705 }
1706
1707 /* Unordered chain of all filetabs in the compunit, with the exception
1708 that the "main" source file is the first entry in the list. */
1709
1710 struct symtab *next;
1711
1712 /* Backlink to containing compunit symtab. */
1713
1715
1716 /* Table mapping core addresses to line numbers for this file.
1717 Can be NULL if none. Never shared between different symtabs. */
1718
1719 const struct linetable *m_linetable;
1720
1721 /* Name of this source file, in a form appropriate to print to the user.
1722
1723 This pointer is never nullptr. */
1724
1725 const char *filename;
1726
1727 /* Filename for this source file, used as an identifier to link with
1728 related objects such as associated macro_source_file objects. It must
1729 therefore match the name of any macro_source_file object created for this
1730 source file. The value can be the same as FILENAME if it is known to
1731 follow that rule, or another form of the same file name, this is up to
1732 the specific debug info reader.
1733
1734 This pointer is never nullptr.*/
1735 const char *filename_for_id;
1736
1737 /* Language of this source file. */
1738
1740
1741 /* Full name of file as found by searching the source path.
1742 NULL if not yet known. */
1743
1745};
1746
1747/* A range adapter to allowing iterating over all the file tables in a list. */
1748
1749using symtab_range = next_range<symtab>;
1750
1751/* Compunit symtabs contain the actual "symbol table", aka blockvector, as well
1752 as the list of all source files (what gdb has historically associated with
1753 the term "symtab").
1754 Additional information is recorded here that is common to all symtabs in a
1755 compilation unit (DWARF or otherwise).
1756
1757 Example:
1758 For the case of a program built out of these files:
1759
1760 foo.c
1761 foo1.h
1762 foo2.h
1763 bar.c
1764 foo1.h
1765 bar.h
1766
1767 This is recorded as:
1768
1769 objfile -> foo.c(cu) -> bar.c(cu) -> NULL
1770 | |
1771 v v
1772 foo.c bar.c
1773 | |
1774 v v
1775 foo1.h foo1.h
1776 | |
1777 v v
1778 foo2.h bar.h
1779 | |
1780 v v
1781 NULL NULL
1782
1783 where "foo.c(cu)" and "bar.c(cu)" are struct compunit_symtab objects,
1784 and the files foo.c, etc. are struct symtab objects. */
1785
1787{
1788 struct objfile *objfile () const
1789 {
1790 return m_objfile;
1791 }
1792
1794 {
1796 }
1797
1799 {
1800 return symtab_range (m_filetabs);
1801 }
1802
1803 void add_filetab (symtab *filetab)
1804 {
1805 if (m_filetabs == nullptr)
1806 {
1807 m_filetabs = filetab;
1808 m_last_filetab = filetab;
1809 }
1810 else
1811 {
1812 m_last_filetab->next = filetab;
1813 m_last_filetab = filetab;
1814 }
1815 }
1816
1817 const char *debugformat () const
1818 {
1819 return m_debugformat;
1820 }
1821
1822 void set_debugformat (const char *debugformat)
1823 {
1825 }
1826
1827 const char *producer () const
1828 {
1829 return m_producer;
1830 }
1831
1832 void set_producer (const char *producer)
1833 {
1835 }
1836
1837 const char *dirname () const
1838 {
1839 return m_dirname;
1840 }
1841
1842 void set_dirname (const char *dirname)
1843 {
1845 }
1846
1848 {
1849 return m_blockvector;
1850 }
1851
1852 const struct blockvector *blockvector () const
1853 {
1854 return m_blockvector;
1855 }
1856
1861
1862 bool locations_valid () const
1863 {
1864 return m_locations_valid;
1865 }
1866
1871
1873 {
1875 }
1876
1881
1882 struct macro_table *macro_table () const
1883 {
1884 return m_macro_table;
1885 }
1886
1891
1892 /* Make PRIMARY_FILETAB the primary filetab of this compunit symtab.
1893
1894 PRIMARY_FILETAB must already be a filetab of this compunit symtab. */
1895
1897
1898 /* Return the primary filetab of the compunit. */
1899 symtab *primary_filetab () const;
1900
1901 /* Set m_call_site_htab. */
1902 void set_call_site_htab (htab_t call_site_htab);
1903
1904 /* Find call_site info for PC. */
1905 call_site *find_call_site (CORE_ADDR pc) const;
1906
1907 /* Return the language of this compunit_symtab. */
1908 enum language language () const;
1909
1910 /* Unordered chain of all compunit symtabs of this objfile. */
1912
1913 /* Object file from which this symtab information was read. */
1915
1916 /* Name of the symtab.
1917 This is *not* intended to be a usable filename, and is
1918 for debugging purposes only. */
1919 const char *name;
1920
1921 /* Unordered list of file symtabs, except that by convention the "main"
1922 source file (e.g., .c, .cc) is guaranteed to be first.
1923 Each symtab is a file, either the "main" source file (e.g., .c, .cc)
1924 or header (e.g., .h). */
1926
1927 /* Last entry in FILETABS list.
1928 Subfiles are added to the end of the list so they accumulate in order,
1929 with the main source subfile living at the front.
1930 The main reason is so that the main source file symtab is at the head
1931 of the list, and the rest appear in order for debugging convenience. */
1933
1934 /* Non-NULL string that identifies the format of the debugging information,
1935 such as "stabs", "dwarf 1", "dwarf 2", "coff", etc. This is mostly useful
1936 for automated testing of gdb but may also be information that is
1937 useful to the user. */
1938 const char *m_debugformat;
1939
1940 /* String of producer version information, or NULL if we don't know. */
1941 const char *m_producer;
1942
1943 /* Directory in which it was compiled, or NULL if we don't know. */
1944 const char *m_dirname;
1945
1946 /* List of all symbol scope blocks for this symtab. It is shared among
1947 all symtabs in a given compilation unit. */
1949
1950 /* Symtab has been compiled with both optimizations and debug info so that
1951 GDB may stop skipping prologues as variables locations are valid already
1952 at function entry points. */
1953 unsigned int m_locations_valid : 1;
1954
1955 /* DWARF unwinder for this CU is valid even for epilogues (PC at the return
1956 instruction). This is supported by GCC since 4.5.0. */
1957 unsigned int m_epilogue_unwind_valid : 1;
1958
1959 /* struct call_site entries for this compilation unit or NULL. */
1961
1962 /* The macro table for this symtab. Like the blockvector, this
1963 is shared between different symtabs in a given compilation unit.
1964 It's debatable whether it *should* be shared among all the symtabs in
1965 the given compilation unit, but it currently is. */
1967
1968 /* If non-NULL, then this points to a NULL-terminated vector of
1969 included compunits. When searching the static or global
1970 block of this compunit, the corresponding block of all
1971 included compunits will also be searched. Note that this
1972 list must be flattened -- the symbol reader is responsible for
1973 ensuring that this vector contains the transitive closure of all
1974 included compunits. */
1976
1977 /* If this is an included compunit, this points to one includer
1978 of the table. This user is considered the canonical compunit
1979 containing this one. An included compunit may itself be
1980 included by another. */
1982};
1983
1984using compunit_symtab_range = next_range<compunit_symtab>;
1985
1986/* Return true if this symtab is the "main" symtab of its compunit_symtab. */
1987
1988static inline bool
1993
1994/* Return true if epilogue unwind info of CUST is valid. */
1995
1996static inline bool
1998{
1999 /* In absence of producer information, assume epilogue unwind info is
2000 valid. */
2001 if (cust == nullptr)
2002 return true;
2003
2004 return cust->epilogue_unwind_valid ();
2005}
2006
2007
2008/* The virtual function table is now an array of structures which have the
2009 form { int16 offset, delta; void *pfn; }.
2010
2011 In normal virtual function tables, OFFSET is unused.
2012 DELTA is the amount which is added to the apparent object's base
2013 address in order to point to the actual object to which the
2014 virtual function should be applied.
2015 PFN is a pointer to the virtual function.
2016
2017 Note that this macro is g++ specific (FIXME). */
2018
2019#define VTBL_FNADDR_OFFSET 2
2020
2021/* External variables and functions for the objects described above. */
2022
2023/* True if we are nested inside psymtab_to_symtab. */
2024
2025extern int currently_reading_symtab;
2026
2027/* symtab.c lookup functions */
2028
2029extern const char multiple_symbols_ask[];
2030extern const char multiple_symbols_all[];
2031extern const char multiple_symbols_cancel[];
2032
2033const char *multiple_symbols_select_mode (void);
2034
2035/* lookup a symbol table by source file name. */
2036
2037extern struct symtab *lookup_symtab (const char *);
2038
2039/* An object of this type is passed as the 'is_a_field_of_this'
2040 argument to lookup_symbol and lookup_symbol_in_language. */
2041
2043{
2044 /* The type in which the field was found. If this is NULL then the
2045 symbol was not found in 'this'. If non-NULL, then one of the
2046 other fields will be non-NULL as well. */
2047
2048 struct type *type;
2049
2050 /* If the symbol was found as an ordinary field of 'this', then this
2051 is non-NULL and points to the particular field. */
2052
2053 struct field *field;
2054
2055 /* If the symbol was found as a function field of 'this', then this
2056 is non-NULL and points to the particular field. */
2057
2059};
2060
2061/* Find the definition for a specified symbol name NAME
2062 in domain DOMAIN in language LANGUAGE, visible from lexical block BLOCK
2063 if non-NULL or from global/static blocks if BLOCK is NULL.
2064 Returns the struct symbol pointer, or NULL if no symbol is found.
2065 C++: if IS_A_FIELD_OF_THIS is non-NULL on entry, check to see if
2066 NAME is a field of the current implied argument `this'. If so fill in the
2067 fields of IS_A_FIELD_OF_THIS, otherwise the fields are set to NULL.
2068 The symbol's section is fixed up if necessary. */
2069
2070extern struct block_symbol
2071 lookup_symbol_in_language (const char *,
2072 const struct block *,
2073 const domain_enum,
2074 enum language,
2075 struct field_of_this_result *);
2076
2077/* Same as lookup_symbol_in_language, but using the current language. */
2078
2079extern struct block_symbol lookup_symbol (const char *,
2080 const struct block *,
2081 const domain_enum,
2082 struct field_of_this_result *);
2083
2084/* Find the definition for a specified symbol search name in domain
2085 DOMAIN, visible from lexical block BLOCK if non-NULL or from
2086 global/static blocks if BLOCK is NULL. The passed-in search name
2087 should not come from the user; instead it should already be a
2088 search name as retrieved from a search_name () call. See definition of
2089 symbol_name_match_type::SEARCH_NAME. Returns the struct symbol
2090 pointer, or NULL if no symbol is found. The symbol's section is
2091 fixed up if necessary. */
2092
2093extern struct block_symbol lookup_symbol_search_name (const char *search_name,
2094 const struct block *block,
2095 domain_enum domain);
2096
2097/* Some helper functions for languages that need to write their own
2098 lookup_symbol_nonlocal functions. */
2099
2100/* Lookup a symbol in the static block associated to BLOCK, if there
2101 is one; do nothing if BLOCK is NULL or a global block.
2102 Upon success fixes up the symbol's section if necessary. */
2103
2104extern struct block_symbol
2106 const struct block *block,
2107 const domain_enum domain);
2108
2109/* Search all static file-level symbols for NAME from DOMAIN.
2110 Upon success fixes up the symbol's section if necessary. */
2111
2112extern struct block_symbol lookup_static_symbol (const char *name,
2113 const domain_enum domain);
2114
2115/* Lookup a symbol in all files' global blocks.
2116
2117 If BLOCK is non-NULL then it is used for two things:
2118 1) If a target-specific lookup routine for libraries exists, then use the
2119 routine for the objfile of BLOCK, and
2120 2) The objfile of BLOCK is used to assist in determining the search order
2121 if the target requires it.
2122 See gdbarch_iterate_over_objfiles_in_search_order.
2123
2124 Upon success fixes up the symbol's section if necessary. */
2125
2126extern struct block_symbol
2127 lookup_global_symbol (const char *name,
2128 const struct block *block,
2129 const domain_enum domain);
2130
2131/* Lookup a symbol in block BLOCK.
2132 Upon success fixes up the symbol's section if necessary. */
2133
2134extern struct symbol *
2135 lookup_symbol_in_block (const char *name,
2136 symbol_name_match_type match_type,
2137 const struct block *block,
2138 const domain_enum domain);
2139
2140/* Look up the `this' symbol for LANG in BLOCK. Return the symbol if
2141 found, or NULL if not found. */
2142
2143extern struct block_symbol
2144 lookup_language_this (const struct language_defn *lang,
2145 const struct block *block);
2146
2147/* Lookup a [struct, union, enum] by name, within a specified block. */
2148
2149extern struct type *lookup_struct (const char *, const struct block *);
2150
2151extern struct type *lookup_union (const char *, const struct block *);
2152
2153extern struct type *lookup_enum (const char *, const struct block *);
2154
2155/* from blockframe.c: */
2156
2157/* lookup the function symbol corresponding to the address. The
2158 return value will not be an inlined function; the containing
2159 function will be returned instead. */
2160
2161extern struct symbol *find_pc_function (CORE_ADDR);
2162
2163/* lookup the function corresponding to the address and section. The
2164 return value will not be an inlined function; the containing
2165 function will be returned instead. */
2166
2167extern struct symbol *find_pc_sect_function (CORE_ADDR, struct obj_section *);
2168
2169/* lookup the function symbol corresponding to the address and
2170 section. The return value will be the closest enclosing function,
2171 which might be an inline function. */
2172
2174 (CORE_ADDR pc, struct obj_section *section);
2175
2176/* Find the symbol at the given address. Returns NULL if no symbol
2177 found. Only exact matches for ADDRESS are considered. */
2178
2179extern struct symbol *find_symbol_at_address (CORE_ADDR);
2180
2181/* Finds the "function" (text symbol) that is smaller than PC but
2182 greatest of all of the potential text symbols in SECTION. Sets
2183 *NAME and/or *ADDRESS conditionally if that pointer is non-null.
2184 If ENDADDR is non-null, then set *ENDADDR to be the end of the
2185 function (exclusive). If the optional parameter BLOCK is non-null,
2186 then set *BLOCK to the address of the block corresponding to the
2187 function symbol, if such a symbol could be found during the lookup;
2188 nullptr is used as a return value for *BLOCK if no block is found.
2189 This function either succeeds or fails (not halfway succeeds). If
2190 it succeeds, it sets *NAME, *ADDRESS, and *ENDADDR to real
2191 information and returns true. If it fails, it sets *NAME, *ADDRESS
2192 and *ENDADDR to zero and returns false.
2193
2194 If the function in question occupies non-contiguous ranges,
2195 *ADDRESS and *ENDADDR are (subject to the conditions noted above) set
2196 to the start and end of the range in which PC is found. Thus
2197 *ADDRESS <= PC < *ENDADDR with no intervening gaps (in which ranges
2198 from other functions might be found).
2199
2200 This property allows find_pc_partial_function to be used (as it had
2201 been prior to the introduction of non-contiguous range support) by
2202 various tdep files for finding a start address and limit address
2203 for prologue analysis. This still isn't ideal, however, because we
2204 probably shouldn't be doing prologue analysis (in which
2205 instructions are scanned to determine frame size and stack layout)
2206 for any range that doesn't contain the entry pc. Moreover, a good
2207 argument can be made that prologue analysis ought to be performed
2208 starting from the entry pc even when PC is within some other range.
2209 This might suggest that *ADDRESS and *ENDADDR ought to be set to the
2210 limits of the entry pc range, but that will cause the
2211 *ADDRESS <= PC < *ENDADDR condition to be violated; many of the
2212 callers of find_pc_partial_function expect this condition to hold.
2213
2214 Callers which require the start and/or end addresses for the range
2215 containing the entry pc should instead call
2216 find_function_entry_range_from_pc. */
2217
2218extern bool find_pc_partial_function (CORE_ADDR pc, const char **name,
2219 CORE_ADDR *address, CORE_ADDR *endaddr,
2220 const struct block **block = nullptr);
2221
2222/* Like find_pc_partial_function, above, but returns the underlying
2223 general_symbol_info (rather than the name) as an out parameter. */
2224
2226 (CORE_ADDR pc, const general_symbol_info **sym,
2227 CORE_ADDR *address, CORE_ADDR *endaddr,
2228 const struct block **block = nullptr);
2229
2230/* Like find_pc_partial_function, above, but *ADDRESS and *ENDADDR are
2231 set to start and end addresses of the range containing the entry pc.
2232
2233 Note that it is not necessarily the case that (for non-NULL ADDRESS
2234 and ENDADDR arguments) the *ADDRESS <= PC < *ENDADDR condition will
2235 hold.
2236
2237 See comment for find_pc_partial_function, above, for further
2238 explanation. */
2239
2240extern bool find_function_entry_range_from_pc (CORE_ADDR pc,
2241 const char **name,
2242 CORE_ADDR *address,
2243 CORE_ADDR *endaddr);
2244
2245/* Return the type of a function with its first instruction exactly at
2246 the PC address. Return NULL otherwise. */
2247
2248extern struct type *find_function_type (CORE_ADDR pc);
2249
2250/* See if we can figure out the function's actual type from the type
2251 that the resolver returns. RESOLVER_FUNADDR is the address of the
2252 ifunc resolver. */
2253
2254extern struct type *find_gnu_ifunc_target_type (CORE_ADDR resolver_funaddr);
2255
2256/* Find the GNU ifunc minimal symbol that matches SYM. */
2257extern bound_minimal_symbol find_gnu_ifunc (const symbol *sym);
2258
2259extern void clear_pc_function_cache (void);
2260
2261/* lookup full symbol table by address. */
2262
2263extern struct compunit_symtab *find_pc_compunit_symtab (CORE_ADDR);
2264
2265/* lookup full symbol table by address and section. */
2266
2267extern struct compunit_symtab *
2268 find_pc_sect_compunit_symtab (CORE_ADDR, struct obj_section *);
2269
2270extern bool find_pc_line_pc_range (CORE_ADDR, CORE_ADDR *, CORE_ADDR *);
2271
2272extern void reread_symbols (int from_tty);
2273
2274/* Look up a type named NAME in STRUCT_DOMAIN in the current language.
2275 The type returned must not be opaque -- i.e., must have at least one field
2276 defined. */
2277
2278extern struct type *lookup_transparent_type (const char *);
2279
2280extern struct type *basic_lookup_transparent_type (const char *);
2281
2282/* Macro for name of symbol to indicate a file compiled with gcc. */
2283#ifndef GCC_COMPILED_FLAG_SYMBOL
2284#define GCC_COMPILED_FLAG_SYMBOL "gcc_compiled."
2285#endif
2286
2287/* Macro for name of symbol to indicate a file compiled with gcc2. */
2288#ifndef GCC2_COMPILED_FLAG_SYMBOL
2289#define GCC2_COMPILED_FLAG_SYMBOL "gcc2_compiled."
2290#endif
2291
2292extern bool in_gnu_ifunc_stub (CORE_ADDR pc);
2293
2294/* Functions for resolving STT_GNU_IFUNC symbols which are implemented only
2295 for ELF symbol files. */
2296
2298{
2299 /* See elf_gnu_ifunc_resolve_addr for its real implementation. */
2300 CORE_ADDR (*gnu_ifunc_resolve_addr) (struct gdbarch *gdbarch, CORE_ADDR pc);
2301
2302 /* See elf_gnu_ifunc_resolve_name for its real implementation. */
2303 bool (*gnu_ifunc_resolve_name) (const char *function_name,
2304 CORE_ADDR *function_address_p);
2305
2306 /* See elf_gnu_ifunc_resolver_stop for its real implementation. */
2308
2309 /* See elf_gnu_ifunc_resolver_return_stop for its real implementation. */
2311};
2312
2313#define gnu_ifunc_resolve_addr gnu_ifunc_fns_p->gnu_ifunc_resolve_addr
2314#define gnu_ifunc_resolve_name gnu_ifunc_fns_p->gnu_ifunc_resolve_name
2315#define gnu_ifunc_resolver_stop gnu_ifunc_fns_p->gnu_ifunc_resolver_stop
2316#define gnu_ifunc_resolver_return_stop \
2317 gnu_ifunc_fns_p->gnu_ifunc_resolver_return_stop
2318
2319extern const struct gnu_ifunc_fns *gnu_ifunc_fns_p;
2320
2321extern CORE_ADDR find_solib_trampoline_target (frame_info_ptr, CORE_ADDR);
2322
2324{
2325 /* The program space of this sal. */
2326 struct program_space *pspace = NULL;
2327
2328 struct symtab *symtab = NULL;
2329 struct symbol *symbol = NULL;
2330 struct obj_section *section = NULL;
2331 struct minimal_symbol *msymbol = NULL;
2332 /* Line number. Line numbers start at 1 and proceed through symtab->nlines.
2333 0 is never a valid line number; it is used to indicate that line number
2334 information is not available. */
2335 int line = 0;
2336
2337 CORE_ADDR pc = 0;
2338 CORE_ADDR end = 0;
2339 bool explicit_pc = false;
2340 bool explicit_line = false;
2341
2342 /* If the line number information is valid, then this indicates if this
2343 line table entry had the is-stmt flag set or not. */
2344 bool is_stmt = false;
2345
2346 /* The probe associated with this symtab_and_line. */
2347 probe *prob = NULL;
2348 /* If PROBE is not NULL, then this is the objfile in which the probe
2349 originated. */
2350 struct objfile *objfile = NULL;
2351};
2352
2353
2354
2355/* Given a pc value, return line number it is in. Second arg nonzero means
2356 if pc is on the boundary use the previous statement's line number. */
2357
2358extern struct symtab_and_line find_pc_line (CORE_ADDR, int);
2359
2360/* Same function, but specify a section as well as an address. */
2361
2362extern struct symtab_and_line find_pc_sect_line (CORE_ADDR,
2363 struct obj_section *, int);
2364
2365/* Wrapper around find_pc_line to just return the symtab. */
2366
2367extern struct symtab *find_pc_line_symtab (CORE_ADDR);
2368
2369/* Given a symtab and line number, return the pc there. */
2370
2371extern bool find_line_pc (struct symtab *, int, CORE_ADDR *);
2372
2373extern bool find_line_pc_range (struct symtab_and_line, CORE_ADDR *,
2374 CORE_ADDR *);
2375
2376extern void resolve_sal_pc (struct symtab_and_line *);
2377
2378/* solib.c */
2379
2380extern void clear_solib (void);
2381
2382/* The reason we're calling into a completion match list collector
2383 function. */
2385 {
2386 /* Completing an expression. */
2387 EXPRESSION,
2388
2389 /* Completing a linespec. */
2390 LINESPEC,
2391 };
2392
2394 (completion_tracker &tracker,
2396 symbol_name_match_type name_match_type,
2397 const char *text, const char *word, const char *break_on,
2398 enum type_code code);
2400 (completion_tracker &tracker,
2402 symbol_name_match_type name_match_type,
2403 const char *, const char *);
2405 const char *, const char *,
2406 enum type_code);
2407
2409 (completion_tracker &tracker,
2411 symbol_name_match_type name_match_type,
2412 const char *, const char *, const char *);
2413
2414extern completion_list
2415 make_source_files_completion_list (const char *, const char *);
2416
2417/* Return whether SYM is a function/method, as opposed to a data symbol. */
2418
2419extern bool symbol_is_function_or_method (symbol *sym);
2420
2421/* Return whether MSYMBOL is a function/method, as opposed to a data
2422 symbol */
2423
2424extern bool symbol_is_function_or_method (minimal_symbol *msymbol);
2425
2426/* Return whether SYM should be skipped in completion mode MODE. In
2427 linespec mode, we're only interested in functions/methods. */
2428
2429template<typename Symbol>
2430static bool
2432{
2433 return (mode == complete_symbol_mode::LINESPEC
2435}
2436
2437/* symtab.c */
2438
2439bool matching_obj_sections (struct obj_section *, struct obj_section *);
2440
2441extern struct symtab *find_line_symtab (struct symtab *, int, int *, bool *);
2442
2443/* Given a function symbol SYM, find the symtab and line for the start
2444 of the function. If FUNFIRSTLINE is true, we want the first line
2445 of real code inside the function. */
2447 funfirstline);
2448
2449/* Same, but start with a function address/section instead of a
2450 symbol. */
2451extern symtab_and_line find_function_start_sal (CORE_ADDR func_addr,
2452 obj_section *section,
2453 bool funfirstline);
2454
2455extern void skip_prologue_sal (struct symtab_and_line *);
2456
2457/* symtab.c */
2458
2459extern CORE_ADDR skip_prologue_using_sal (struct gdbarch *gdbarch,
2460 CORE_ADDR func_addr);
2461
2462/* If SYM requires a section index, find it either via minimal symbols
2463 or examining OBJFILE's sections. Note that SYM's current address
2464 must not have any runtime offsets applied. */
2465
2466extern void fixup_symbol_section (struct symbol *sym,
2467 struct objfile *objfile);
2468
2469/* If MSYMBOL is an text symbol, look for a function debug symbol with
2470 the same address. Returns NULL if not found. This is necessary in
2471 case a function is an alias to some other function, because debug
2472 information is only emitted for the alias target function's
2473 definition, not for the alias. */
2475
2476/* Symbol searching */
2477
2478/* When using the symbol_searcher struct to search for symbols, a vector of
2479 the following structs is returned. */
2481{
2482 symbol_search (block_enum block_, struct symbol *symbol_)
2483 : block (block_),
2484 symbol (symbol_)
2485 {
2486 msymbol.minsym = nullptr;
2487 msymbol.objfile = nullptr;
2488 }
2489
2490 symbol_search (block_enum block_, struct minimal_symbol *minsym,
2491 struct objfile *objfile)
2492 : block (block_),
2493 symbol (nullptr)
2494 {
2495 msymbol.minsym = minsym;
2497 }
2498
2499 bool operator< (const symbol_search &other) const
2500 {
2501 return compare_search_syms (*this, other) < 0;
2502 }
2503
2504 bool operator== (const symbol_search &other) const
2505 {
2506 return compare_search_syms (*this, other) == 0;
2507 }
2508
2509 /* The block in which the match was found. Either STATIC_BLOCK or
2510 GLOBAL_BLOCK. */
2512
2513 /* Information describing what was found.
2514
2515 If symbol is NOT NULL, then information was found for this match. */
2517
2518 /* If msymbol is non-null, then a match was made on something for
2519 which only minimal_symbols exist. */
2521
2522private:
2523
2524 static int compare_search_syms (const symbol_search &sym_a,
2525 const symbol_search &sym_b);
2526};
2527
2528/* In order to search for global symbols of a particular kind matching
2529 particular regular expressions, create an instance of this structure and
2530 call the SEARCH member function. */
2532{
2533public:
2534
2535 /* Constructor. */
2537 const char *symbol_name_regexp)
2538 : m_kind (kind),
2539 m_symbol_name_regexp (symbol_name_regexp)
2540 {
2541 /* The symbol searching is designed to only find one kind of thing. */
2542 gdb_assert (m_kind != ALL_DOMAIN);
2543 }
2544
2545 /* Set the optional regexp that matches against the symbol type. */
2546 void set_symbol_type_regexp (const char *regexp)
2547 {
2548 m_symbol_type_regexp = regexp;
2549 }
2550
2551 /* Set the flag to exclude minsyms from the search results. */
2552 void set_exclude_minsyms (bool exclude_minsyms)
2553 {
2554 m_exclude_minsyms = exclude_minsyms;
2555 }
2556
2557 /* Set the maximum number of search results to be returned. */
2558 void set_max_search_results (size_t max_search_results)
2559 {
2560 m_max_search_results = max_search_results;
2561 }
2562
2563 /* Search the symbols from all objfiles in the current program space
2564 looking for matches as defined by the current state of this object.
2565
2566 Within each file the results are sorted locally; each symtab's global
2567 and static blocks are separately alphabetized. Duplicate entries are
2568 removed. */
2569 std::vector<symbol_search> search () const;
2570
2571 /* The set of source files to search in for matching symbols. This is
2572 currently public so that it can be populated after this object has
2573 been constructed. */
2574 std::vector<const char *> filenames;
2575
2576private:
2577 /* The kind of symbols are we searching for.
2578 VARIABLES_DOMAIN - Search all symbols, excluding functions, type
2579 names, and constants (enums).
2580 FUNCTIONS_DOMAIN - Search all functions..
2581 TYPES_DOMAIN - Search all type names.
2582 MODULES_DOMAIN - Search all Fortran modules.
2583 ALL_DOMAIN - Not valid for this function. */
2585
2586 /* Regular expression to match against the symbol name. */
2587 const char *m_symbol_name_regexp = nullptr;
2588
2589 /* Regular expression to match against the symbol type. */
2590 const char *m_symbol_type_regexp = nullptr;
2591
2592 /* When this flag is false then minsyms that match M_SYMBOL_REGEXP will
2593 be included in the results, otherwise they are excluded. */
2594 bool m_exclude_minsyms = false;
2595
2596 /* Maximum number of search results. We currently impose a hard limit
2597 of SIZE_MAX, there is no "unlimited". */
2599
2600 /* Expand symtabs in OBJFILE that match PREG, are of type M_KIND. Return
2601 true if any msymbols were seen that we should later consider adding to
2602 the results list. */
2604 const gdb::optional<compiled_regex> &preg) const;
2605
2606 /* Add symbols from symtabs in OBJFILE that match PREG, and TREG, and are
2607 of type M_KIND, to the results set RESULTS_SET. Return false if we
2608 stop adding results early due to having already found too many results
2609 (based on M_MAX_SEARCH_RESULTS limit), otherwise return true.
2610 Returning true does not indicate that any results were added, just
2611 that we didn't _not_ add a result due to reaching MAX_SEARCH_RESULTS. */
2613 const gdb::optional<compiled_regex> &preg,
2614 const gdb::optional<compiled_regex> &treg,
2615 std::set<symbol_search> *result_set) const;
2616
2617 /* Add msymbols from OBJFILE that match PREG and M_KIND, to the results
2618 vector RESULTS. Return false if we stop adding results early due to
2619 having already found too many results (based on max search results
2620 limit M_MAX_SEARCH_RESULTS), otherwise return true. Returning true
2621 does not indicate that any results were added, just that we didn't
2622 _not_ add a result due to reaching MAX_SEARCH_RESULTS. */
2624 const gdb::optional<compiled_regex> &preg,
2625 std::vector<symbol_search> *results) const;
2626
2627 /* Return true if MSYMBOL is of type KIND. */
2628 static bool is_suitable_msymbol (const enum search_domain kind,
2629 const minimal_symbol *msymbol);
2630};
2631
2632/* When searching for Fortran symbols within modules (functions/variables)
2633 we return a vector of this type. The first item in the pair is the
2634 module symbol, and the second item is the symbol for the function or
2635 variable we found. */
2636typedef std::pair<symbol_search, symbol_search> module_symbol_search;
2637
2638/* Searches the symbols to find function and variables symbols (depending
2639 on KIND) within Fortran modules. The MODULE_REGEXP matches against the
2640 name of the module, REGEXP matches against the name of the symbol within
2641 the module, and TYPE_REGEXP matches against the type of the symbol
2642 within the module. */
2643extern std::vector<module_symbol_search> search_module_symbols
2644 (const char *module_regexp, const char *regexp,
2645 const char *type_regexp, search_domain kind);
2646
2647/* Convert a global or static symbol SYM (based on BLOCK, which should be
2648 either GLOBAL_BLOCK or STATIC_BLOCK) into a string for use in 'info'
2649 type commands (e.g. 'info variables', 'info functions', etc). KIND is
2650 the type of symbol that was searched for which gave us SYM. */
2651
2652extern std::string symbol_to_info_string (struct symbol *sym, int block,
2653 enum search_domain kind);
2654
2655extern bool treg_matches_sym_type_name (const compiled_regex &treg,
2656 const struct symbol *sym);
2657
2658/* The name of the ``main'' function. */
2659extern const char *main_name ();
2660extern enum language main_language (void);
2661
2662/* Lookup symbol NAME from DOMAIN in MAIN_OBJFILE's global or static blocks,
2663 as specified by BLOCK_INDEX.
2664 This searches MAIN_OBJFILE as well as any associated separate debug info
2665 objfiles of MAIN_OBJFILE.
2666 BLOCK_INDEX can be GLOBAL_BLOCK or STATIC_BLOCK.
2667 Upon success fixes up the symbol's section if necessary. */
2668
2669extern struct block_symbol
2670 lookup_global_symbol_from_objfile (struct objfile *main_objfile,
2671 enum block_enum block_index,
2672 const char *name,
2673 const domain_enum domain);
2674
2675/* Return 1 if the supplied producer string matches the ARM RealView
2676 compiler (armcc). */
2677bool producer_is_realview (const char *producer);
2678
2679extern unsigned int symtab_create_debug;
2680
2681/* Print a "symtab-create" debug statement. */
2682
2683#define symtab_create_debug_printf(fmt, ...) \
2684 debug_prefixed_printf_cond (symtab_create_debug >= 1, "symtab-create", fmt, ##__VA_ARGS__)
2685
2686/* Print a verbose "symtab-create" debug statement, only if
2687 "set debug symtab-create" is set to 2 or higher. */
2688
2689#define symtab_create_debug_printf_v(fmt, ...) \
2690 debug_prefixed_printf_cond (symtab_create_debug >= 2, "symtab-create", fmt, ##__VA_ARGS__)
2691
2692extern unsigned int symbol_lookup_debug;
2693
2694/* Return true if symbol-lookup debug is turned on at all. */
2695
2696static inline bool
2698{
2699 return symbol_lookup_debug > 0;
2700}
2701
2702/* Return true if symbol-lookup debug is turned to verbose mode. */
2703
2704static inline bool
2709
2710/* Print a "symbol-lookup" debug statement if symbol_lookup_debug is >= 1. */
2711
2712#define symbol_lookup_debug_printf(fmt, ...) \
2713 debug_prefixed_printf_cond (symbol_lookup_debug_enabled (), \
2714 "symbol-lookup", fmt, ##__VA_ARGS__)
2715
2716/* Print a "symbol-lookup" debug statement if symbol_lookup_debug is >= 2. */
2717
2718#define symbol_lookup_debug_printf_v(fmt, ...) \
2719 debug_prefixed_printf_cond (symbol_lookup_debug_enabled_v (), \
2720 "symbol-lookup", fmt, ##__VA_ARGS__)
2721
2722/* Print "symbol-lookup" enter/exit debug statements. */
2723
2724#define SYMBOL_LOOKUP_SCOPED_DEBUG_ENTER_EXIT \
2725 scoped_debug_enter_exit (symbol_lookup_debug_enabled, "symbol-lookup")
2726
2727extern bool basenames_may_differ;
2728
2729bool compare_filenames_for_search (const char *filename,
2730 const char *search_name);
2731
2732bool compare_glob_filenames_for_search (const char *filename,
2733 const char *search_name);
2734
2735bool iterate_over_some_symtabs (const char *name,
2736 const char *real_path,
2737 struct compunit_symtab *first,
2738 struct compunit_symtab *after_last,
2739 gdb::function_view<bool (symtab *)> callback);
2740
2741void iterate_over_symtabs (const char *name,
2742 gdb::function_view<bool (symtab *)> callback);
2743
2744
2745std::vector<CORE_ADDR> find_pcs_for_symtab_line
2746 (struct symtab *symtab, int line, const linetable_entry **best_entry);
2747
2748/* Prototype for callbacks for LA_ITERATE_OVER_SYMBOLS. The callback
2749 is called once per matching symbol SYM. The callback should return
2750 true to indicate that LA_ITERATE_OVER_SYMBOLS should continue
2751 iterating, or false to indicate that the iteration should end. */
2752
2753typedef bool (symbol_found_callback_ftype) (struct block_symbol *bsym);
2754
2755/* Iterate over the symbols named NAME, matching DOMAIN, in BLOCK.
2756
2757 For each symbol that matches, CALLBACK is called. The symbol is
2758 passed to the callback.
2759
2760 If CALLBACK returns false, the iteration ends and this function
2761 returns false. Otherwise, the search continues, and the function
2762 eventually returns true. */
2763
2764bool iterate_over_symbols (const struct block *block,
2765 const lookup_name_info &name,
2766 const domain_enum domain,
2767 gdb::function_view<symbol_found_callback_ftype> callback);
2768
2769/* Like iterate_over_symbols, but if all calls to CALLBACK return
2770 true, then calls CALLBACK one additional time with a block_symbol
2771 that has a valid block but a NULL symbol. */
2772
2774 (const struct block *block,
2775 const lookup_name_info &name,
2776 const domain_enum domain,
2777 gdb::function_view<symbol_found_callback_ftype> callback);
2778
2779/* Storage type used by demangle_for_lookup. demangle_for_lookup
2780 either returns a const char * pointer that points to either of the
2781 fields of this type, or a pointer to the input NAME. This is done
2782 this way to avoid depending on the precise details of the storage
2783 for the string. */
2785{
2786public:
2787
2788 /* Swap the malloc storage to STR, and return a pointer to the
2789 beginning of the new string. */
2790 const char *set_malloc_ptr (gdb::unique_xmalloc_ptr<char> &&str)
2791 {
2792 m_malloc = std::move (str);
2793 return m_malloc.get ();
2794 }
2795
2796 /* Set the malloc storage to now point at PTR. Any previous malloc
2797 storage is released. */
2798 const char *set_malloc_ptr (char *ptr)
2799 {
2800 m_malloc.reset (ptr);
2801 return ptr;
2802 }
2803
2804private:
2805
2806 /* The storage. */
2807 gdb::unique_xmalloc_ptr<char> m_malloc;
2808};
2809
2810const char *
2811 demangle_for_lookup (const char *name, enum language lang,
2812 demangle_result_storage &storage);
2813
2814/* Test to see if the symbol of language SYMBOL_LANGUAGE specified by
2815 SYMNAME (which is already demangled for C++ symbols) matches
2816 SYM_TEXT in the first SYM_TEXT_LEN characters. If so, add it to
2817 the current completion list and return true. Otherwise, return
2818 false. */
2820 language symbol_language,
2821 const char *symname,
2822 const lookup_name_info &lookup_name,
2823 const char *text, const char *word);
2824
2825/* A simple symbol searching class. */
2826
2828{
2829public:
2830 /* Returns the symbols found for the search. */
2831 const std::vector<block_symbol> &
2833 {
2834 return m_symbols;
2835 }
2836
2837 /* Returns the minimal symbols found for the search. */
2838 const std::vector<bound_minimal_symbol> &
2840 {
2841 return m_minimal_symbols;
2842 }
2843
2844 /* Search for all symbols named NAME in LANGUAGE with DOMAIN, restricting
2845 search to FILE_SYMTABS and SEARCH_PSPACE, both of which may be NULL
2846 to search all symtabs and program spaces. */
2847 void find_all_symbols (const std::string &name,
2848 const struct language_defn *language,
2850 std::vector<symtab *> *search_symtabs,
2851 struct program_space *search_pspace);
2852
2853 /* Reset this object to perform another search. */
2854 void reset ()
2855 {
2856 m_symbols.clear ();
2857 m_minimal_symbols.clear ();
2858 }
2859
2860private:
2861 /* Matching debug symbols. */
2862 std::vector<block_symbol> m_symbols;
2863
2864 /* Matching non-debug symbols. */
2865 std::vector<bound_minimal_symbol> m_minimal_symbols;
2866};
2867
2868/* Class used to encapsulate the filename filtering for the "info sources"
2869 command. */
2870
2872{
2873 /* If filename filtering is being used (see M_C_REGEXP) then which part
2874 of the filename is being filtered against? */
2875 enum class match_on
2876 {
2877 /* Match against the full filename. */
2878 FULLNAME,
2879
2880 /* Match only against the directory part of the full filename. */
2881 DIRNAME,
2882
2883 /* Match only against the basename part of the full filename. */
2884 BASENAME
2885 };
2886
2887 /* Create a filter of MATCH_TYPE using regular expression REGEXP. If
2888 REGEXP is nullptr then all files will match the filter and MATCH_TYPE
2889 is ignored.
2890
2891 The string pointed too by REGEXP must remain live and unchanged for
2892 this lifetime of this object as the object only retains a copy of the
2893 pointer. */
2894 info_sources_filter (match_on match_type, const char *regexp);
2895
2897
2898 /* Does FULLNAME match the filter defined by this object, return true if
2899 it does, otherwise, return false. If there is no filtering defined
2900 then this function will always return true. */
2901 bool matches (const char *fullname) const;
2902
2903private:
2904
2905 /* The type of filtering in place. */
2907
2908 /* Points to the original regexp used to create this filter. */
2909 const char *m_regexp;
2910
2911 /* A compiled version of M_REGEXP. This object is only given a value if
2912 M_REGEXP is not nullptr and is not the empty string. */
2913 gdb::optional<compiled_regex> m_c_regexp;
2914};
2915
2916/* Perform the core of the 'info sources' command.
2917
2918 FILTER is used to perform regular expression based filtering on the
2919 source files that will be displayed.
2920
2921 Output is written to UIOUT in CLI or MI style as appropriate. */
2922
2923extern void info_sources_worker (struct ui_out *uiout,
2924 bool group_by_objfile,
2925 const info_sources_filter &filter);
2926
2927#endif /* !defined(SYMTAB_H) */
const char *const name
#define SIZE_MAX
Definition ada-lex.c:87
int code
Definition ada-lex.l:670
bool verbatim_p() const
Definition symtab.h:124
bool matches(const char *symbol_search_name, symbol_name_match_type match_type, completion_match_result *comp_match_res) const
Definition ada-lang.c:6163
const std::string & lookup_name() const
Definition symtab.h:110
bool standard_p() const
Definition symtab.h:120
bool wild_match_p() const
Definition symtab.h:115
ada_lookup_name_info(const lookup_name_info &lookup_name)
Definition ada-lang.c:13250
std::string m_encoded_name
Definition symtab.h:144
std::vector< gdb::string_view > split_name() const
Definition symtab.h:129
gdb::unique_xmalloc_ptr< char > m_malloc
Definition symtab.h:2807
const char * set_malloc_ptr(gdb::unique_xmalloc_ptr< char > &&str)
Definition symtab.h:2790
const char * set_malloc_ptr(char *ptr)
Definition symtab.h:2798
const char * m_symbol_name_regexp
Definition symtab.h:2587
std::vector< symbol_search > search() const
Definition symtab.c:4860
void set_exclude_minsyms(bool exclude_minsyms)
Definition symtab.h:2552
const char * m_symbol_type_regexp
Definition symtab.h:2590
void set_max_search_results(size_t max_search_results)
Definition symtab.h:2558
static bool is_suitable_msymbol(const enum search_domain kind, const minimal_symbol *msymbol)
Definition symtab.c:4631
enum search_domain m_kind
Definition symtab.h:2584
global_symbol_searcher(enum search_domain kind, const char *symbol_name_regexp)
Definition symtab.h:2536
void set_symbol_type_regexp(const char *regexp)
Definition symtab.h:2546
bool add_matching_msymbols(objfile *objfile, const gdb::optional< compiled_regex > &preg, std::vector< symbol_search > *results) const
Definition symtab.c:4815
bool add_matching_symbols(objfile *objfile, const gdb::optional< compiled_regex > &preg, const gdb::optional< compiled_regex > &treg, std::set< symbol_search > *result_set) const
Definition symtab.c:4735
bool expand_symtabs(objfile *objfile, const gdb::optional< compiled_regex > &preg) const
Definition symtab.c:4654
std::vector< const char * > filenames
Definition symtab.h:2574
size_t m_max_search_results
Definition symtab.h:2598
bool m_completion_mode
Definition symtab.h:357
unsigned int search_name_hash(language lang) const
Definition symtab.h:263
const demangle_for_lookup_info & go() const
Definition symtab.h:336
static const lookup_name_info & match_any()
Definition symtab.c:1861
void maybe_init(Field &field, Args &&... args) const
Definition symtab.h:349
const char * c_str() const
Definition symtab.h:246
std::vector< gdb::string_view > split_name(language lang) const
Definition symtab.h:295
gdb::optional< ada_lookup_name_info > m_ada
Definition symtab.h:367
gdb::optional< demangle_for_lookup_info > m_cplus
Definition symtab.h:368
std::array< bool, nr_languages > m_demangled_hashes_p
Definition symtab.h:378
bool m_ignore_parameters
Definition symtab.h:358
lookup_name_info(const std::string &name, symbol_name_match_type match_type, bool completion_mode=false, bool ignore_parameters=false)
Definition symtab.h:216
symbol_name_match_type m_match_type
Definition symtab.h:356
gdb::optional< demangle_for_lookup_info > m_go
Definition symtab.h:370
const ada_lookup_name_info & ada() const
Definition symtab.h:315
const char * language_lookup_name(language lang) const
Definition symtab.h:276
const demangle_for_lookup_info & cplus() const
Definition symtab.h:322
gdb::string_view m_name
Definition symtab.h:359
const demangle_for_lookup_info & d() const
Definition symtab.h:329
lookup_name_info(const char *name, symbol_name_match_type match_type, bool completion_mode=false, bool ignore_parameters=false)
Definition symtab.h:228
std::array< unsigned int, nr_languages > m_demangled_hashes
Definition symtab.h:377
symbol_name_match_type match_type() const
Definition symtab.h:239
const bool ignore_parameters() const
Definition symtab.h:242
lookup_name_info(std::string &&name, symbol_name_match_type match_type, bool completion_mode=false, bool ignore_parameters=false)=delete
lookup_name_info make_ignore_params() const
Definition symtab.h:256
gdb::string_view name() const
Definition symtab.h:241
gdb::optional< demangle_for_lookup_info > m_d
Definition symtab.h:369
bool completion_mode() const
Definition symtab.h:240
Definition probe.h:115
std::vector< block_symbol > m_symbols
Definition symtab.h:2862
const std::vector< block_symbol > & matching_symbols() const
Definition symtab.h:2832
void find_all_symbols(const std::string &name, const struct language_defn *language, enum search_domain search_domain, std::vector< symtab * > *search_symtabs, struct program_space *search_pspace)
Definition linespec.c:3746
const std::vector< bound_minimal_symbol > & matching_msymbols() const
Definition symtab.h:2839
std::vector< bound_minimal_symbol > m_minimal_symbols
Definition symtab.h:2865
std::vector< gdb::unique_xmalloc_ptr< char > > completion_list
Definition completer.h:70
block_enum
Definition defs.h:584
language
Definition defs.h:211
@ language_ada
Definition defs.h:225
@ language_unknown
Definition defs.h:212
@ language_cplus
Definition defs.h:216
@ language_go
Definition defs.h:218
@ language_rust
Definition defs.h:215
@ language_d
Definition defs.h:217
symbol_needs_kind
Definition defs.h:448
#define LANGUAGE_BITS
Definition defs.h:231
bool demangle
type_code
Definition gdbtypes.h:82
std::string copy_name(struct stoken token)
Definition parse.c:319
int value
Definition py-param.c:79
split_style
Definition split-name.h:28
const struct block * block
Definition symtab.h:1537
struct symbol * symbol
Definition symtab.h:1533
Definition block.h:109
struct objfile * objfile
Definition minsyms.h:54
struct minimal_symbol * minsym
Definition minsyms.h:49
void set_epilogue_unwind_valid(bool epilogue_unwind_valid)
Definition symtab.h:1877
symtab * primary_filetab() const
Definition symtab.c:415
bool locations_valid() const
Definition symtab.h:1862
htab_t m_call_site_htab
Definition symtab.h:1960
struct macro_table * macro_table() const
Definition symtab.h:1882
const struct blockvector * blockvector() const
Definition symtab.h:1852
enum language language() const
Definition symtab.c:426
call_site * find_call_site(CORE_ADDR pc) const
Definition symtab.c:344
const char * debugformat() const
Definition symtab.h:1817
symtab * m_last_filetab
Definition symtab.h:1932
void set_blockvector(struct blockvector *blockvector)
Definition symtab.h:1857
struct macro_table * m_macro_table
Definition symtab.h:1966
struct compunit_symtab * next
Definition symtab.h:1911
struct blockvector * blockvector()
Definition symtab.h:1847
struct compunit_symtab * user
Definition symtab.h:1981
void set_macro_table(struct macro_table *macro_table)
Definition symtab.h:1887
bool epilogue_unwind_valid() const
Definition symtab.h:1872
const char * name
Definition symtab.h:1919
const char * m_producer
Definition symtab.h:1941
void set_locations_valid(bool locations_valid)
Definition symtab.h:1867
void set_call_site_htab(htab_t call_site_htab)
Definition symtab.c:378
const char * m_debugformat
Definition symtab.h:1938
void set_dirname(const char *dirname)
Definition symtab.h:1842
void add_filetab(symtab *filetab)
Definition symtab.h:1803
struct blockvector * m_blockvector
Definition symtab.h:1948
void set_objfile(struct objfile *objfile)
Definition symtab.h:1793
void set_debugformat(const char *debugformat)
Definition symtab.h:1822
unsigned int m_locations_valid
Definition symtab.h:1953
struct compunit_symtab ** includes
Definition symtab.h:1975
struct objfile * objfile() const
Definition symtab.h:1788
void set_producer(const char *producer)
Definition symtab.h:1832
symtab_range filetabs() const
Definition symtab.h:1798
void set_primary_filetab(symtab *primary_filetab)
Definition symtab.c:387
const char * dirname() const
Definition symtab.h:1837
const char * m_dirname
Definition symtab.h:1944
const char * producer() const
Definition symtab.h:1827
symtab * m_filetabs
Definition symtab.h:1925
unsigned int m_epilogue_unwind_valid
Definition symtab.h:1957
struct objfile * m_objfile
Definition symtab.h:1914
demangle_for_lookup_info(const lookup_name_info &lookup_name, language lang)
Definition symtab.c:1832
std::string m_demangled_name
Definition symtab.h:189
const std::string & lookup_name() const
Definition symtab.h:184
struct type * type
Definition symtab.h:2048
struct fn_fieldlist * fn_field
Definition symtab.h:2058
struct field * field
Definition symtab.h:2053
void set_section_index(short idx)
Definition symtab.h:614
CORE_ADDR value_address() const
Definition symtab.h:517
CORE_ADDR address
Definition symtab.h:561
void set_demangled_name(const char *name, struct obstack *obstack)
Definition symtab.c:778
struct obstack * obstack
Definition symtab.h:585
const char * natural_name() const
Definition symtab.c:1056
const gdb_byte * bytes
Definition symtab.h:559
void set_value_address(CORE_ADDR address)
Definition symtab.h:522
union general_symbol_info::@183 language_specific
const char * demangled_name
Definition symtab.h:589
const char * print_name() const
Definition symtab.h:475
const struct common_block * common_block
Definition symtab.h:569
void compute_and_set_names(gdb::string_view linkage_name, bool copy_name, struct objfile_per_bfd_storage *per_bfd, gdb::optional< hashval_t > hash=gdb::optional< hashval_t >())
Definition symtab.c:943
const char * search_name() const
Definition symtab.c:1106
void set_unrelocated_address(unrelocated_addr addr)
Definition symtab.h:534
enum language language() const
Definition symtab.h:502
unsigned int ada_mangled
Definition symtab.h:602
const char * demangled_name() const
const struct block * block
Definition symtab.h:557
void set_language(enum language language, struct obstack *obstack)
Definition symtab.c:803
short section_index() const
Definition symtab.h:621
__extension__ enum language m_language
Definition symtab.h:597
struct obj_section * obj_section(const struct objfile *objfile) const
Definition symtab.c:1117
const char * m_name
Definition symtab.h:545
const char * linkage_name() const
Definition symtab.h:460
void set_linkage_name(const char *linkage_name)
Definition symtab.h:494
struct symbol * chain
Definition symtab.h:573
union general_symbol_info::@182 m_value
unrelocated_addr unrelocated_address() const
Definition symtab.h:528
unrelocated_addr unrel_addr
Definition symtab.h:565
bool(* gnu_ifunc_resolve_name)(const char *function_name, CORE_ADDR *function_address_p)
Definition symtab.h:2303
void(* gnu_ifunc_resolver_return_stop)(code_breakpoint *b)
Definition symtab.h:2310
void(* gnu_ifunc_resolver_stop)(code_breakpoint *b)
Definition symtab.h:2307
CORE_ADDR(* gnu_ifunc_resolve_addr)(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition symtab.h:2300
const char * m_regexp
Definition symtab.h:2909
DISABLE_COPY_AND_ASSIGN(info_sources_filter)
match_on m_match_type
Definition symtab.h:2906
bool matches(const char *fullname) const
Definition symtab.c:4244
info_sources_filter(match_on match_type, const char *regexp)
Definition symtab.c:4223
gdb::optional< compiled_regex > m_c_regexp
Definition symtab.h:2913
Definition symtab.h:1596
void set_unrelocated_pc(unrelocated_addr pc)
Definition symtab.h:1598
bool is_stmt
Definition symtab.h:1625
unrelocated_addr m_pc
Definition symtab.h:1634
int line
Definition symtab.h:1622
bool operator==(const linetable_entry &other) const
Definition symtab.h:1618
CORE_ADDR pc(const struct objfile *objfile) const
Definition symtab.c:336
bool operator<(const linetable_entry &other) const
Definition symtab.h:1608
unrelocated_addr unrelocated_pc() const
Definition symtab.h:1602
bool prologue_end
Definition symtab.h:1629
int nitems
Definition symtab.h:1656
struct linetable_entry item[1]
Definition symtab.h:1661
void set_type(minimal_symbol_type type)
Definition symtab.h:777
struct minimal_symbol * hash_next
Definition symtab.h:865
struct minimal_symbol * demangled_hash_next
Definition symtab.h:870
unsigned int created_by_gdb
Definition symtab.h:847
bool target_flag_2() const
Definition symtab.h:820
bool text_p() const
Definition symtab.c:463
bool maybe_copied(objfile *objfile) const
Definition symtab.c:476
unsigned long size() const
Definition symtab.h:784
unsigned int name_set
Definition symtab.h:860
CORE_ADDR value_address() const =delete
bool target_flag_1() const
Definition symtab.h:806
unsigned int m_target_flag_2
Definition symtab.h:851
unsigned int m_target_flag_1
Definition symtab.h:850
void set_target_flag_2(bool target_flag_2)
Definition symtab.h:827
unsigned long m_size
Definition symtab.h:836
__extension__ enum minimal_symbol_type m_type
Definition symtab.h:843
void set_size(unsigned long size)
Definition symtab.h:791
void set_target_flag_1(bool target_flag_1)
Definition symtab.h:813
bool data_p() const
Definition symtab.c:451
const char * filename
Definition symtab.h:839
bool has_size() const
Definition symtab.h:799
minimal_symbol_type type() const
Definition symtab.h:770
unrelocated_addr unrelocated_end_address() const
Definition symtab.h:763
LONGEST value_longest() const
Definition symtab.h:742
unsigned int m_has_size
Definition symtab.h:856
unrelocated_addr unrelocated_address() const
Definition symtab.h:756
struct type * concrete_type
Definition symtab.h:1586
CORE_ADDR(* get_frame_base)(struct symbol *framefunc, frame_info_ptr frame)
Definition symtab.h:1178
void(* find_frame_base_location)(struct symbol *framefunc, CORE_ADDR pc, const gdb_byte **start, size_t *length)
Definition symtab.h:1159
enum symbol_needs_kind(* get_symbol_read_needs)(struct symbol *symbol)
Definition symtab.h:1113
void(* describe_location)(struct symbol *symbol, CORE_ADDR addr, struct ui_file *stream)
Definition symtab.h:1117
void(* tracepoint_var_ref)(struct symbol *symbol, struct agent_expr *ax, struct axs_value *value)
Definition symtab.h:1130
unsigned char location_has_loclist
Definition symtab.h:1121
void(* generate_c_location)(struct symbol *symbol, string_file *stream, struct gdbarch *gdbarch, std::vector< bool > &registers_used, CORE_ADDR pc, const char *result_name)
Definition symtab.h:1142
enum address_class aclass
Definition symtab.h:1200
const struct symbol_computed_ops * ops_computed
Definition symtab.h:1203
const struct symbol_block_ops * ops_block
Definition symtab.h:1206
const struct symbol_register_ops * ops_register
Definition symtab.h:1209
int(* register_number)(struct symbol *symbol, struct gdbarch *gdbarch)
Definition symtab.h:1192
static int compare_search_syms(const symbol_search &sym_a, const symbol_search &sym_b)
Definition symtab.c:4579
bool operator<(const symbol_search &other) const
Definition symtab.h:2499
block_enum block
Definition symtab.h:2511
struct symbol * symbol
Definition symtab.h:2516
symbol_search(block_enum block_, struct symbol *symbol_)
Definition symtab.h:2482
symbol_search(block_enum block_, struct minimal_symbol *minsym, struct objfile *objfile)
Definition symtab.h:2490
bool operator==(const symbol_search &other) const
Definition symtab.h:2504
struct bound_minimal_symbol msymbol
Definition symtab.h:2520
void set_line(unsigned int line)
Definition symtab.h:1346
symbol * value_chain() const
Definition symtab.h:1401
const block * value_block() const
Definition symtab.h:1549
address_class aclass() const
Definition symtab.h:1274
unsigned int m_aclass_index
Definition symtab.h:1471
unsigned maybe_copied
Definition symtab.h:1491
struct type * type() const
Definition symtab.h:1331
unsigned int m_line
Definition symtab.h:1508
void set_value_block(const block *block)
Definition symtab.h:1396
domain_enum domain() const
Definition symtab.h:1286
void set_aclass_index(unsigned int aclass_index)
Definition symtab.h:1264
LONGEST value_longest() const
Definition symtab.h:1351
struct gdbarch * arch() const
const gdb_byte * value_bytes() const
Definition symtab.h:1374
unsigned m_is_inlined
Definition symtab.h:1483
bool is_objfile_owned() const
Definition symtab.h:1296
bool is_argument() const
Definition symtab.h:1306
unsigned int line() const
Definition symtab.h:1341
struct type * m_type
Definition symtab.h:1447
void set_is_artificial(bool artificial)
Definition symtab.h:1418
__extension__ enum symbol_subclass_kind subclass
Definition symtab.h:1495
bool m_artificial
Definition symtab.h:1499
__extension__ enum domain_enum m_domain
Definition symtab.h:1465
void set_type(struct type *type)
Definition symtab.h:1336
bool matches(domain_enum d) const
Definition symtab.h:1281
void set_is_argument(bool is_argument)
Definition symtab.h:1311
const symbol_impl & impl() const
Definition symtab.h:1269
void set_value_address(CORE_ADDR address)
Definition symtab.h:1369
bool is_inlined() const
Definition symtab.h:1316
union symbol::@184 owner
CORE_ADDR value_address() const
Definition symtab.h:1361
struct objfile * objfile() const
Definition symtab.c:6482
void set_value_bytes(const gdb_byte *bytes)
Definition symtab.h:1379
symbol & operator=(const symbol &)=default
symbol()
Definition symtab.h:1237
struct symtab * symtab
Definition symtab.h:1457
void set_is_inlined(bool is_inlined)
Definition symtab.h:1321
void * aux_value
Definition symtab.h:1522
bool is_artificial() const
Definition symtab.h:1412
struct gdbarch * arch
Definition symtab.h:1460
void set_value_longest(LONGEST value)
Definition symtab.h:1356
void set_value_chain(symbol *sym)
Definition symtab.h:1406
const common_block * value_common_block() const
Definition symtab.h:1384
symbol(const symbol &)=default
unsigned m_is_argument
Definition symtab.h:1480
struct symbol * hash_next
Definition symtab.h:1524
struct symtab * symtab() const
void set_is_objfile_owned(bool is_objfile_owned)
Definition symtab.h:1301
unsigned int m_is_objfile_owned
Definition symtab.h:1476
void set_domain(domain_enum domain)
Definition symtab.h:1291
void set_symtab(struct symtab *symtab)
Definition symtab.c:6510
bool is_cplus_template_function() const
Definition symtab.h:1326
void set_value_common_block(const common_block *common_block)
Definition symtab.h:1389
bool explicit_line
Definition symtab.h:2340
struct obj_section * section
Definition symtab.h:2330
probe * prob
Definition symtab.h:2347
CORE_ADDR pc
Definition symtab.h:2337
CORE_ADDR end
Definition symtab.h:2338
struct program_space * pspace
Definition symtab.h:2326
struct minimal_symbol * msymbol
Definition symtab.h:2331
const char * filename_for_id
Definition symtab.h:1735
enum language m_language
Definition symtab.h:1739
enum language language() const
Definition symtab.h:1697
char * fullname
Definition symtab.h:1744
void set_linetable(const struct linetable *linetable)
Definition symtab.h:1692
struct compunit_symtab * compunit() const
Definition symtab.h:1677
void set_language(enum language language)
Definition symtab.h:1702
struct compunit_symtab * m_compunit
Definition symtab.h:1714
const struct linetable * linetable() const
Definition symtab.h:1687
const char * filename
Definition symtab.h:1725
void set_compunit(struct compunit_symtab *compunit)
Definition symtab.h:1682
const struct linetable * m_linetable
Definition symtab.h:1719
struct symtab * next
Definition symtab.h:1710
int n_template_arguments
Definition symtab.h:1573
struct symbol ** template_arguments
Definition symtab.h:1577
Definition value.h:130
void collect_file_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode, symbol_name_match_type name_match_type, const char *, const char *, const char *)
Definition symtab.c:5987
#define SYMBOL_DOMAIN_BITS
Definition symtab.h:936
struct block_symbol lookup_static_symbol(const char *name, const domain_enum domain)
Definition symtab.c:2605
void fixup_symbol_section(struct symbol *sym, struct objfile *objfile)
Definition symtab.c:1723
completion_list make_source_files_completion_list(const char *, const char *)
Definition symtab.c:6127
next_range< compunit_symtab > compunit_symtab_range
Definition symtab.h:1984
struct symtab * find_pc_line_symtab(CORE_ADDR)
Definition symtab.c:3317
bool symbol_is_function_or_method(symbol *sym)
Definition symtab.c:5638
void collect_symbol_completion_matches(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *, const char *)
Definition symtab.c:5953
symbol * find_function_alias_target(bound_minimal_symbol msymbol)
Definition symtab.c:4066
bool find_line_pc(struct symtab *, int, CORE_ADDR *)
Definition symtab.c:3472
const char multiple_symbols_all[]
Definition symtab.c:277
bool matching_obj_sections(struct obj_section *, struct obj_section *)
Definition symtab.c:1142
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR)
Definition symtab.c:2946
int register_symbol_block_impl(enum address_class aclass, const struct symbol_block_ops *ops)
Definition symtab.c:6428
const char multiple_symbols_ask[]
Definition symtab.c:276
CORE_ADDR symbol_overlayed_address(CORE_ADDR, struct obj_section *)
Definition symfile.c:3144
struct block_symbol lookup_symbol(const char *, const struct block *, const domain_enum, struct field_of_this_result *)
Definition symtab.c:1964
bound_minimal_symbol find_gnu_ifunc(const symbol *sym)
Definition symtab.c:5670
struct symbol * find_pc_function(CORE_ADDR)
Definition blockframe.c:150
search_domain
Definition symtab.h:945
@ VARIABLES_DOMAIN
Definition symtab.h:948
@ FUNCTIONS_DOMAIN
Definition symtab.h:951
@ TYPES_DOMAIN
Definition symtab.h:954
@ MODULES_DOMAIN
Definition symtab.h:957
@ ALL_DOMAIN
Definition symtab.h:960
bool find_function_entry_range_from_pc(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr)
Definition blockframe.c:387
static bool is_main_symtab_of_compunit_symtab(struct symtab *symtab)
Definition symtab.h:1989
symbol_name_match_type
Definition symtab.h:63
address_class
Definition symtab.h:968
@ LOC_STATIC
Definition symtab.h:979
@ LOC_BLOCK
Definition symtab.h:1028
@ LOC_LABEL
Definition symtab.h:1022
@ LOC_REGISTER
Definition symtab.h:993
@ LOC_REF_ARG
Definition symtab.h:1001
@ LOC_UNRESOLVED
Definition symtab.h:1057
@ LOC_LOCAL
Definition symtab.h:1013
@ LOC_CONST
Definition symtab.h:975
@ LOC_CONST_BYTES
Definition symtab.h:1033
@ LOC_UNDEF
Definition symtab.h:971
@ LOC_OPTIMIZED_OUT
Definition symtab.h:1062
@ LOC_TYPEDEF
Definition symtab.h:1018
@ LOC_FINAL_VALUE
Definition symtab.h:1073
@ LOC_REGPARM_ADDR
Definition symtab.h:1009
@ LOC_COMMON_BLOCK
Definition symtab.h:1070
@ LOC_COMPUTED
Definition symtab.h:1066
@ LOC_ARG
Definition symtab.h:997
void clear_solib(void)
Definition solib.c:1227
bool compare_glob_filenames_for_search(const char *filename, const char *search_name)
Definition symtab.c:527
struct block_symbol lookup_global_symbol(const char *name, const struct block *block, const domain_enum domain)
Definition symtab.c:2613
void iterate_over_symtabs(const char *name, gdb::function_view< bool(symtab *)> callback)
Definition symtab.c:639
std::vector< CORE_ADDR > find_pcs_for_symtab_line(struct symtab *symtab, int line, const linetable_entry **best_entry)
Definition symtab.c:3430
bool producer_is_realview(const char *producer)
Definition symtab.c:6350
const char multiple_symbols_cancel[]
Definition symtab.c:278
CORE_ADDR skip_prologue_using_sal(struct gdbarch *gdbarch, CORE_ADDR func_addr)
Definition symtab.c:3963
bool symbol_found_callback_ftype(struct block_symbol *bsym)
Definition symtab.h:2753
bool iterate_over_symbols_terminated(const struct block *block, const lookup_name_info &name, const domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
Definition symtab.c:2812
bool symbol_matches_search_name(const struct general_symbol_info *gsymbol, const lookup_name_info &name)
Definition symtab.c:1127
struct symbol * find_pc_sect_containing_function(CORE_ADDR pc, struct obj_section *section)
Definition blockframe.c:158
#define SYMBOL_ACLASS_BITS
Definition symtab.h:1082
struct type * find_function_type(CORE_ADDR pc)
Definition blockframe.c:422
struct type * lookup_union(const char *, const struct block *)
Definition gdbtypes.c:1719
gdb_static_assert(nr_minsym_types<=(1<< MINSYM_TYPE_BITS))
#define MINSYM_TYPE_BITS
Definition symtab.h:716
void reread_symbols(int from_tty)
Definition symfile.c:2457
bool symbol_name_matcher_ftype(const char *symbol_search_name, const lookup_name_info &lookup_name, completion_match_result *comp_match_res)
Definition symtab.h:399
struct block_symbol lookup_global_symbol_from_objfile(struct objfile *main_objfile, enum block_enum block_index, const char *name, const domain_enum domain)
Definition symtab.c:2252
CORE_ADDR get_symbol_address(const struct symbol *sym)
Definition symtab.c:6519
#define SYMBOL_BLOCK_OPS(symbol)
Definition symtab.h:1544
static bool compunit_epilogue_unwind_valid(struct compunit_symtab *cust)
Definition symtab.h:1997
void collect_symbol_completion_matches_type(completion_tracker &tracker, const char *, const char *, enum type_code)
Definition symtab.c:5968
struct symbol * find_pc_sect_function(CORE_ADDR, struct obj_section *)
Definition blockframe.c:136
const char * main_name()
Definition symtab.c:6322
const struct gnu_ifunc_fns * gnu_ifunc_fns_p
Definition minsyms.c:1061
minimal_symbol_type
Definition symtab.h:670
@ mst_data_gnu_ifunc
Definition symtab.h:690
@ mst_abs
Definition symtab.h:696
@ mst_bss
Definition symtab.h:695
@ mst_data
Definition symtab.h:694
@ mst_unknown
Definition symtab.h:671
@ mst_solib_trampoline
Definition symtab.h:705
@ mst_file_text
Definition symtab.h:708
@ mst_slot_got_plt
Definition symtab.h:693
@ nr_minsym_types
Definition symtab.h:711
@ mst_file_data
Definition symtab.h:709
@ mst_text
Definition symtab.h:672
@ mst_text_gnu_ifunc
Definition symtab.h:681
@ mst_file_bss
Definition symtab.h:710
struct type * lookup_struct(const char *, const struct block *)
Definition gdbtypes.c:1697
int register_symbol_computed_impl(enum address_class, const struct symbol_computed_ops *)
Definition symtab.c:6402
gdb::array_view< const struct symbol_impl > symbol_impls
symbol_subclass_kind
Definition symtab.h:1216
@ SYMBOL_RUST_VTABLE
Definition symtab.h:1224
@ SYMBOL_NONE
Definition symtab.h:1218
@ SYMBOL_TEMPLATE
Definition symtab.h:1221
void default_collect_symbol_completion_matches_break_on(completion_tracker &tracker, complete_symbol_mode mode, symbol_name_match_type name_match_type, const char *text, const char *word, const char *break_on, enum type_code code)
Definition symtab.c:5746
bool compare_filenames_for_search(const char *filename, const char *search_name)
Definition symtab.c:489
bool treg_matches_sym_type_name(const compiled_regex &treg, const struct symbol *sym)
Definition symtab.c:4599
std::pair< symbol_search, symbol_search > module_symbol_search
Definition symtab.h:2636
next_range< symtab > symtab_range
Definition symtab.h:1749
struct type * lookup_enum(const char *, const struct block *)
Definition gdbtypes.c:1743
domain_enum
Definition symtab.h:900
@ VAR_DOMAIN
Definition symtab.h:910
@ STRUCT_DOMAIN
Definition symtab.h:916
@ LABEL_DOMAIN
Definition symtab.h:924
@ COMMON_BLOCK_DOMAIN
Definition symtab.h:928
@ UNDEF_DOMAIN
Definition symtab.h:905
@ MODULE_DOMAIN
Definition symtab.h:920
@ NR_DOMAINS
Definition symtab.h:931
bool find_pc_partial_function_sym(CORE_ADDR pc, const general_symbol_info **sym, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block=nullptr)
struct symtab_and_line find_pc_sect_line(CORE_ADDR, struct obj_section *, int)
Definition symtab.c:3023
bool find_pc_line_pc_range(CORE_ADDR, CORE_ADDR *, CORE_ADDR *)
Definition symtab.c:3587
int register_symbol_register_impl(enum address_class, const struct symbol_register_ops *)
Definition symtab.c:6452
std::vector< module_symbol_search > search_module_symbols(const char *module_regexp, const char *regexp, const char *type_regexp, search_domain kind)
Definition symtab.c:6558
const char * multiple_symbols_select_mode(void)
Definition symtab.c:295
bool basenames_may_differ
Definition symtab.c:270
struct symtab * lookup_symtab(const char *)
Definition symtab.c:675
gdb::unique_xmalloc_ptr< char > symbol_find_demangled_name(struct general_symbol_info *gsymbol, const char *mangled)
Definition symtab.c:902
bool iterate_over_symbols(const struct block *block, const lookup_name_info &name, const domain_enum domain, gdb::function_view< symbol_found_callback_ftype > callback)
Definition symtab.c:2790
static bool completion_skip_symbol(complete_symbol_mode mode, Symbol *sym)
Definition symtab.h:2431
bool find_line_pc_range(struct symtab_and_line, CORE_ADDR *, CORE_ADDR *)
Definition symtab.c:3499
struct block_symbol lookup_symbol_search_name(const char *search_name, const struct block *block, domain_enum domain)
Definition symtab.c:1976
void skip_prologue_sal(struct symtab_and_line *)
Definition symtab.c:3764
std::vector< CORE_ADDR > section_offsets
Definition symtab.h:1669
struct symtab * find_line_symtab(struct symtab *, int, int *, bool *)
Definition symtab.c:3338
struct block_symbol lookup_symbol_in_language(const char *, const struct block *, const domain_enum, enum language, struct field_of_this_result *)
Definition symtab.c:1946
struct symtab_and_line find_pc_line(CORE_ADDR, int)
Definition symtab.c:3295
bool iterate_over_some_symtabs(const char *name, const char *real_path, struct compunit_symtab *first, struct compunit_symtab *after_last, gdb::function_view< bool(symtab *)> callback)
Definition symtab.c:570
void info_sources_worker(struct ui_out *uiout, bool group_by_objfile, const info_sources_filter &filter)
Definition symtab.c:4445
struct compunit_symtab * find_pc_sect_compunit_symtab(CORE_ADDR, struct obj_section *)
Definition symtab.c:2827
const char * domain_name(domain_enum)
Definition symtab.c:303
struct symbol * lookup_symbol_in_block(const char *name, symbol_name_match_type match_type, const struct block *block, const domain_enum domain)
Definition symtab.c:2219
struct type * basic_lookup_transparent_type(const char *)
Definition symtab.c:2740
struct block_symbol lookup_symbol_in_static_block(const char *name, const struct block *block, const domain_enum domain)
Definition symtab.c:2479
bool completion_list_add_name(completion_tracker &tracker, language symbol_language, const char *symname, const lookup_name_info &lookup_name, const char *text, const char *word)
Definition symtab.c:5413
const char * demangle_for_lookup(const char *name, enum language lang, demangle_result_storage &storage)
Definition symtab.c:1890
complete_symbol_mode
Definition symtab.h:2385
symtab_and_line find_function_start_sal(symbol *sym, bool funfirstline)
Definition symtab.c:3656
unsigned int symbol_lookup_debug
Definition symtab.c:257
void resolve_sal_pc(struct symtab_and_line *)
bool symbol_matches_domain(enum language symbol_language, domain_enum symbol_domain, domain_enum domain)
Definition symtab.c:2649
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block=nullptr)
Definition blockframe.c:373
struct block_symbol lookup_language_this(const struct language_defn *lang, const struct block *block)
Definition symtab.c:1986
struct type * find_gnu_ifunc_target_type(CORE_ADDR resolver_funaddr)
Definition blockframe.c:435
bool in_gnu_ifunc_stub(CORE_ADDR pc)
Definition minsyms.c:1004
std::string symbol_to_info_string(struct symbol *sym, int block, enum search_domain kind)
Definition symtab.c:4959
CORE_ADDR find_solib_trampoline_target(frame_info_ptr, CORE_ADDR)
Definition minsyms.c:1554
const char * search_domain_name(enum search_domain)
Definition symtab.c:320
struct type * lookup_transparent_type(const char *)
Definition symtab.c:2671
int currently_reading_symtab
Definition symfile.c:179
void clear_pc_function_cache(void)
Definition blockframe.c:201
struct symbol * find_symbol_at_address(CORE_ADDR)
Definition symtab.c:2954
static bool symbol_lookup_debug_enabled_v()
Definition symtab.h:2705
enum language main_language(void)
Definition symtab.c:6336
CORE_ADDR get_msymbol_address(struct objfile *objf, const struct minimal_symbol *minsym)
Definition symtab.c:6535
static bool symbol_lookup_debug_enabled()
Definition symtab.h:2697
unsigned int search_name_hash(enum language language, const char *search_name)
Definition symtab.c:1928
unsigned int symtab_create_debug
Definition symtab.c:254
#define nullptr
Definition x86-cpuid.h:28