Tue May 25 20:44:24 1993 Jim Kingdon (kingdon@lioth.cygnus.com)
+ * source.c (line_info): If we don't find a symtab, print more useful
+ output, including the symbolic address.
+
* source.c (line_info): If --fullname, display the source.
(identify_source_line), callers: Take pc as argument, rather than
assuming innermost frame (emacs doesn't use this, so no one ever
{
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
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)
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);
}