aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorJim Kingdon <jkingdon@engr.sgi.com>1993-05-26 04:29:38 +0000
committerJim Kingdon <jkingdon@engr.sgi.com>1993-05-26 04:29:38 +0000
commit2f2a70e585b2c8671b33d61fafd6f038c5bce76c (patch)
tree53c860acd3a55abde7faf22a251be573384585d9 /gdb/source.c
parentb9298844e505d8bad226fa7be2a625263eaa7da6 (diff)
downloadgdb-2f2a70e585b2c8671b33d61fafd6f038c5bce76c.zip
gdb-2f2a70e585b2c8671b33d61fafd6f038c5bce76c.tar.gz
gdb-2f2a70e585b2c8671b33d61fafd6f038c5bce76c.tar.bz2
* source.c (line_info): If we don't find a symtab, print more useful
output, including the symbolic address.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/gdb/source.c b/gdb/source.c
index 682f1e8..3ea5518 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -1083,10 +1083,7 @@ line_info (arg, from_tty)
{
sals = decode_line_spec_1 (arg, 0);
- /* If this command is repeated with RET,
- turn it into the no-arg variant. */
- if (from_tty)
- *arg = 0;
+ dont_repeat ();
}
/* C++ More than one line may have been specified, as when the user
@@ -1096,9 +1093,22 @@ line_info (arg, from_tty)
sal = sals.sals[i];
if (sal.symtab == 0)
- error ("No source file specified.");
-
- if (sal.line > 0
+ {
+ printf_filtered ("No line number information available");
+ if (sal.pc != 0)
+ {
+ /* This is useful for "info line *0x7f34". If we can't tell the
+ user about a source line, at least let them have the symbolic
+ address. */
+ printf_filtered (" for address ");
+ wrap_here (" ");
+ print_address (sal.pc, stdout);
+ }
+ else
+ printf_filtered (".");
+ printf_filtered ("\n");
+ }
+ else if (sal.line > 0
&& find_line_pc_range (sal.symtab, sal.line, &start_pc, &end_pc))
{
if (start_pc == end_pc)
@@ -1123,6 +1133,9 @@ line_info (arg, from_tty)
identify_source_line (sal.symtab, sal.line, 0, start_pc);
}
else
+ /* Is there any case in which we get here, and have an address
+ which the user would want to see? If we have debugging symbols
+ and no line numbers? */
printf_filtered ("Line number %d is out of range for \"%s\".\n",
sal.line, sal.symtab->filename);
}