diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-11-19 21:18:05 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-02-06 15:48:18 -0500 |
commit | 102cc23543fc37b42c4814f594f130f862397178 (patch) | |
tree | 641e7dce863b6e1aa80b58aafeb5bc2ae862fa49 /gdb/symtab.c | |
parent | 36664835fa3f81503633024e0e834be4d84276e1 (diff) | |
download | gdb-102cc23543fc37b42c4814f594f130f862397178.zip gdb-102cc23543fc37b42c4814f594f130f862397178.tar.gz gdb-102cc23543fc37b42c4814f594f130f862397178.tar.bz2 |
gdb: move compunit_filetabs to compunit_symtab::filetabs
Make compunit_filetabs, used to iterate a compunit_symtab's filetabs, a
method of compunit_symtab. The name filetabs conflicts with the current
name of the field. Rename the field to m_filetabs, since at this point
nothing outside of compunit_symtab uses it, so we should treat it as
private (even though it's not actually private). Rename the
last_filetab field to m_last_filetab as well (it's only used on
compunit_symtab::add_filetab).
Adjust the COMPUNIT_FILETABS macro to keep its current behavior of
returning the first filetab.
Change-Id: I537b553a44451c52d24b18ee1bfa47e23747cfc3
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index f4f5f09..6626ee8 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -367,15 +367,15 @@ compunit_symtab::set_primary_filetab (symtab *primary_filetab) 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; @@ -384,7 +384,7 @@ compunit_symtab::set_primary_filetab (symtab *primary_filetab) prev_filetab = filetab; } - gdb_assert (primary_filetab == this->filetabs); + gdb_assert (primary_filetab == m_filetabs); } /* See symtab.h. */ @@ -392,10 +392,10 @@ compunit_symtab::set_primary_filetab (symtab *primary_filetab) 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. */ @@ -533,7 +533,7 @@ iterate_over_some_symtabs (const char *name, 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)) { @@ -3282,7 +3282,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *section, int notcurrent) 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); @@ -3483,7 +3483,7 @@ find_line_symtab (struct symtab *sym_tab, int line, { for (compunit_symtab *cu : objfile->compunits ()) { - for (symtab *s : compunit_filetabs (cu)) + for (symtab *s : cu->filetabs ()) { struct linetable *l; int ind; @@ -4531,7 +4531,7 @@ info_sources_worker (struct ui_out *uiout, 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); @@ -6190,7 +6190,7 @@ make_source_files_completion_list (const char *text, const char *word) { for (compunit_symtab *cu : objfile->compunits ()) { - for (symtab *s : compunit_filetabs (cu)) + for (symtab *s : cu->filetabs ()) { if (not_interesting_fname (s->filename)) continue; |