diff options
author | Tom Tromey <tom@tromey.com> | 2022-03-20 19:52:13 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-05-07 13:03:39 -0600 |
commit | 62c5d5ec88c5748491e27e1fbd3953f4c872752d (patch) | |
tree | 89069aa473c91edde3f61797a6ce765f2df42140 /gdb/source.c | |
parent | 7a8de0c33019efd3ea5755044a29544ba7637759 (diff) | |
download | binutils-gdb-62c5d5ec88c5748491e27e1fbd3953f4c872752d.tar.gz |
Remove parameter from select_source_symtab
I noticed that select_source_symtab is only ever called with nullptr
as an argument, so this patch removes the parameter and associated
logic.
Reviewed-By: Bruno Larsen <blarsen@redhat.com>
Diffstat (limited to 'gdb/source.c')
-rw-r--r-- | gdb/source.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/gdb/source.c b/gdb/source.c index 4d297c82ea9..98d02d45448 100644 --- a/gdb/source.c +++ b/gdb/source.c @@ -266,7 +266,7 @@ set_default_source_symtab_and_line (void) /* Pull in a current source symtab if necessary. */ current_source_location *loc = get_source_location (current_program_space); if (loc->symtab () == nullptr) - select_source_symtab (0); + select_source_symtab (); } /* Return the current default file for listing and next line to list @@ -307,16 +307,8 @@ clear_current_source_symtab_and_line (void) /* See source.h. */ void -select_source_symtab (struct symtab *s) +select_source_symtab () { - if (s) - { - current_source_location *loc - = get_source_location (s->compunit ()->objfile ()->pspace); - loc->set (s, 1); - return; - } - current_source_location *loc = get_source_location (current_program_space); if (loc->symtab () != nullptr) return; @@ -363,7 +355,7 @@ select_source_symtab (struct symtab *s) for (objfile *objfile : current_program_space->objfiles ()) { - s = objfile->find_last_source_symtab (); + symtab *s = objfile->find_last_source_symtab (); if (s) new_symtab = s; } @@ -1617,7 +1609,7 @@ search_command_helper (const char *regex, int from_tty, bool forward) current_source_location *loc = get_source_location (current_program_space); if (loc->symtab () == nullptr) - select_source_symtab (0); + select_source_symtab (); if (!source_open) error (_("source code access disabled")); |