buildsym_compunit
= new struct buildsym_compunit (cust->objfile (),
name,
- COMPUNIT_DIRNAME (cust),
+ cust->dirname (),
compunit_language (cust),
start_addr,
cust);
{
/* Reallocate the dirname on the symbol obstack. */
const char *comp_dir = m_comp_dir.get ();
- COMPUNIT_DIRNAME (cu) = obstack_strdup (&m_objfile->objfile_obstack,
- comp_dir);
+ cu->set_dirname (obstack_strdup (&m_objfile->objfile_obstack,
+ comp_dir));
}
/* Save the debug format string (if any) in the symtab. */
struct compunit_symtab *cust = tug_unshare->compunit_symtab;
m_builder.reset (new struct buildsym_compunit
(cust->objfile (), "",
- COMPUNIT_DIRNAME (cust),
+ cust->dirname (),
compunit_language (cust),
0, cust));
list_in_scope = get_builder ()->get_file_symbols ();
struct compunit_symtab *cust = tug_unshare->compunit_symtab;
m_builder.reset (new struct buildsym_compunit
(cust->objfile (), "",
- COMPUNIT_DIRNAME (cust),
+ cust->dirname (),
compunit_language (cust),
0, cust));
list_in_scope = get_builder ()->get_file_symbols ();
add_compunit_symtab_to_objfile (cust);
/* JIT compilers compile in memory. */
- COMPUNIT_DIRNAME (cust) = NULL;
+ cust->set_dirname (nullptr);
/* Copy over the linetable entry if one was provided. */
if (stab->linetable)
const char *comp_dir = NULL;
if (file->table->compunit_symtab != NULL)
- comp_dir = COMPUNIT_DIRNAME (file->table->compunit_symtab);
+ comp_dir = file->table->compunit_symtab->dirname ();
if (comp_dir == NULL || IS_ABSOLUTE_PATH (file->filename))
return file->filename;
(cust->producer () != nullptr
? cust->producer () : "(null)"));
printf_filtered (" dirname %s\n",
- COMPUNIT_DIRNAME (cust) != NULL
- ? COMPUNIT_DIRNAME (cust)
- : "(null)");
+ (cust->dirname () != NULL
+ ? cust->dirname () : "(null)"));
printf_filtered (" blockvector"
" ((struct blockvector *) %s)\n",
host_address_to_string
#define SYMTAB_OBJFILE(symtab) \
(SYMTAB_COMPUNIT (symtab)->objfile ())
#define SYMTAB_PSPACE(symtab) (SYMTAB_OBJFILE (symtab)->pspace)
-#define SYMTAB_DIRNAME(symtab) \
- COMPUNIT_DIRNAME (SYMTAB_COMPUNIT (symtab))
+#define SYMTAB_DIRNAME(symtab) (SYMTAB_COMPUNIT (symtab)->dirname ())
/* Compunit symtabs contain the actual "symbol table", aka blockvector, as well
as the list of all source files (what gdb has historically associated with
m_producer = producer;
}
+ const char *dirname () const
+ {
+ return m_dirname;
+ }
+
+ void set_dirname (const char *dirname)
+ {
+ m_dirname = dirname;
+ }
+
/* Make PRIMARY_FILETAB the primary filetab of this compunit symtab.
PRIMARY_FILETAB must already be a filetab of this compunit symtab. */
const char *m_producer;
/* Directory in which it was compiled, or NULL if we don't know. */
- const char *dirname;
+ const char *m_dirname;
/* List of all symbol scope blocks for this symtab. It is shared among
all symtabs in a given compilation unit. */
using compunit_symtab_range = next_range<compunit_symtab>;
-#define COMPUNIT_DIRNAME(cust) ((cust)->dirname)
#define COMPUNIT_BLOCKVECTOR(cust) ((cust)->blockvector)
#define COMPUNIT_BLOCK_LINE_SECTION(cust) ((cust)->block_line_section)
#define COMPUNIT_LOCATIONS_VALID(cust) ((cust)->locations_valid)