{
map_matching_symbols (&objfile, lookup_name, domain, global, data);
- for (compunit_symtab *cu : objfile.compunits ())
+ for (compunit_symtab &cu : objfile.compunits ())
{
const struct block *global_block
- = cu->blockvector ()->global_block ();
+ = cu.blockvector ()->global_block ();
if (ada_add_block_renamings (result, global_block, lookup_name,
domain))
/* Patch up any opaque types (references to types that are not defined
in the file where they are referenced, e.g. "struct foo *bar"). */
{
- for (compunit_symtab *cu : objfile->compunits ())
+ for (compunit_symtab &cu : objfile->compunits ())
{
- for (symtab *s : cu->filetabs ())
+ for (symtab *s : cu.filetabs ())
patch_opaque_types (s);
}
}
{
for (objfile &o : current_program_space->objfiles ())
{
- for (compunit_symtab *cu : o.compunits ())
+ for (compunit_symtab &cu : o.compunits ())
{
++nr_compunit_symtabs;
- nr_blocks += cu->blockvector ()->num_blocks ();
- nr_symtabs += std::distance (cu->filetabs ().begin (),
- cu->filetabs ().end ());
+ nr_blocks += cu.blockvector ()->num_blocks ();
+ nr_symtabs += std::distance (cu.filetabs ().begin (),
+ cu.filetabs ().end ());
}
}
}
return 0;
/* OK, get all the symtabs. */
- for (compunit_symtab *cust : objfile->compunits ())
+ for (compunit_symtab &cust : objfile->compunits ())
{
- struct blockvector *bv = cust->blockvector ();
+ struct blockvector *bv = cust.blockvector ();
int block_line_section = SECT_OFF_TEXT (objfile);
if (bv->map () != nullptr)
#include <forward_list>
#include "gdbsupport/unordered_map.h"
#include "gdbsupport/owning_intrusive_list.h"
-#include "gdbsupport/reference-to-pointer-iterator.h"
struct htab;
struct objfile_data;
program_space *pspace () { return m_pspace; }
using compunit_symtab_iterator
- = reference_to_pointer_iterator<owning_intrusive_list<compunit_symtab>::iterator>;
+ = owning_intrusive_list<compunit_symtab>::iterator;
using compunit_symtab_range = iterator_range<compunit_symtab_iterator>;
/* A range adapter that makes it possible to iterate over all
for (objfile &ofp : current_program_space->objfiles ())
{
- for (compunit_symtab *cu : ofp.compunits ())
+ for (compunit_symtab &cu : ofp.compunits ())
{
- for (symtab *symtab : cu->filetabs ())
+ for (symtab *symtab : cu.filetabs ())
{
const char *name = symtab->filename;
int len = strlen (name);
gdb_printf (gdb_stdlog, "qf->forget_cached_source_info (%s)\n",
objfile_debug_name (this));
- for (compunit_symtab *cu : compunits ())
- cu->forget_cached_source_info ();
+ for (compunit_symtab &cu : compunits ())
+ cu.forget_cached_source_info ();
for (const auto &iter : qf)
iter->forget_cached_source_info (this);
OBJSTAT ((&objfile), n_types));
i = linetables = 0;
- for (compunit_symtab *cu : objfile.compunits ())
+ for (compunit_symtab &cu : objfile.compunits ())
{
- for (symtab *s : cu->filetabs ())
+ for (symtab *s : cu.filetabs ())
{
i++;
if (s->linetable () != NULL)
objfile->dump ();
bool symtabs_printed = false;
- for (compunit_symtab *cu : objfile->compunits ())
+ for (compunit_symtab &cu : objfile->compunits ())
{
if (!symtabs_printed)
{
symtabs_printed = true;
}
- for (symtab *symtab : cu->filetabs ())
+ for (symtab *symtab : cu.filetabs ())
{
gdb_printf ("%s at %s",
symtab_to_filename_for_display (symtab),
if (!print_for_objfile)
continue;
- for (compunit_symtab *cu : objfile.compunits ())
+ for (compunit_symtab &cu : objfile.compunits ())
{
- for (symtab *s : cu->filetabs ())
+ for (symtab *s : cu.filetabs ())
{
int print_for_source = 0;
actually find a symtab whose name matches. */
int printed_objfile_start = 0;
- for (compunit_symtab *cust : objfile.compunits ())
+ for (compunit_symtab &cust : objfile.compunits ())
{
int printed_compunit_symtab_start = 0;
- for (symtab *symtab : cust->filetabs ())
+ for (symtab *symtab : cust.filetabs ())
{
QUIT;
if (! printed_compunit_symtab_start)
{
gdb_printf (" { ((struct compunit_symtab *) %s)\n",
- host_address_to_string (cust));
+ host_address_to_string (&cust));
gdb_printf (" debugformat %s\n",
- cust->debugformat ());
+ cust.debugformat ());
gdb_printf (" producer %s\n",
- (cust->producer () != nullptr
- ? cust->producer () : "(null)"));
- gdb_printf (" name %s\n", cust->name);
+ (cust.producer () != nullptr
+ ? cust.producer () : "(null)"));
+ gdb_printf (" name %s\n", cust.name);
gdb_printf (" dirname %s\n",
- (cust->dirname () != NULL
- ? cust->dirname () : "(null)"));
+ (cust.dirname () != NULL
+ ? cust.dirname () : "(null)"));
gdb_printf (" blockvector"
" ((struct blockvector *) %s)\n",
host_address_to_string
- (cust->blockvector ()));
+ (cust.blockvector ()));
gdb_printf (" user"
" ((struct compunit_symtab *) %s)\n",
- cust->user != nullptr
- ? host_address_to_string (cust->user)
+ cust.user != nullptr
+ ? host_address_to_string (cust.user)
: "(null)");
- if (cust->includes != nullptr)
+ if (cust.includes != nullptr)
{
gdb_printf (" ( includes\n");
for (int i = 0; ; ++i)
{
struct compunit_symtab *include
- = cust->includes[i];
+ = cust.includes[i];
if (include == nullptr)
break;
const char *addr
actually find something worth printing. */
int printed_objfile_start = 0;
- for (compunit_symtab *cust : objfile.compunits ())
+ for (compunit_symtab &cust : objfile.compunits ())
{
int found_something = 0;
- struct symtab *symtab = cust->primary_filetab ();
+ struct symtab *symtab = cust.primary_filetab ();
QUIT;
- if (cust->blockvector () == NULL)
+ if (cust.blockvector () == NULL)
found_something = 1;
/* Add more checks here. */
}
gdb_printf (" { symtab %s\n",
symtab_to_filename_for_display (symtab));
- if (cust->blockvector () == NULL)
+ if (cust.blockvector () == NULL)
gdb_printf (" NULL blockvector\n");
gdb_printf (" }\n");
}
for (struct program_space *pspace : program_spaces)
for (objfile &objfile : pspace->objfiles ())
{
- for (compunit_symtab *cust : objfile.compunits ())
+ for (compunit_symtab &cust : objfile.compunits ())
{
- for (symtab *symtab : cust->filetabs ())
+ for (symtab *symtab : cust.filetabs ())
{
QUIT;
lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
best_symbol_tracker accum;
- for (compunit_symtab *cust : objfile->compunits ())
+ for (compunit_symtab &cust : objfile->compunits ())
{
const struct blockvector *bv;
const struct block *block;
- bv = cust->blockvector ();
+ bv = cust.blockvector ();
block = bv->block (block_index);
- if (accum.search (cust, block, lookup_name, domain))
+ if (accum.search (&cust, block, lookup_name, domain))
break;
}
for (objfile &obj_file : current_program_space->objfiles ())
{
- for (compunit_symtab *cust : obj_file.compunits ())
+ for (compunit_symtab &cust : obj_file.compunits ())
{
- const struct blockvector *bv = cust->blockvector ();
+ const struct blockvector *bv = cust.blockvector ();
const struct block *global_block = bv->global_block ();
CORE_ADDR start = global_block->start ();
CORE_ADDR end = global_block->end ();
if (bv->map ()->find (pc) == nullptr)
continue;
- return cust;
+ return &cust;
}
CORE_ADDR range = end - start;
}
/* Cust is best found so far, save it. */
- best_cust = cust;
+ best_cust = &cust;
best_cust_range = range;
}
}
search the symtabs directly. */
if ((objfile.flags & OBJF_READNOW) != 0)
{
- for (compunit_symtab *symtab : objfile.compunits ())
+ for (compunit_symtab &symtab : objfile.compunits ())
{
- struct symbol *sym = search_symtab (symtab, address);
+ struct symbol *sym = search_symtab (&symtab, address);
if (sym != nullptr)
return sym;
}
for (objfile &objfile : current_program_space->objfiles ())
{
- for (compunit_symtab *cu : objfile.compunits ())
+ for (compunit_symtab &cu : objfile.compunits ())
{
- for (symtab *s : cu->filetabs ())
+ for (symtab *s : cu.filetabs ())
{
const struct linetable *l;
int ind;
sources_list.emplace (uiout, "sources");
}
- for (compunit_symtab *cu : objfile.compunits ())
+ for (compunit_symtab &cu : objfile.compunits ())
{
- for (symtab *s : cu->filetabs ())
+ for (symtab *s : cu.filetabs ())
{
const char *file = symtab_to_filename_for_display (s);
const char *fullname = symtab_to_fullname (s);
domain_search_flags kind = m_kind;
/* Add matching symbols (if not already present). */
- for (compunit_symtab *cust : objfile->compunits ())
+ for (compunit_symtab &cust : objfile->compunits ())
{
- const struct blockvector *bv = cust->blockvector ();
+ const struct blockvector *bv = cust.blockvector ();
for (block_enum block : { GLOBAL_BLOCK, STATIC_BLOCK })
{
for (objfile &objfile : current_program_space->objfiles ())
{
- for (compunit_symtab *cu : objfile.compunits ())
+ for (compunit_symtab &cu : objfile.compunits ())
{
- for (symtab *s : cu->filetabs ())
+ for (symtab *s : cu.filetabs ())
{
if (not_interesting_fname (s->filename))
continue;