GDB (xrefs)
Loading...
Searching...
No Matches
block.c
Go to the documentation of this file.
1/* Block-related functions for the GNU debugger, GDB.
2
3 Copyright (C) 2003-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#include "defs.h"
21#include "block.h"
22#include "symtab.h"
23#include "symfile.h"
24#include "gdbsupport/gdb_obstack.h"
25#include "cp-support.h"
26#include "addrmap.h"
27#include "gdbtypes.h"
28#include "objfiles.h"
29
30/* This is used by struct block to store namespace-related info for
31 C++ files, namely using declarations and the current namespace in
32 scope. */
33
34struct block_namespace_info : public allocate_on_obstack
35{
36 const char *scope = nullptr;
37 struct using_direct *using_decl = nullptr;
38};
39
40/* See block.h. */
41
42struct objfile *
44{
45 const struct global_block *global_block;
46
47 if (function () != nullptr)
48 return function ()->objfile ();
49
50 global_block = (struct global_block *) this->global_block ();
52}
53
54/* See block. */
55
56struct gdbarch *
58{
59 if (function () != nullptr)
60 return function ()->arch ();
61
62 return objfile ()->arch ();
63}
64
65/* See block.h. */
66
67bool
68block::contains (const struct block *a, bool allow_nested) const
69{
70 if (a == nullptr)
71 return false;
72
73 do
74 {
75 if (a == this)
76 return true;
77 /* If A is a function block, then A cannot be contained in B,
78 except if A was inlined. */
79 if (!allow_nested && a->function () != NULL && !a->inlined_p ())
80 return false;
81 a = a->superblock ();
82 }
83 while (a != NULL);
84
85 return false;
86}
87
88/* See block.h. */
89
90struct symbol *
92{
93 const block *bl = this;
94
95 while ((bl->function () == NULL || bl->inlined_p ())
96 && bl->superblock () != NULL)
97 bl = bl->superblock ();
98
99 return bl->function ();
100}
101
102/* See block.h. */
103
104struct symbol *
106{
107 const block *bl = this;
108
109 while (bl->function () == NULL && bl->superblock () != NULL)
110 bl = bl->superblock ();
111
112 return bl->function ();
113}
114
115/* See block.h. */
116
117bool
119{
120 return function () != nullptr && function ()->is_inlined ();
121}
122
123/* A helper function that checks whether PC is in the blockvector BL.
124 It returns the containing block if there is one, or else NULL. */
125
126static const struct block *
127find_block_in_blockvector (const struct blockvector *bl, CORE_ADDR pc)
128{
129 const struct block *b;
130 int bot, top, half;
131
132 /* If we have an addrmap mapping code addresses to blocks, then use
133 that. */
134 if (bl->map ())
135 return (const struct block *) bl->map ()->find (pc);
136
137 /* Otherwise, use binary search to find the last block that starts
138 before PC.
139 Note: GLOBAL_BLOCK is block 0, STATIC_BLOCK is block 1.
140 They both have the same START,END values.
141 Historically this code would choose STATIC_BLOCK over GLOBAL_BLOCK but the
142 fact that this choice was made was subtle, now we make it explicit. */
143 gdb_assert (bl->blocks ().size () >= 2);
144 bot = STATIC_BLOCK;
145 top = bl->blocks ().size ();
146
147 while (top - bot > 1)
148 {
149 half = (top - bot + 1) >> 1;
150 b = bl->block (bot + half);
151 if (b->start () <= pc)
152 bot += half;
153 else
154 top = bot + half;
155 }
156
157 /* Now search backward for a block that ends after PC. */
158
159 while (bot >= STATIC_BLOCK)
160 {
161 b = bl->block (bot);
162 if (!(b->start () <= pc))
163 return NULL;
164 if (b->end () > pc)
165 return b;
166 bot--;
167 }
168
169 return NULL;
170}
171
172/* Return the blockvector immediately containing the innermost lexical
173 block containing the specified pc value and section, or 0 if there
174 is none. PBLOCK is a pointer to the block. If PBLOCK is NULL, we
175 don't pass this information back to the caller. */
176
177const struct blockvector *
178blockvector_for_pc_sect (CORE_ADDR pc, struct obj_section *section,
179 const struct block **pblock,
180 struct compunit_symtab *cust)
181{
182 const struct blockvector *bl;
183 const struct block *b;
184
185 if (cust == NULL)
186 {
187 /* First search all symtabs for one whose file contains our pc */
188 cust = find_pc_sect_compunit_symtab (pc, section);
189 if (cust == NULL)
190 return 0;
191 }
192
193 bl = cust->blockvector ();
194
195 /* Then search that symtab for the smallest block that wins. */
196 b = find_block_in_blockvector (bl, pc);
197 if (b == NULL)
198 return NULL;
199
200 if (pblock)
201 *pblock = b;
202 return bl;
203}
204
205/* Return true if the blockvector BV contains PC, false otherwise. */
206
207int
208blockvector_contains_pc (const struct blockvector *bv, CORE_ADDR pc)
209{
210 return find_block_in_blockvector (bv, pc) != NULL;
211}
212
213/* Return call_site for specified PC in GDBARCH. PC must match exactly, it
214 must be the next instruction after call (or after tail call jump). Throw
215 NO_ENTRY_VALUE_ERROR otherwise. This function never returns NULL. */
216
217struct call_site *
218call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
219{
220 struct compunit_symtab *cust;
221 call_site *cs = nullptr;
222
223 /* -1 as tail call PC can be already after the compilation unit range. */
224 cust = find_pc_compunit_symtab (pc - 1);
225
226 if (cust != nullptr)
227 cs = cust->find_call_site (pc);
228
229 if (cs == nullptr)
230 {
232
233 /* DW_TAG_gnu_call_site will be missing just if GCC could not determine
234 the call target. */
235 throw_error (NO_ENTRY_VALUE_ERROR,
236 _("DW_OP_entry_value resolving cannot find "
237 "DW_TAG_call_site %s in %s"),
238 paddress (gdbarch, pc),
239 (msym.minsym == NULL ? "???"
240 : msym.minsym->print_name ()));
241 }
242
243 return cs;
244}
245
246/* Return the blockvector immediately containing the innermost lexical block
247 containing the specified pc value, or 0 if there is none.
248 Backward compatibility, no section. */
249
250const struct blockvector *
251blockvector_for_pc (CORE_ADDR pc, const struct block **pblock)
252{
254 pblock, NULL);
255}
256
257/* Return the innermost lexical block containing the specified pc value
258 in the specified section, or 0 if there is none. */
259
260const struct block *
261block_for_pc_sect (CORE_ADDR pc, struct obj_section *section)
262{
263 const struct blockvector *bl;
264 const struct block *b;
265
266 bl = blockvector_for_pc_sect (pc, section, &b, NULL);
267 if (bl)
268 return b;
269 return 0;
270}
271
272/* Return the innermost lexical block containing the specified pc value,
273 or 0 if there is none. Backward compatibility, no section. */
274
275const struct block *
276block_for_pc (CORE_ADDR pc)
277{
279}
280
281/* Now come some functions designed to deal with C++ namespace issues.
282 The accessors are safe to use even in the non-C++ case. */
283
284/* See block.h. */
285
286const char *
288{
289 for (const block *block = this;
290 block != nullptr;
291 block = block->superblock ())
292 {
293 if (block->m_namespace_info != nullptr
294 && block->m_namespace_info->scope != nullptr)
296 }
297
298 return "";
299}
300
301/* See block.h. */
302
303void
304block::initialize_namespace (struct obstack *obstack)
305{
306 if (m_namespace_info == nullptr)
307 m_namespace_info = new (obstack) struct block_namespace_info;
308}
309
310/* See block.h. */
311
312void
313block::set_scope (const char *scope, struct obstack *obstack)
314{
315 if (scope == nullptr || scope[0] == '\0')
316 {
317 /* Don't bother. */
318 return;
319 }
320
321 initialize_namespace (obstack);
323}
324
325/* See block.h. */
326
327struct using_direct *
329{
330 if (m_namespace_info == nullptr)
331 return nullptr;
332 else
334}
335
336/* See block.h. */
337
338void
339block::set_using (struct using_direct *using_decl, struct obstack *obstack)
340{
341 if (using_decl == nullptr)
342 {
343 /* Don't bother. */
344 return;
345 }
346
347 initialize_namespace (obstack);
348 m_namespace_info->using_decl = using_decl;
349}
350
351/* See block.h. */
352
353const struct block *
355{
356 if (superblock () == nullptr)
357 return nullptr;
358
359 const block *block = this;
360 while (block->superblock ()->superblock () != NULL)
361 block = block->superblock ();
362
363 return block;
364}
365
366/* See block.h. */
367
368const struct block *
370{
371 const block *block = this;
372
373 while (block->superblock () != NULL)
374 block = block->superblock ();
375
376 return block;
377}
378
379/* See block.h. */
380
381const struct block *
383{
384 const block *block = this;
385
386 while (block != nullptr && block->function () == nullptr)
387 block = block->superblock ();
388
389 return block;
390}
391
392/* See block.h. */
393
394void
396{
397 struct global_block *gb;
398
399 gdb_assert (superblock () == NULL);
400 gb = (struct global_block *) this;
401 gdb_assert (gb->compunit_symtab == NULL);
402 gb->compunit_symtab = cu;
403}
404
405/* See block.h. */
406
407struct dynamic_prop *
409{
410 struct objfile *objfile = this->objfile ();
411
412 /* Only objfile-owned blocks that materialize top function scopes can have
413 static links. */
414 if (objfile == NULL || function () == NULL)
415 return NULL;
416
417 return (struct dynamic_prop *) objfile_lookup_static_link (objfile, this);
418}
419
420/* Return the compunit of the global block. */
421
422static struct compunit_symtab *
424{
425 struct global_block *gb;
426
427 gdb_assert (block->superblock () == NULL);
428 gb = (struct global_block *) block;
429 gdb_assert (gb->compunit_symtab != NULL);
430 return gb->compunit_symtab;
431}
432
433
434
435/* Initialize a block iterator, either to iterate over a single block,
436 or, for static and global blocks, all the included symtabs as
437 well. */
438
439static void
441 struct block_iterator *iter,
442 const lookup_name_info *name = nullptr)
443{
444 enum block_enum which;
445 struct compunit_symtab *cu;
446
447 iter->idx = -1;
448 iter->name = name;
449
450 if (block->superblock () == NULL)
451 {
452 which = GLOBAL_BLOCK;
454 }
455 else if (block->superblock ()->superblock () == NULL)
456 {
457 which = STATIC_BLOCK;
459 }
460 else
461 {
462 iter->d.block = block;
463 /* A signal value meaning that we're iterating over a single
464 block. */
465 iter->which = FIRST_LOCAL_BLOCK;
466 return;
467 }
468
469 /* If this is an included symtab, find the canonical includer and
470 use it instead. */
471 while (cu->user != NULL)
472 cu = cu->user;
473
474 /* Putting this check here simplifies the logic of the iterator
475 functions. If there are no included symtabs, we only need to
476 search a single block, so we might as well just do that
477 directly. */
478 if (cu->includes == NULL)
479 {
480 iter->d.block = block;
481 /* A signal value meaning that we're iterating over a single
482 block. */
483 iter->which = FIRST_LOCAL_BLOCK;
484 }
485 else
486 {
487 iter->d.compunit_symtab = cu;
488 iter->which = which;
489 }
490}
491
492/* A helper function that finds the current compunit over whose static
493 or global block we should iterate. */
494
495static struct compunit_symtab *
497{
498 if (iterator->idx == -1)
499 return iterator->d.compunit_symtab;
500 return iterator->d.compunit_symtab->includes[iterator->idx];
501}
502
503/* Perform a single step for a plain block iterator, iterating across
504 symbol tables as needed. Returns the next symbol, or NULL when
505 iteration is complete. */
506
507static struct symbol *
508block_iterator_step (struct block_iterator *iterator, int first)
509{
510 struct symbol *sym;
511
512 gdb_assert (iterator->which != FIRST_LOCAL_BLOCK);
513
514 while (1)
515 {
516 if (first)
517 {
518 struct compunit_symtab *cust
520 const struct block *block;
521
522 /* Iteration is complete. */
523 if (cust == NULL)
524 return NULL;
525
526 block = cust->blockvector ()->block (iterator->which);
528 &iterator->mdict_iter);
529 }
530 else
531 sym = mdict_iterator_next (&iterator->mdict_iter);
532
533 if (sym != NULL)
534 return sym;
535
536 /* We have finished iterating the appropriate block of one
537 symtab. Now advance to the next symtab and begin iteration
538 there. */
539 ++iterator->idx;
540 first = 1;
541 }
542}
543
544/* Perform a single step for a "match" block iterator, iterating
545 across symbol tables as needed. Returns the next symbol, or NULL
546 when iteration is complete. */
547
548static struct symbol *
550 int first)
551{
552 struct symbol *sym;
553
554 gdb_assert (iterator->which != FIRST_LOCAL_BLOCK);
555
556 while (1)
557 {
558 if (first)
559 {
560 struct compunit_symtab *cust
562 const struct block *block;
563
564 /* Iteration is complete. */
565 if (cust == NULL)
566 return NULL;
567
568 block = cust->blockvector ()->block (iterator->which);
569 sym = mdict_iter_match_first (block->multidict (), *iterator->name,
570 &iterator->mdict_iter);
571 }
572 else
573 sym = mdict_iter_match_next (*iterator->name, &iterator->mdict_iter);
574
575 if (sym != NULL)
576 return sym;
577
578 /* We have finished iterating the appropriate block of one
579 symtab. Now advance to the next symtab and begin iteration
580 there. */
581 ++iterator->idx;
582 first = 1;
583 }
584}
585
586/* See block.h. */
587
588struct symbol *
590 struct block_iterator *iterator,
591 const lookup_name_info *name)
592{
594
595 if (name == nullptr)
596 {
597 if (iterator->which == FIRST_LOCAL_BLOCK)
599 &iterator->mdict_iter);
600
601 return block_iterator_step (iterator, 1);
602 }
603
604 if (iterator->which == FIRST_LOCAL_BLOCK)
606 &iterator->mdict_iter);
607
608 return block_iter_match_step (iterator, 1);
609}
610
611/* See block.h. */
612
613struct symbol *
615{
616 if (iterator->name == nullptr)
617 {
618 if (iterator->which == FIRST_LOCAL_BLOCK)
619 return mdict_iterator_next (&iterator->mdict_iter);
620
621 return block_iterator_step (iterator, 0);
622 }
623
624 if (iterator->which == FIRST_LOCAL_BLOCK)
625 return mdict_iter_match_next (*iterator->name, &iterator->mdict_iter);
626
627 return block_iter_match_step (iterator, 0);
628}
629
630/* See block.h. */
631
632bool
634{
635 return (a->domain () == domain
636 && a->aclass () != LOC_UNRESOLVED);
637}
638
639/* See block.h. */
640
641struct symbol *
642better_symbol (struct symbol *a, struct symbol *b, const domain_enum domain)
643{
644 if (a == NULL)
645 return b;
646 if (b == NULL)
647 return a;
648
649 if (a->domain () == domain && b->domain () != domain)
650 return a;
651
652 if (b->domain () == domain && a->domain () != domain)
653 return b;
654
655 if (a->aclass () != LOC_UNRESOLVED && b->aclass () == LOC_UNRESOLVED)
656 return a;
657
658 if (b->aclass () != LOC_UNRESOLVED && a->aclass () == LOC_UNRESOLVED)
659 return b;
660
661 return a;
662}
663
664/* See block.h.
665
666 Note that if NAME is the demangled form of a C++ symbol, we will fail
667 to find a match during the binary search of the non-encoded names, but
668 for now we don't worry about the slight inefficiency of looking for
669 a match we'll never find, since it will go pretty quick. Once the
670 binary search terminates, we drop through and do a straight linear
671 search on the symbols. Each symbol which is marked as being a ObjC/C++
672 symbol (language_cplus or language_objc set) has both the encoded and
673 non-encoded names tested for a match. */
674
675struct symbol *
676block_lookup_symbol (const struct block *block, const char *name,
677 symbol_name_match_type match_type,
678 const domain_enum domain)
679{
680 lookup_name_info lookup_name (name, match_type);
681
682 if (!block->function ())
683 {
684 struct symbol *other = NULL;
685
686 for (struct symbol *sym : block_iterator_range (block, &lookup_name))
687 {
688 /* See comment related to PR gcc/debug/91507 in
689 block_lookup_symbol_primary. */
690 if (best_symbol (sym, domain))
691 return sym;
692 /* This is a bit of a hack, but symbol_matches_domain might ignore
693 STRUCT vs VAR domain symbols. So if a matching symbol is found,
694 make sure there is no "better" matching symbol, i.e., one with
695 exactly the same domain. PR 16253. */
696 if (sym->matches (domain))
697 other = better_symbol (other, sym, domain);
698 }
699 return other;
700 }
701 else
702 {
703 /* Note that parameter symbols do not always show up last in the
704 list; this loop makes sure to take anything else other than
705 parameter symbols first; it only uses parameter symbols as a
706 last resort. Note that this only takes up extra computation
707 time on a match.
708 It's hard to define types in the parameter list (at least in
709 C/C++) so we don't do the same PR 16253 hack here that is done
710 for the !BLOCK_FUNCTION case. */
711
712 struct symbol *sym_found = NULL;
713
714 for (struct symbol *sym : block_iterator_range (block, &lookup_name))
715 {
716 if (sym->matches (domain))
717 {
718 sym_found = sym;
719 if (!sym->is_argument ())
720 {
721 break;
722 }
723 }
724 }
725 return (sym_found); /* Will be NULL if not found. */
726 }
727}
728
729/* See block.h. */
730
731struct symbol *
732block_lookup_symbol_primary (const struct block *block, const char *name,
733 const domain_enum domain)
734{
735 struct symbol *sym, *other;
736 struct mdict_iterator mdict_iter;
737
739
740 /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */
741 gdb_assert (block->superblock () == NULL
742 || block->superblock ()->superblock () == NULL);
743
744 other = NULL;
745 for (sym = mdict_iter_match_first (block->multidict (), lookup_name,
746 &mdict_iter);
747 sym != NULL;
748 sym = mdict_iter_match_next (lookup_name, &mdict_iter))
749 {
750 /* With the fix for PR gcc/debug/91507, we get for:
751 ...
752 extern char *zzz[];
753 char *zzz[ ] = {
754 "abc",
755 "cde"
756 };
757 ...
758 DWARF which will result in two entries in the symbol table, a decl
759 with type char *[] and a def with type char *[2].
760
761 If we return the decl here, we don't get the value of zzz:
762 ...
763 $ gdb a.spec.out -batch -ex "p zzz"
764 $1 = 0x601030 <zzz>
765 ...
766 because we're returning the symbol without location information, and
767 because the fallback that uses the address from the minimal symbols
768 doesn't work either because the type of the decl does not specify a
769 size.
770
771 To fix this, we prefer def over decl in best_symbol and
772 better_symbol.
773
774 In absence of the gcc fix, both def and decl have type char *[], so
775 the only option to make this work is improve the fallback to use the
776 size of the minimal symbol. Filed as PR exp/24989. */
777 if (best_symbol (sym, domain))
778 return sym;
779
780 /* This is a bit of a hack, but 'matches' might ignore
781 STRUCT vs VAR domain symbols. So if a matching symbol is found,
782 make sure there is no "better" matching symbol, i.e., one with
783 exactly the same domain. PR 16253. */
784 if (sym->matches (domain))
785 other = better_symbol (other, sym, domain);
786 }
787
788 return other;
789}
790
791/* See block.h. */
792
793struct symbol *
795 const domain_enum domain, struct symbol **stub)
796{
797 /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */
798 gdb_assert (block->superblock () == NULL
799 || block->superblock ()->superblock () == NULL);
800
801 for (struct symbol *sym : block_iterator_range (block, &name))
802 {
803 if (!sym->matches (domain))
804 continue;
805
806 if (!TYPE_IS_OPAQUE (sym->type ()))
807 return sym;
808
809 if (stub != nullptr)
810 *stub = sym;
811 }
812 return nullptr;
813}
814
815/* See block.h. */
816
817struct blockranges *
819 const std::vector<blockrange> &rangevec)
820{
821 struct blockranges *blr;
822 size_t n = rangevec.size();
823
824 blr = (struct blockranges *)
825 obstack_alloc (&objfile->objfile_obstack,
826 sizeof (struct blockranges)
827 + (n - 1) * sizeof (struct blockrange));
828
829 blr->nranges = n;
830 for (int i = 0; i < n; i++)
831 blr->range[i] = rangevec[i];
832 return blr;
833}
834
const char *const name
bool best_symbol(struct symbol *a, const domain_enum domain)
Definition block.c:633
struct symbol * better_symbol(struct symbol *a, struct symbol *b, const domain_enum domain)
Definition block.c:642
struct call_site * call_site_for_pc(struct gdbarch *gdbarch, CORE_ADDR pc)
Definition block.c:218
struct symbol * block_lookup_symbol_primary(const struct block *block, const char *name, const domain_enum domain)
Definition block.c:732
static struct symbol * block_iter_match_step(struct block_iterator *iterator, int first)
Definition block.c:549
struct symbol * block_iterator_first(const struct block *block, struct block_iterator *iterator, const lookup_name_info *name)
Definition block.c:589
static struct symbol * block_iterator_step(struct block_iterator *iterator, int first)
Definition block.c:508
struct blockranges * make_blockranges(struct objfile *objfile, const std::vector< blockrange > &rangevec)
Definition block.c:818
const struct blockvector * blockvector_for_pc_sect(CORE_ADDR pc, struct obj_section *section, const struct block **pblock, struct compunit_symtab *cust)
Definition block.c:178
static struct compunit_symtab * get_block_compunit_symtab(const struct block *block)
Definition block.c:423
struct symbol * block_lookup_symbol(const struct block *block, const char *name, symbol_name_match_type match_type, const domain_enum domain)
Definition block.c:676
const struct block * block_for_pc(CORE_ADDR pc)
Definition block.c:276
const struct block * block_for_pc_sect(CORE_ADDR pc, struct obj_section *section)
Definition block.c:261
int blockvector_contains_pc(const struct blockvector *bv, CORE_ADDR pc)
Definition block.c:208
struct symbol * block_find_symbol(const struct block *block, const lookup_name_info &name, const domain_enum domain, struct symbol **stub)
Definition block.c:794
struct symbol * block_iterator_next(struct block_iterator *iterator)
Definition block.c:614
static void initialize_block_iterator(const struct block *block, struct block_iterator *iter, const lookup_name_info *name=nullptr)
Definition block.c:440
static struct compunit_symtab * find_iterator_compunit_symtab(struct block_iterator *iterator)
Definition block.c:496
const struct blockvector * blockvector_for_pc(CORE_ADDR pc, const struct block **pblock)
Definition block.c:251
static const struct block * find_block_in_blockvector(const struct blockvector *bl, CORE_ADDR pc)
Definition block.c:127
iterator_range< block_iterator_wrapper > block_iterator_range
Definition block.h:553
block_enum
Definition defs.h:584
@ STATIC_BLOCK
Definition defs.h:586
@ GLOBAL_BLOCK
Definition defs.h:585
@ FIRST_LOCAL_BLOCK
Definition defs.h:587
struct symbol * mdict_iterator_first(const multidictionary *mdict, struct mdict_iterator *miterator)
struct symbol * mdict_iter_match_next(const lookup_name_info &name, struct mdict_iterator *miterator)
struct symbol * mdict_iter_match_first(const struct multidictionary *mdict, const lookup_name_info &name, struct mdict_iterator *miterator)
struct symbol * mdict_iterator_next(struct mdict_iterator *miterator)
#define TYPE_IS_OPAQUE(thistype)
Definition gdbtypes.h:2049
struct bound_minimal_symbol lookup_minimal_symbol_by_pc(CORE_ADDR pc)
Definition minsyms.c:996
const struct dynamic_prop * objfile_lookup_static_link(struct objfile *objfile, const struct block *block)
Definition objfiles.c:226
const void * find(CORE_ADDR addr) const
Definition addrmap.h:88
const struct block * block
Definition block.h:465
struct compunit_symtab * compunit_symtab
Definition block.h:464
const lookup_name_info * name
Definition block.h:469
enum block_enum which
Definition block.h:482
union block_iterator::@21 d
struct mdict_iterator mdict_iter
Definition block.h:486
struct using_direct * using_decl
Definition block.c:37
const char * scope
Definition block.c:36
Definition block.h:109
const block * superblock() const
Definition block.h:135
void set_using(struct using_direct *using_decl, struct obstack *obstack)
Definition block.c:339
bool contains(const struct block *a, bool allow_nested=false) const
Definition block.c:68
void initialize_namespace(struct obstack *obstack)
Definition block.c:304
multidictionary * multidict() const
Definition block.h:143
const struct block * global_block() const
Definition block.c:369
struct gdbarch * gdbarch() const
Definition block.c:57
CORE_ADDR start() const
Definition block.h:111
struct symbol * containing_function() const
Definition block.c:105
bool inlined_p() const
Definition block.c:118
const struct block * function_block() const
Definition block.c:382
const struct block * static_block() const
Definition block.c:354
void set_compunit_symtab(struct compunit_symtab *)
Definition block.c:395
struct dynamic_prop * static_link() const
Definition block.c:408
struct block_namespace_info * m_namespace_info
Definition block.h:339
void set_scope(const char *scope, struct obstack *obstack)
Definition block.c:313
CORE_ADDR end() const
Definition block.h:119
symbol * function() const
Definition block.h:127
struct objfile * objfile() const
Definition block.c:43
struct symbol * linkage_function() const
Definition block.c:91
struct using_direct * get_using() const
Definition block.c:328
const char * scope() const
Definition block.c:287
struct blockrange range[1]
Definition block.h:79
int nranges
Definition block.h:78
struct block * block(size_t i)
Definition block.h:374
addrmap * map()
Definition block.h:413
gdb::array_view< struct block * > blocks()
Definition block.h:361
struct minimal_symbol * minsym
Definition minsyms.h:49
CORE_ADDR pc() const
Definition gdbtypes.c:6188
call_site * find_call_site(CORE_ADDR pc) const
Definition symtab.c:344
struct blockvector * blockvector()
Definition symtab.h:1847
struct compunit_symtab * user
Definition symtab.h:1981
struct compunit_symtab ** includes
Definition symtab.h:1975
struct objfile * objfile() const
Definition symtab.h:1788
const char * print_name() const
Definition symtab.h:475
struct compunit_symtab * compunit_symtab
Definition block.h:355
struct gdbarch * arch() const
Definition objfiles.h:507
auto_obstack objfile_obstack
Definition objfiles.h:760
address_class aclass() const
Definition symtab.h:1274
domain_enum domain() const
Definition symtab.h:1286
bool matches(domain_enum d) const
Definition symtab.h:1281
bool is_inlined() const
Definition symtab.h:1316
struct objfile * objfile() const
Definition symtab.c:6482
struct gdbarch * arch
Definition symtab.h:1460
struct obj_section * find_pc_mapped_section(CORE_ADDR pc)
Definition symfile.c:3203
struct compunit_symtab * find_pc_sect_compunit_symtab(CORE_ADDR pc, struct obj_section *section)
Definition symtab.c:2827
struct compunit_symtab * find_pc_compunit_symtab(CORE_ADDR pc)
Definition symtab.c:2946
symbol_name_match_type
Definition symtab.h:63
@ LOC_UNRESOLVED
Definition symtab.h:1057
domain_enum
Definition symtab.h:900
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
Definition utils.c:3166