From 3773146f2d9e1eb3edb5ea359d4b9473f702980c Mon Sep 17 00:00:00 2001 From: Fernando Nasser Date: Sun, 22 Sep 2002 22:18:41 +0000 Subject: * source.c (get_current_or_default_source_symtab_and_line): Remove function. (set_default_source_symtab_and_line): New function. Attempts to determine a source file to list lines from if one is not currently defined. (get_current_source_symtab_and_line): Initialize sal.pc and sal.end fields. (set_current_source_symtab_and_line): Mark argument as const. * source.h: Update declarations and comments. * linespec.c (decode_line_1): Replace call to removed routine above. * stack.c (print_frame_info_base): Ditto. * cli/cli-cmds.c (edit_command): Ditto. (list_command): Ditto. --- gdb/stack.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gdb/stack.c') diff --git a/gdb/stack.c b/gdb/stack.c index 4f41531189a..83fd26e476b 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -434,7 +434,9 @@ print_frame_info_base (struct frame_info *fi, int level, int source, int args) print_source_lines (sal.symtab, sal.line, sal.line + 1, 0); } } - cursal = get_current_or_default_source_symtab_and_line (); + /* Make sure we have at least a default source file */ + set_default_source_symtab_and_line (); + cursal = get_current_source_symtab_and_line (); cursal.line = max (sal.line - get_lines_to_list () / 2, 1); set_current_source_symtab_and_line (&cursal); } -- cgit v1.2.1