aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
committerStan Shebs <shebs@codesourcery.com>1999-04-26 18:34:20 +0000
commit7a292a7adf506b866905b06b3024c0fd411c4583 (patch)
tree5b208bb48269b8a82d5c3a5f19c87b45a62a22f4 /gdb/source.c
parent1996fae84682e8ddd146215dd2959ad1ec924c09 (diff)
downloadfsf-binutils-gdb-7a292a7adf506b866905b06b3024c0fd411c4583.zip
fsf-binutils-gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.gz
fsf-binutils-gdb-7a292a7adf506b866905b06b3024c0fd411c4583.tar.bz2
import gdb-19990422 snapshot
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c32
1 files changed, 18 insertions, 14 deletions
diff --git a/gdb/source.c b/gdb/source.c
index 9fe9742..8b330de 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -976,10 +976,12 @@ identify_source_line (s, line, mid_statement, pc)
/* Print source lines from the file of symtab S,
starting with line number LINE and stopping before line number STOPLINE. */
+static void print_source_lines_base PARAMS ((struct symtab *s, int line, int stopline, int noerror));
static void
print_source_lines_base (s, line, stopline, noerror)
struct symtab *s;
- int line, stopline;
+ int line;
+ int stopline;
int noerror;
{
register int c;
@@ -1284,19 +1286,21 @@ list_command (arg, from_tty)
else if (sal.symtab == 0)
error ("No default source file yet. Do \"help list\".");
else if (no_end)
- if (lines_to_list % 2 == 0)
- print_source_lines (sal.symtab,
- max (sal.line - (lines_to_list / 2), 1),
- sal.line + (lines_to_list / 2), 0);
- else
- /* If lines_to_list is odd, then we round down in
- * one of the lines_to_list/2 computations, round up in
- * the other, so the total window size around the specified
- * line comes out right.
- */
- print_source_lines (sal.symtab,
- max (sal.line - (lines_to_list / 2), 1),
- sal.line + ((1+lines_to_list) / 2), 0);
+ {
+ if (lines_to_list % 2 == 0)
+ print_source_lines (sal.symtab,
+ max (sal.line - (lines_to_list / 2), 1),
+ sal.line + (lines_to_list / 2), 0);
+ else
+ /* If lines_to_list is odd, then we round down in
+ * one of the lines_to_list/2 computations, round up in
+ * the other, so the total window size around the specified
+ * line comes out right.
+ */
+ print_source_lines (sal.symtab,
+ max (sal.line - (lines_to_list / 2), 1),
+ sal.line + ((1+lines_to_list) / 2), 0);
+ }
else
print_source_lines (sal.symtab, sal.line,
(dummy_end