This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

complaints.c


Hi, all...

Does anyone see a reason why the output from "complain" goes to stdout
rather than stderr?  complain is where gdb whinges about things like live
range symbols not found, etc...  If it comes to stdout it often gets
mixed into legitimate output that gdbtk is trying to parse, like stack 
backtraces.

I suggest the following patch:

RCS file: /cvs/cvsfiles/devo/gdb/complaints.c,v
retrieving revision 2.11
diff -p -r2.11 complaints.c
*** complaints.c	1999/08/08 01:25:46	2.11
--- complaints.c	1999/09/21 20:00:54
*************** complain (struct complaint *complaint,..
*** 84,90 ****
        /* Isolated messages, must be self-explanatory.  */
      case 0:
        begin_line ();
!       puts_filtered ("During symbol reading, ");
        wrap_here ("");
        vprintf_filtered (complaint->message, args);
        puts_filtered (".\n");
--- 84,90 ----
        /* Isolated messages, must be self-explanatory.  */
      case 0:
        begin_line ();
!       fputs_filtered ("During symbol reading, ", gdb_stderr);
        wrap_here ("");
        vprintf_filtered (complaint->message, args);
        puts_filtered (".\n");
*************** complain (struct complaint *complaint,..
*** 93,101 ****
        /* First of a series, without `set verbose'.  */
      case 1:
        begin_line ();
!       puts_filtered ("During symbol reading...");
        vprintf_filtered (complaint->message, args);
!       puts_filtered ("...");
        wrap_here ("");
        complaint_series++;
        break;
--- 93,101 ----
        /* First of a series, without `set verbose'.  */
      case 1:
        begin_line ();
!       fputs_filtered ("During symbol reading...", gdb_stderr);
        vprintf_filtered (complaint->message, args);
!       fputs_filtered ("...", gdb_stderr);
        wrap_here ("");
        complaint_series++;
        break;
*************** complain (struct complaint *complaint,..
*** 104,117 ****
           (We'll already have produced a "Reading in symbols for XXX..."
           message and will clean up at the end with a newline.)  */
      default:
!       vprintf_filtered (complaint->message, args);
!       puts_filtered ("...");
        wrap_here ("");
      }
    /* If GDB dumps core, we'd like to see the complaints first.  Presumably
       GDB will not be sending so many complaints that this becomes a
       performance hog.  */
!   gdb_flush (gdb_stdout);
    va_end (args);
  }
  
--- 104,117 ----
           (We'll already have produced a "Reading in symbols for XXX..."
           message and will clean up at the end with a newline.)  */
      default:
!       vfprintf_filtered (gdb_stderr, complaint->message, args);
!       fputs_filtered ("...", gdb_stderr);
        wrap_here ("");
      }
    /* If GDB dumps core, we'd like to see the complaints first.  Presumably
       GDB will not be sending so many complaints that this becomes a
       performance hog.  */
!   gdb_flush (gdb_stderr);
    va_end (args);
  }

Jim

-- 
++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++==++
Jim Ingham                                              jingham@cygnus.com
Cygnus Solutions Inc.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]