* Makefile.in (DEPMODE, DEPDIR, depcomp, COMPILE.pre)
[deliverable/binutils-gdb.git] / gdb / source.c
index c05822e46879cdc205cb686aa9434db1405a5f86..7e14fc6ebcfbec7cde047a80c3274477a9fe59dc 100644 (file)
@@ -1245,10 +1245,9 @@ identify_source_line (struct symtab *s, int line, int mid_statement,
 /* 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 (struct symtab *s, int line, int stopline,
-                                    int noerror);
 static void
-print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
+print_source_lines_base (struct symtab *s, int line, int stopline,
+                        enum print_source_lines_flags flags)
 {
   int c;
   int desc;
@@ -1276,13 +1275,13 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
       else
        {
          desc = last_source_error;
-         noerror = 1;
+         flags |= PRINT_SOURCE_LINES_NOERROR;
        }
     }
   else
     {
       desc = last_source_error;
-      noerror = 1;
+         flags |= PRINT_SOURCE_LINES_NOERROR;
       noprint = 1;
     }
 
@@ -1290,7 +1289,7 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
     {
       last_source_error = desc;
 
-      if (!noerror)
+      if (!(flags & PRINT_SOURCE_LINES_NOERROR))
        {
          int len = strlen (s->filename) + 100;
          char *name = alloca (len);
@@ -1346,6 +1345,11 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
       if (c == EOF)
        break;
       last_line_listed = current_source_line;
+      if (flags & PRINT_SOURCE_LINES_FILENAME)
+        {
+          ui_out_text (uiout, s->filename);
+          ui_out_text (uiout, ":");
+        }
       xsnprintf (buf, sizeof (buf), "%d\t", current_source_line++);
       ui_out_text (uiout, buf);
       do
@@ -1385,9 +1389,10 @@ print_source_lines_base (struct symtab *s, int line, int stopline, int noerror)
    window otherwise it is simply printed.  */
 
 void
-print_source_lines (struct symtab *s, int line, int stopline, int noerror)
+print_source_lines (struct symtab *s, int line, int stopline,
+                   enum print_source_lines_flags flags)
 {
-  print_source_lines_base (s, line, stopline, noerror);
+  print_source_lines_base (s, line, stopline, flags);
 }
 \f
 /* Print info on range of pc's in a specified line.  */
This page took 0.024443 seconds and 4 git commands to generate.