aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
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/source.c
parent9c067e28448f0314d1b0440945e16382a226fd7b (diff)
downloadbinutils-3bae94c0fb82d5eb9c36c926534fced6db198d82.zip
binutils-3bae94c0fb82d5eb9c36c926534fced6db198d82.tar.gz
binutils-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/source.c')
-rw-r--r--gdb/source.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/source.c b/gdb/source.c
index bdbe67d..25d6e71 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -231,16 +231,15 @@ get_source_location (program_space *pspace)
return loc;
}
-/* Return the current source file for listing and next line to list.
- NOTE: The returned sal pc and end fields are not valid. */
+/* See source.h. */
-struct symtab_and_line
-get_current_source_symtab_and_line (void)
+symtab_and_line
+get_current_source_symtab_and_line (program_space *pspace)
{
symtab_and_line cursal;
- current_source_location *loc = get_source_location (current_program_space);
+ current_source_location *loc = get_source_location (pspace);
- cursal.pspace = current_program_space;
+ cursal.pspace = pspace;
cursal.symtab = loc->symtab ();
cursal.line = loc->line ();
cursal.pc = 0;