aboutsummaryrefslogtreecommitdiff
path: root/gdb/symtab.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2021-11-19 22:15:30 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2022-02-06 15:48:18 -0500
commit0d9acb4531cfe336b2b335fbaa1f2ef878a6e4d9 (patch)
tree1e26fd55ddf025d4587b6f89178a07c3baff0e83 /gdb/symtab.h
parentab5f850eed6aba84050d075e8c8a2cb16a876b15 (diff)
downloadgdb-0d9acb4531cfe336b2b335fbaa1f2ef878a6e4d9.zip
gdb-0d9acb4531cfe336b2b335fbaa1f2ef878a6e4d9.tar.gz
gdb-0d9acb4531cfe336b2b335fbaa1f2ef878a6e4d9.tar.bz2
gdb: remove COMPUNIT_DIRNAME macro, add getter/setter
Add a getter and a setter for a compunit_symtab's dirname. Remove the corresponding macro and adjust all callers. Change-Id: If2f39b295fd26822586485e04a8b8b5aa5cc9b2e
Diffstat (limited to 'gdb/symtab.h')
-rw-r--r--gdb/symtab.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/symtab.h b/gdb/symtab.h
index 1e3f95d..b72abab 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1413,8 +1413,7 @@ using symtab_range = next_range<symtab>;
#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
@@ -1502,6 +1501,16 @@ struct compunit_symtab
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. */
@@ -1551,7 +1560,7 @@ struct 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. */
@@ -1597,7 +1606,6 @@ struct compunit_symtab
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)