diff options
author | Fernando Nasser <fnasser@redhat.com> | 2002-09-22 22:18:41 +0000 |
---|---|---|
committer | Fernando Nasser <fnasser@redhat.com> | 2002-09-22 22:18:41 +0000 |
commit | 53cb0458d6870af83b2bc9fab8738a29b64f702e (patch) | |
tree | b264bc0d29862d82e707c49717eafad38055c402 /gdb/linespec.c | |
parent | c214a6fd4d4e7d6d8bfd1dc355442070a63ca61a (diff) | |
download | gdb-53cb0458d6870af83b2bc9fab8738a29b64f702e.zip gdb-53cb0458d6870af83b2bc9fab8738a29b64f702e.tar.gz gdb-53cb0458d6870af83b2bc9fab8738a29b64f702e.tar.bz2 |
* 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.
Diffstat (limited to 'gdb/linespec.c')
-rw-r--r-- | gdb/linespec.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/linespec.c b/gdb/linespec.c index d1bb4e3..5631fd3 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1027,13 +1027,16 @@ decode_line_1 (char **argptr, int funfirstline, struct symtab *default_symtab, /* This is where we need to make sure that we have good defaults. We must guarantee that this section of code is never executed when we are called with just a function name, since - get_current_or_default_source_symtab_and_line uses + set_default_source_symtab_and_line uses select_source_symtab that calls us with such an argument */ if (s == 0 && default_symtab == 0) { - struct symtab_and_line cursal = - get_current_or_default_source_symtab_and_line (); + struct symtab_and_line cursal; + + /* Make sure we have at least a default source file. */ + set_default_source_symtab_and_line (); + cursal = get_current_source_symtab_and_line (); default_symtab = cursal.symtab; default_line = cursal.line; |