diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2021-11-20 22:23:01 -0500 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2022-02-06 16:03:46 -0500 |
commit | cdc22ffbf5c76b9fb907bdec700c19d350abb226 (patch) | |
tree | aa9d730ff474371ca3038ce509d7ee89ee24ab6a /gdb/linespec.c | |
parent | 652099717dbb767c9d3eaed4c533486dd99d5e5b (diff) | |
download | gdb-cdc22ffbf5c76b9fb907bdec700c19d350abb226.zip gdb-cdc22ffbf5c76b9fb907bdec700c19d350abb226.tar.gz gdb-cdc22ffbf5c76b9fb907bdec700c19d350abb226.tar.bz2 |
gdb: remove SYMTAB_PSPACE macro
Remove the macro, replace with an equivalent method.
Change-Id: Icccc20e7e8ae03ac4dac1c7514c25a12a9a0ac69
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r-- | gdb/linespec.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c index c4edc0d..bacf343 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -2265,7 +2265,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls) for (const auto &sym : ls->labels.label_symbols) { struct program_space *pspace - = SYMTAB_PSPACE (symbol_symtab (sym.symbol)); + = symbol_symtab (sym.symbol)->pspace (); if (symbol_to_sal (&sal, state->funfirstline, sym.symbol) && maybe_add_address (state->addr_set, pspace, sal.pc)) @@ -2287,7 +2287,7 @@ convert_linespec_to_sals (struct linespec_state *state, linespec *ls) for (const auto &sym : ls->function_symbols) { program_space *pspace - = SYMTAB_PSPACE (symbol_symtab (sym.symbol)); + = symbol_symtab (sym.symbol)->pspace (); set_current_program_space (pspace); /* Don't skip to the first line of the function if we @@ -3539,8 +3539,8 @@ lookup_prefix_sym (struct linespec_state *state, { /* Program spaces that are executing startup should have been filtered out earlier. */ - gdb_assert (!SYMTAB_PSPACE (elt)->executing_startup); - set_current_program_space (SYMTAB_PSPACE (elt)); + gdb_assert (!elt->pspace ()->executing_startup); + set_current_program_space (elt->pspace ()); iterate_over_file_blocks (elt, lookup_name, STRUCT_DOMAIN, collector); iterate_over_file_blocks (elt, lookup_name, VAR_DOMAIN, collector); } @@ -3558,8 +3558,8 @@ compare_symbols (const block_symbol &a, const block_symbol &b) { uintptr_t uia, uib; - uia = (uintptr_t) SYMTAB_PSPACE (symbol_symtab (a.symbol)); - uib = (uintptr_t) SYMTAB_PSPACE (symbol_symtab (b.symbol)); + uia = (uintptr_t) symbol_symtab (a.symbol)->pspace (); + uib = (uintptr_t) symbol_symtab (b.symbol)->pspace (); if (uia < uib) return true; @@ -3683,7 +3683,7 @@ find_method (struct linespec_state *self, /* Program spaces that are executing startup should have been filtered out earlier. */ - pspace = SYMTAB_PSPACE (symbol_symtab (sym)); + pspace = symbol_symtab (sym)->pspace (); gdb_assert (!pspace->executing_startup); set_current_program_space (pspace); t = check_typedef (SYMBOL_TYPE (sym)); @@ -3694,7 +3694,7 @@ find_method (struct linespec_state *self, sure not to miss the last batch. */ if (ix == sym_classes->size () - 1 || (pspace - != SYMTAB_PSPACE (symbol_symtab (sym_classes->at (ix + 1).symbol)))) + != symbol_symtab (sym_classes->at (ix + 1).symbol)->pspace ())) { /* If we did not find a direct implementation anywhere in this program space, consider superclasses. */ @@ -4058,7 +4058,7 @@ find_label_symbols (struct linespec_state *self, for (const auto &elt : function_symbols) { fn_sym = elt.symbol; - set_current_program_space (SYMTAB_PSPACE (symbol_symtab (fn_sym))); + set_current_program_space (symbol_symtab (fn_sym)->pspace ()); block = SYMBOL_BLOCK_VALUE (fn_sym); find_label_symbols_in_block (block, name, fn_sym, completion_mode, @@ -4087,13 +4087,13 @@ decode_digits_list_mode (struct linespec_state *self, /* The logic above should ensure this. */ gdb_assert (elt != NULL); - set_current_program_space (SYMTAB_PSPACE (elt)); + set_current_program_space (elt->pspace ()); /* Simplistic search just for the list command. */ val.symtab = find_line_symtab (elt, val.line, NULL, NULL); if (val.symtab == NULL) val.symtab = elt; - val.pspace = SYMTAB_PSPACE (elt); + val.pspace = elt->pspace (); val.pc = 0; val.explicit_line = true; @@ -4121,13 +4121,13 @@ decode_digits_ordinary (struct linespec_state *self, /* The logic above should ensure this. */ gdb_assert (elt != NULL); - set_current_program_space (SYMTAB_PSPACE (elt)); + set_current_program_space (elt->pspace ()); pcs = find_pcs_for_symtab_line (elt, line, best_entry); for (CORE_ADDR pc : pcs) { symtab_and_line sal; - sal.pspace = SYMTAB_PSPACE (elt); + sal.pspace = elt->pspace (); sal.symtab = elt; sal.line = line; sal.explicit_line = true; @@ -4319,9 +4319,9 @@ search_minsyms_for_name (struct collect_info *info, } else { - if (search_pspace == NULL || SYMTAB_PSPACE (symtab) == search_pspace) + if (search_pspace == NULL || symtab->pspace () == search_pspace) { - set_current_program_space (SYMTAB_PSPACE (symtab)); + set_current_program_space (symtab->pspace ()); iterate_over_minimal_symbols (symtab->objfile (), name, [&] (struct minimal_symbol *msym) @@ -4407,14 +4407,14 @@ add_matching_symbols_to_info (const char *name, { return info->add_symbol (bsym); }); search_minsyms_for_name (info, lookup_name, pspace, NULL); } - else if (pspace == NULL || pspace == SYMTAB_PSPACE (elt)) + else if (pspace == NULL || pspace == elt->pspace ()) { int prev_len = info->result.symbols->size (); /* Program spaces that are executing startup should have been filtered out earlier. */ - gdb_assert (!SYMTAB_PSPACE (elt)->executing_startup); - set_current_program_space (SYMTAB_PSPACE (elt)); + gdb_assert (!elt->pspace ()->executing_startup); + set_current_program_space (elt->pspace ()); iterate_over_file_blocks (elt, lookup_name, VAR_DOMAIN, [&] (block_symbol *bsym) { return info->add_symbol (bsym); }); @@ -4453,7 +4453,7 @@ symbol_to_sal (struct symtab_and_line *result, result->symbol = sym; result->line = SYMBOL_LINE (sym); result->pc = SYMBOL_VALUE_ADDRESS (sym); - result->pspace = SYMTAB_PSPACE (result->symtab); + result->pspace = result->symtab->pspace (); result->explicit_pc = 1; return 1; } @@ -4469,7 +4469,7 @@ symbol_to_sal (struct symtab_and_line *result, result->symbol = sym; result->line = SYMBOL_LINE (sym); result->pc = SYMBOL_VALUE_ADDRESS (sym); - result->pspace = SYMTAB_PSPACE (result->symtab); + result->pspace = result->symtab->pspace (); return 1; } } |