{
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cu))
+ for (symtab *s : cu->filetabs ())
patch_opaque_types (s);
}
}
{
++nr_compunit_symtabs;
nr_blocks += BLOCKVECTOR_NBLOCKS (COMPUNIT_BLOCKVECTOR (cu));
- nr_symtabs += std::distance (compunit_filetabs (cu).begin (),
- compunit_filetabs (cu).end ());
+ nr_symtabs += std::distance (cu->filetabs ().begin (),
+ cu->filetabs ().end ());
}
}
}
{
for (compunit_symtab *cust : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cust))
+ for (symtab *s : cust->filetabs ())
{
struct linetable *l;
{
for (compunit_symtab *cu : ofp->compunits ())
{
- for (symtab *symtab : compunit_filetabs (cu))
+ for (symtab *symtab : cu->filetabs ())
{
const char *name = symtab->filename;
int len = strlen (name);
{
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cu))
+ for (symtab *s : cu->filetabs ())
{
if (s->fullname != NULL)
{
i = linetables = 0;
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cu))
+ for (symtab *s : cu->filetabs ())
{
i++;
if (SYMTAB_LINETABLE (s) != NULL)
printf_filtered ("Symtabs:\n");
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *symtab : compunit_filetabs (cu))
+ for (symtab *symtab : cu->filetabs ())
{
printf_filtered ("%s at %s",
symtab_to_filename_for_display (symtab),
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cu))
+ for (symtab *s : cu->filetabs ())
{
int print_for_source = 0;
{
int printed_compunit_symtab_start = 0;
- for (symtab *symtab : compunit_filetabs (cust))
+ for (symtab *symtab : cust->filetabs ())
{
QUIT;
{
for (compunit_symtab *cust : objfile->compunits ())
{
- for (symtab *symtab : compunit_filetabs (cust))
+ for (symtab *symtab : cust->filetabs ())
{
QUIT;
symtab *prev_filetab = nullptr;
/* Move PRIMARY_FILETAB to the head of the filetab list. */
- for (symtab *filetab : compunit_filetabs (this))
+ for (symtab *filetab : this->filetabs ())
{
if (filetab == primary_filetab)
{
if (prev_filetab != nullptr)
{
prev_filetab->next = primary_filetab->next;
- primary_filetab->next = this->filetabs;
- this->filetabs = primary_filetab;
+ primary_filetab->next = m_filetabs;
+ m_filetabs = primary_filetab;
}
break;
prev_filetab = filetab;
}
- gdb_assert (primary_filetab == this->filetabs);
+ gdb_assert (primary_filetab == m_filetabs);
}
/* See symtab.h. */
struct symtab *
compunit_symtab::primary_filetab () const
{
- gdb_assert (this->filetabs != nullptr);
+ gdb_assert (m_filetabs != nullptr);
/* The primary file symtab is the first one in the list. */
- return this->filetabs;
+ return m_filetabs;
}
/* See symtab.h. */
for (cust = first; cust != NULL && cust != after_last; cust = cust->next)
{
- for (symtab *s : compunit_filetabs (cust))
+ for (symtab *s : cust->filetabs ())
{
if (compare_filenames_for_search (s->filename, name))
{
They all have the same apriori range, that we found was right;
but they have different line tables. */
- for (symtab *iter_s : compunit_filetabs (cust))
+ for (symtab *iter_s : cust->filetabs ())
{
/* Find the best line in this symtab. */
l = SYMTAB_LINETABLE (iter_s);
{
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cu))
+ for (symtab *s : cu->filetabs ())
{
struct linetable *l;
int ind;
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cu))
+ for (symtab *s : cu->filetabs ())
{
const char *file = symtab_to_filename_for_display (s);
const char *fullname = symtab_to_fullname (s);
{
for (compunit_symtab *cu : objfile->compunits ())
{
- for (symtab *s : compunit_filetabs (cu))
+ for (symtab *s : cu->filetabs ())
{
if (not_interesting_fname (s->filename))
continue;
char *fullname;
};
+/* A range adapter to allowing iterating over all the file tables in a list. */
+
+using symtab_range = next_range<symtab>;
+
#define SYMTAB_COMPUNIT(symtab) ((symtab)->compunit_symtab)
#define SYMTAB_LINETABLE(symtab) ((symtab)->linetable)
#define SYMTAB_LANGUAGE(symtab) ((symtab)->language)
m_objfile = objfile;
}
+ symtab_range filetabs () const
+ {
+ return symtab_range (m_filetabs);
+ }
+
void add_filetab (symtab *filetab)
{
- if (this->filetabs == nullptr)
+ if (m_filetabs == nullptr)
{
- this->filetabs = filetab;
- this->last_filetab = filetab;
+ m_filetabs = filetab;
+ m_last_filetab = filetab;
}
else
{
- this->last_filetab->next = filetab;
- this->last_filetab = filetab;
+ m_last_filetab->next = filetab;
+ m_last_filetab = filetab;
}
}
source file (e.g., .c, .cc) is guaranteed to be first.
Each symtab is a file, either the "main" source file (e.g., .c, .cc)
or header (e.g., .h). */
- struct symtab *filetabs;
+ symtab *m_filetabs;
/* Last entry in FILETABS list.
Subfiles are added to the end of the list so they accumulate in order,
with the main source subfile living at the front.
The main reason is so that the main source file symtab is at the head
of the list, and the rest appear in order for debugging convenience. */
- struct symtab *last_filetab;
+ symtab *m_last_filetab;
/* Non-NULL string that identifies the format of the debugging information,
such as "stabs", "dwarf 1", "dwarf 2", "coff", etc. This is mostly useful
using compunit_symtab_range = next_range<compunit_symtab>;
-#define COMPUNIT_FILETABS(cust) ((cust)->filetabs)
+#define COMPUNIT_FILETABS(cust) (*(cust)->filetabs ().begin ())
#define COMPUNIT_DEBUGFORMAT(cust) ((cust)->debugformat)
#define COMPUNIT_PRODUCER(cust) ((cust)->producer)
#define COMPUNIT_DIRNAME(cust) ((cust)->dirname)
#define COMPUNIT_EPILOGUE_UNWIND_VALID(cust) ((cust)->epilogue_unwind_valid)
#define COMPUNIT_MACRO_TABLE(cust) ((cust)->macro_table)
-/* A range adapter to allowing iterating over all the file tables
- within a compunit. */
-
-using symtab_range = next_range<symtab>;
-
-static inline symtab_range
-compunit_filetabs (compunit_symtab *cu)
-{
- return symtab_range (cu->filetabs);
-}
-
/* Return the language of CUST. */
extern enum language compunit_language (const struct compunit_symtab *cust);