Make current_source_* per-program-space
authorTom Tromey <tromey@adacore.com>
Thu, 1 Aug 2019 15:34:40 +0000 (09:34 -0600)
committerTom Tromey <tromey@adacore.com>
Wed, 2 Oct 2019 15:53:17 +0000 (09:53 -0600)
commit1dd588507782591478882a891f64945af9e2b86c
treeecd664c126fdab1a950c0bba67e35c3e2e5bccad
parent5c281dbb2458be9d58355e865f527e96b40bcd8c
Make current_source_* per-program-space

This changes current_source_symtab and current_source_line to be
per-program-space.  This ensures that switching inferiors will
preserve the current "list" location for that inferior, and also
ensures that the default expression evaluation context always comes
with the current inferior.

No test case, because the latter problem crops up with an existing
gdb.multi test case once this entire series has been applied.

gdb/ChangeLog
2019-10-02  Tom Tromey  <tromey@adacore.com>

* source.c (struct current_source_location): New.
(current_source_key): New global.
(current_source_symtab, current_source_line)
(current_source_pspace): Remove.
(get_source_location): New function.
(get_current_source_symtab_and_line)
(set_default_source_symtab_and_line)
(set_current_source_symtab_and_line)
(clear_current_source_symtab_and_line, select_source_symtab)
(info_source_command, print_source_lines_base)
(info_line_command, search_command_helper, _initialize_source):
Update.
gdb/ChangeLog
gdb/source.c