diff options
author | Klaus Gerlicher <klaus.gerlicher@intel.com> | 2024-10-10 08:23:11 +0000 |
---|---|---|
committer | Klaus Gerlicher <klaus.gerlicher@intel.com> | 2024-11-06 10:15:25 +0000 |
commit | 7ea50bf94f22c651cd3aa8ca54e31682c28820fb (patch) | |
tree | 5ebc2e8899368cfce3fca7724c525516c2651414 | |
parent | 52a8387dfdd34f3c62a92614c83b5ca93c9ba18c (diff) | |
download | gdb-7ea50bf94f22c651cd3aa8ca54e31682c28820fb.zip gdb-7ea50bf94f22c651cd3aa8ca54e31682c28820fb.tar.gz gdb-7ea50bf94f22c651cd3aa8ca54e31682c28820fb.tar.bz2 |
gdb: remove exact_match parameter from find_line_symtab
struct symtab *find_line_symtab (struct symtab *, int, int *, bool *);
The last parameter is bool* that when set will receive information
if the match was exact. This parameter is never used by any callsite
and can therefore be removed.
This will become:
symtab *find_line_symtab (symtab *sym_tab, int line, int *index);
Approved-By: Tom Tromey <tom@tromey.com>
-rw-r--r-- | gdb/linespec.c | 2 | ||||
-rw-r--r-- | gdb/symtab.c | 19 | ||||
-rw-r--r-- | gdb/symtab.h | 11 |
3 files changed, 15 insertions, 17 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c index 4d8a8c1..528abc4 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -4031,7 +4031,7 @@ decode_digits_list_mode (struct linespec_state *self, set_current_program_space (pspace); /* Simplistic search just for the list command. */ - val.symtab = find_line_symtab (elt, val.line, NULL, NULL); + val.symtab = find_line_symtab (elt, val.line, nullptr); if (val.symtab == NULL) val.symtab = elt; val.pspace = pspace; diff --git a/gdb/symtab.c b/gdb/symtab.c index 7b11d43..74ba8b4 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -3455,19 +3455,10 @@ find_pc_line_symtab (CORE_ADDR pc) return sal.symtab; } -/* Find line number LINE in any symtab whose name is the same as - SYMTAB. - - If found, return the symtab that contains the linetable in which it was - found, set *INDEX to the index in the linetable of the best entry - found, and set *EXACT_MATCH to true if the value returned is an - exact match. - - If not found, return NULL. */ +/* See symtab.h. */ -struct symtab * -find_line_symtab (struct symtab *sym_tab, int line, - int *index, bool *exact_match) +symtab * +find_line_symtab (symtab *sym_tab, int line, int *index) { int exact = 0; /* Initialized here to avoid a compiler warning. */ @@ -3547,8 +3538,6 @@ done: if (index) *index = best_index; - if (exact_match) - *exact_match = (exact != 0); return best_symtab; } @@ -3609,7 +3598,7 @@ find_line_pc (struct symtab *symtab, int line, CORE_ADDR *pc) if (symtab == 0) return false; - symtab = find_line_symtab (symtab, line, &ind, NULL); + symtab = find_line_symtab (symtab, line, &ind); if (symtab != NULL) { l = symtab->linetable (); diff --git a/gdb/symtab.h b/gdb/symtab.h index aa86a80..ef2ff5e 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -2510,7 +2510,16 @@ completion_skip_symbol (complete_symbol_mode mode, Symbol *sym) bool matching_obj_sections (struct obj_section *, struct obj_section *); -extern struct symtab *find_line_symtab (struct symtab *, int, int *, bool *); +/* Find line number LINE in any symtab whose name is the same as + SYMTAB. + + If found, return the symtab that contains the linetable in which it was + found, set *INDEX to the index in the linetable of the best entry + found. The returned index includes inexact matches. + + If not found, return NULL. */ + +extern symtab *find_line_symtab (symtab *sym_tab, int line, int *index); /* Given a function symbol SYM, find the symtab and line for the start of the function. If FUNFIRSTLINE is true, we want the first line |