gdb: remove COMPUNIT_FILETABS macro

I think that most remaining uses of COMPUNIT_FILETABS intend to get the
primary filetab of the compunit_symtab specifically (and not to iterate
over all filetabs, for example, those cases would use compunit_filetabs,
which has been converted to compunit_symtab::filetabs), so replace mosts
uses with compunit_symtab::primary_filetab.

In jit.c, function finalize_symtab, we can save the symtab object
returned by allocate_symtab and use it, it makes things simpler.

Change-Id: I4e51d6d4b40759de8768b61292e5e13c8eae2e38
This commit is contained in:
Simon Marchi
2021-11-19 21:35:17 -05:00
committed by Simon Marchi
parent 102cc23543
commit 510860f278
7 changed files with 24 additions and 24 deletions

View File

@ -329,8 +329,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
}
else
{
compunit_symtab *compunit = SYMTAB_COMPUNIT (symtab);
const char *compunit_filename
= symtab_to_filename_for_display (COMPUNIT_FILETABS (SYMTAB_COMPUNIT (symtab)));
= symtab_to_filename_for_display (compunit->primary_filetab ());
fprintf_filtered (outfile,
"\nBlockvector same as owning compunit: %s\n\n",
@ -346,7 +347,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
if (cust->user != nullptr)
{
const char *addr
= host_address_to_string (COMPUNIT_FILETABS (cust->user));
= host_address_to_string (cust->user->primary_filetab ());
fprintf_filtered (outfile, "Compunit user: %s\n", addr);
}
if (cust->includes != nullptr)
@ -356,7 +357,7 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
if (include == nullptr)
break;
const char *addr
= host_address_to_string (COMPUNIT_FILETABS (include));
= host_address_to_string (include->primary_filetab ());
fprintf_filtered (outfile, "Compunit include: %s\n", addr);
}
}