summaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@apple.com>1999-04-26 18:34:20 +0000
committerStan Shebs <shebs@apple.com>1999-04-26 18:34:20 +0000
commitfe454715791b86ad488b33c1f325478803c8108c (patch)
tree91ec960676c78ffeab24ee2101fa128d2cc0f958 /gdb/source.c
parentf3db0d6e5952e6aa06bdad615829b42d2cf52f71 (diff)
downloadgdb-fe454715791b86ad488b33c1f325478803c8108c.tar.gz
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 9fe97425aa4..8b330dee131 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