aboutsummaryrefslogtreecommitdiff
path: root/gdb/stack.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/stack.c')
-rw-r--r--gdb/stack.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/gdb/stack.c b/gdb/stack.c
index 9c15b9f..8a066b2 100644
--- a/gdb/stack.c
+++ b/gdb/stack.c
@@ -723,11 +723,9 @@ print_frame_args (struct symbol *func, struct frame_info *frame,
void
set_current_sal_from_frame (struct frame_info *frame)
{
- struct symtab_and_line sal;
-
- find_frame_sal (frame, &sal);
+ symtab_and_line sal = find_frame_sal (frame);
if (sal.symtab != NULL)
- set_current_source_symtab_and_line (&sal);
+ set_current_source_symtab_and_line (sal);
}
/* If ON, GDB will display disassembly of the next source line when
@@ -789,7 +787,6 @@ print_frame_info (struct frame_info *frame, int print_level,
int set_current_sal)
{
struct gdbarch *gdbarch = get_frame_arch (frame);
- struct symtab_and_line sal;
int source_print;
int location_print;
struct ui_out *uiout = current_uiout;
@@ -852,7 +849,7 @@ print_frame_info (struct frame_info *frame, int print_level,
the next frame is a SIGTRAMP_FRAME or a DUMMY_FRAME, then the
next frame was not entered as the result of a call, and we want
to get the line containing FRAME->pc. */
- find_frame_sal (frame, &sal);
+ symtab_and_line sal = find_frame_sal (frame);
location_print = (print_what == LOCATION
|| print_what == LOC_AND_ADDRESS
@@ -1017,23 +1014,20 @@ get_last_displayed_line (void)
/* Get the last sal we displayed, if it's valid. */
-void
-get_last_displayed_sal (struct symtab_and_line *sal)
+symtab_and_line
+get_last_displayed_sal ()
{
+ symtab_and_line sal;
+
if (last_displayed_sal_valid)
{
- sal->pspace = last_displayed_pspace;
- sal->pc = last_displayed_addr;
- sal->symtab = last_displayed_symtab;
- sal->line = last_displayed_line;
- }
- else
- {
- sal->pspace = 0;
- sal->pc = 0;
- sal->symtab = 0;
- sal->line = 0;
+ sal.pspace = last_displayed_pspace;
+ sal.pc = last_displayed_addr;
+ sal.symtab = last_displayed_symtab;
+ sal.line = last_displayed_line;
}
+
+ return sal;
}
@@ -1399,7 +1393,6 @@ static void
info_frame_command (char *addr_exp, int from_tty)
{
struct frame_info *fi;
- struct symtab_and_line sal;
struct symbol *func;
struct symtab *s;
struct frame_info *calling_frame_info;
@@ -1434,8 +1427,8 @@ info_frame_command (char *addr_exp, int from_tty)
pc_regname = "pc";
frame_pc_p = get_frame_pc_if_available (fi, &frame_pc);
- find_frame_sal (fi, &sal);
func = get_frame_function (fi);
+ symtab_and_line sal = find_frame_sal (fi);
s = sal.symtab;
if (func)
{