Lines Matching refs:block
0 /* Block-related functions for the GNU debugger, GDB.
20 #include "block.h"
29 /* This is used by struct block to store namespace-related info for
39 /* See block.h. */
42 block::objfile () const
53 /* See block. */
56 block::gdbarch () const
64 /* See block.h. */
67 block::contains (const struct block *a, bool allow_nested) const
76 /* If A is a function block, then A cannot be contained in B,
87 /* See block.h. */
90 block::linkage_function () const
92 const block *bl = this;
101 /* See block.h. */
104 block::containing_function () const
106 const block *bl = this;
114 /* See block.h. */
117 block::inlined_p () const
123 It returns the containing block if there is one, or else NULL. */
125 static const struct block *
128 const struct block *b;
134 return (const struct block *) bl->map ()->find (pc);
136 /* Otherwise, use binary search to find the last block that starts
138 Note: GLOBAL_BLOCK is block 0, STATIC_BLOCK is block 1.
149 b = bl->block (bot + half);
156 /* Now search backward for a block that ends after PC. */
160 b = bl->block (bot);
172 block containing the specified pc value and section, or 0 if there
173 is none. PBLOCK is a pointer to the block. If PBLOCK is NULL, we
178 const struct block **pblock,
182 const struct block *b;
194 /* Then search that symtab for the smallest block that wins. */
245 /* Return the blockvector immediately containing the innermost lexical block
250 blockvector_for_pc (CORE_ADDR pc, const struct block **pblock)
256 /* Return the innermost lexical block containing the specified pc value
259 const struct block *
263 const struct block *b;
271 /* Return the innermost lexical block containing the specified pc value,
274 const struct block *
283 /* See block.h. */
286 block::scope () const
288 for (const block *block = this;
289 block != nullptr;
290 block = block->superblock ())
292 if (block->m_namespace_info != nullptr
293 && block->m_namespace_info->scope != nullptr)
294 return block->m_namespace_info->scope;
300 /* See block.h. */
303 block::initialize_namespace (struct obstack *obstack)
309 /* See block.h. */
312 block::set_scope (const char *scope, struct obstack *obstack)
324 /* See block.h. */
327 block::get_using () const
335 /* See block.h. */
338 block::set_using (struct using_direct *using_decl, struct obstack *obstack)
350 /* See block.h. */
352 const struct block *
353 block::static_block () const
358 const block *block = this;
359 while (block->superblock ()->superblock () != NULL)
360 block = block->superblock ();
362 return block;
365 /* See block.h. */
367 const struct block *
368 block::global_block () const
370 const block *block = this;
372 while (block->superblock () != NULL)
373 block = block->superblock ();
375 return block;
378 /* See block.h. */
380 const struct block *
381 block::function_block () const
383 const block *block = this;
385 while (block != nullptr && block->function () == nullptr)
386 block = block->superblock ();
388 return block;
391 /* See block.h. */
394 block::set_compunit_symtab (struct compunit_symtab *cu)
404 /* See block.h. */
407 block::static_link () const
419 /* Return the compunit of the global block. */
422 get_block_compunit_symtab (const struct block *block)
426 gdb_assert (block->superblock () == NULL);
427 gb = (struct global_block *) block;
435 /* Initialize a block iterator, either to iterate over a single block,
440 initialize_block_iterator (const struct block *block,
450 if (block->superblock () == NULL)
453 cu = get_block_compunit_symtab (block);
455 else if (block->superblock ()->superblock () == NULL)
458 cu = get_block_compunit_symtab (block->superblock ());
462 iter->d.block = block;
464 block. */
476 search a single block, so we might as well just do that
480 iter->d.block = block;
482 block. */
493 or global block we should iterate. */
503 /* Perform a single step for a plain block iterator, iterating across
520 const struct block *block;
526 block = cust->blockvector ()->block (iterator->which);
527 sym = mdict_iterator_first (block->multidict (),
536 /* We have finished iterating the appropriate block of one
544 /* Perform a single step for a "match" block iterator, iterating
562 const struct block *block;
568 block = cust->blockvector ()->block (iterator->which);
569 sym = mdict_iter_match_first (block->multidict (), *iterator->name,
578 /* We have finished iterating the appropriate block of one
586 /* See block.h. */
589 block_iterator_first (const struct block *block,
593 initialize_block_iterator (block, iterator, name);
598 return mdict_iterator_first (block->multidict (),
605 return mdict_iter_match_first (block->multidict (), *name,
611 /* See block.h. */
630 /* See block.h. */
644 /* See block.h. */
670 /* See block.h.
682 block_lookup_symbol (const struct block *block, const lookup_name_info &name,
685 if (!block->function ())
689 for (struct symbol *sym : block_iterator_range (block, &name))
717 for (struct symbol *sym : block_iterator_range (block, &name))
732 /* See block.h. */
735 block_lookup_symbol_primary (const struct block *block, const char *name,
743 /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */
744 gdb_assert (block->superblock () == NULL
745 || block->superblock ()->superblock () == NULL);
748 for (sym = mdict_iter_match_first (block->multidict (), lookup_name,
794 /* See block.h. */
797 block_find_symbol (const struct block *block, const lookup_name_info &name,
800 /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */
801 gdb_assert (block->superblock () == NULL
802 || block->superblock ()->superblock () == NULL);
804 for (struct symbol *sym : block_iterator_range (block, &name))
818 /* See block.h. */