aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-05-16 16:50:22 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-07-15 14:34:12 -0400
commit3bae94c0fb82d5eb9c36c926534fced6db198d82 (patch)
treea0e9eb77343407a84b9f4d1d8c8694b6ef55ba88 /gdb/cli
parent9c067e28448f0314d1b0440945e16382a226fd7b (diff)
downloadgdb-3bae94c0fb82d5eb9c36c926534fced6db198d82.zip
gdb-3bae94c0fb82d5eb9c36c926534fced6db198d82.tar.gz
gdb-3bae94c0fb82d5eb9c36c926534fced6db198d82.tar.bz2
gdb: pass program space to get_current_source_symtab_and_line
Make the current program space reference bubble up one level. Change-Id: I6ba6dc4a2cb188720cbb61b84ab5c954aac105c6 Approved-By: Tom Tromey <tom@tromey.com> Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 9d3a90b..92bb8fc 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -984,7 +984,7 @@ edit_command (const char *arg, int from_tty)
if (arg == 0)
{
set_default_source_symtab_and_line ();
- sal = get_current_source_symtab_and_line ();
+ sal = get_current_source_symtab_and_line (current_program_space);
}
/* Bare "edit" edits file with present line. */
@@ -1240,7 +1240,8 @@ list_command (const char *arg, int from_tty)
if (get_first_line_listed () == 0 && (arg == nullptr || arg[0] != '.'))
{
set_default_source_symtab_and_line ();
- list_around_line (arg, get_current_source_symtab_and_line ());
+ list_around_line
+ (arg, get_current_source_symtab_and_line (current_program_space));
}
/* "l" and "l +" lists the next few lines, unless we're listing past
@@ -1248,7 +1249,8 @@ list_command (const char *arg, int from_tty)
else if (arg == nullptr || arg[0] == '+')
{
set_default_source_symtab_and_line ();
- const symtab_and_line cursal = get_current_source_symtab_and_line ();
+ const symtab_and_line cursal
+ = get_current_source_symtab_and_line (current_program_space);
if (last_symtab_line (cursal.symtab) >= cursal.line)
print_source_lines (cursal.symtab,
source_lines_range (cursal.line), 0);
@@ -1262,7 +1264,8 @@ list_command (const char *arg, int from_tty)
else if (arg[0] == '-')
{
set_default_source_symtab_and_line ();
- const symtab_and_line cursal = get_current_source_symtab_and_line ();
+ const symtab_and_line cursal
+ = get_current_source_symtab_and_line (current_program_space);
if (get_first_line_listed () == 1)
error (_("Already at the start of %s."),
@@ -1305,7 +1308,8 @@ list_command (const char *arg, int from_tty)
error (_("Insufficient debug info for showing source "
"lines at default location"));
}
- cursal = get_current_source_symtab_and_line ();
+ cursal
+ = get_current_source_symtab_and_line (current_program_space);
gdb_assert (cursal.symtab != nullptr);
}