From c61596525811d9b0fe79be8f11e5a142ade96dab Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 19 Nov 2021 22:49:01 -0500 Subject: gdb: remove SYMTAB_COMPUNIT macro, add getter/setter Add a getter and a setter for a symtab's compunit_symtab. Remove the corresponding macro and adjust all callers. For brevity, I chose the name "compunit" instead of "compunit_symtab" the the field, getter and setter names. Since we are already in symtab context, the _symtab suffix seems redundant. Change-Id: I4b9b731c96e3594f7733e75af1e3d01bc0e4fe92 --- gdb/source.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'gdb/source.c') diff --git a/gdb/source.c b/gdb/source.c index e6ba448..ee89626 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -711,7 +711,7 @@ info_source_command (const char *ignore, int from_tty) return; } - cust = SYMTAB_COMPUNIT (s); + cust = s->compunit (); printf_filtered (_("Current source file is %s\n"), s->filename); if (SYMTAB_DIRNAME (s) != NULL) printf_filtered (_("Compilation directory is %s\n"), SYMTAB_DIRNAME (s)); @@ -1184,9 +1184,9 @@ open_source_file (struct symtab *s) if (fd.get () < 0) { - if (SYMTAB_COMPUNIT (s) != nullptr) + if (s->compunit () != nullptr) { - const objfile *ofp = SYMTAB_COMPUNIT (s)->objfile (); + const objfile *ofp = s->compunit ()->objfile (); std::string srcpath; if (IS_ABSOLUTE_PATH (s->filename)) -- cgit v1.1