diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-11-19 22:49:01 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@polymtl.ca> | 2022-02-06 15:48:19 -0500 |
commit | c61596525811d9b0fe79be8f11e5a142ade96dab (patch) | |
tree | 8bc43629e072791d0790a2264c0b1fcd7998bd3b /gdb/symtab.c | |
parent | 10cc645b6a09c58cf1a5ce53accbe6cf3178ca12 (diff) | |
download | fsf-binutils-gdb-c61596525811d9b0fe79be8f11e5a142ade96dab.zip fsf-binutils-gdb-c61596525811d9b0fe79be8f11e5a142ade96dab.tar.gz fsf-binutils-gdb-c61596525811d9b0fe79be8f11e5a142ade96dab.tar.bz2 |
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
Diffstat (limited to 'gdb/symtab.c')
-rw-r--r-- | gdb/symtab.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/symtab.c b/gdb/symtab.c index 5ad5cdb..459c0c3 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3709,7 +3709,7 @@ find_function_start_sal_1 (CORE_ADDR func_addr, obj_section *section, symtab_and_line sal = find_pc_sect_line (func_addr, section, 0); if (funfirstline && sal.symtab != NULL - && (SYMTAB_COMPUNIT (sal.symtab)->locations_valid () + && (sal.symtab->compunit ()->locations_valid () || SYMTAB_LANGUAGE (sal.symtab) == language_asm)) { struct gdbarch *gdbarch = SYMTAB_OBJFILE (sal.symtab)->arch (); @@ -3885,7 +3885,7 @@ skip_prologue_sal (struct symtab_and_line *sal) have proven the CU (Compilation Unit) supports it. sal->SYMTAB does not have to be set by the caller so we use SYM instead. */ if (sym != NULL - && SYMTAB_COMPUNIT (symbol_symtab (sym))->locations_valid ()) + && symbol_symtab (sym)->compunit ()->locations_valid ()) force_skip = 0; saved_pc = pc; @@ -6095,7 +6095,7 @@ collect_file_symbol_completion_matches (completion_tracker &tracker, for symbols which match. */ iterate_over_symtabs (srcfile, [&] (symtab *s) { - add_symtab_completions (SYMTAB_COMPUNIT (s), + add_symtab_completions (s->compunit (), tracker, mode, lookup_name, sym_text, word, TYPE_CODE_UNDEF); return false; |