aboutsummaryrefslogtreecommitdiff
path: root/gdb/complaints.c
diff options
context:
space:
mode:
authorFernando Nasser <fnasser@redhat.com>2000-12-20 17:32:17 +0000
committerFernando Nasser <fnasser@redhat.com>2000-12-20 17:32:17 +0000
commit22d15040101460bca4e30241d84de6f2170d708a (patch)
treee6e73599c2da51e8316fc24ce7e70f4fef30ff1c /gdb/complaints.c
parent49c890fc5ec37cf0512bdbf31b5963dc29e142f7 (diff)
downloadgdb-22d15040101460bca4e30241d84de6f2170d708a.zip
gdb-22d15040101460bca4e30241d84de6f2170d708a.tar.gz
gdb-22d15040101460bca4e30241d84de6f2170d708a.tar.bz2
2000-12-20 Fernando Nasser <fnasser@redhat.com>
* complaints.c (complain): Call warning_hook if defined, instead of writting to gdb_stderr. (clear_complaints): Do not write anything to gdb_stderr if warning_hook is defined.
Diffstat (limited to 'gdb/complaints.c')
-rw-r--r--gdb/complaints.c45
1 files changed, 30 insertions, 15 deletions
diff --git a/gdb/complaints.c b/gdb/complaints.c
index 6c9d728..198e64f 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -83,30 +83,45 @@ complain (struct complaint *complaint,...)
/* Isolated messages, must be self-explanatory. */
case 0:
- begin_line ();
- fputs_filtered ("During symbol reading, ", gdb_stderr);
- wrap_here ("");
- vfprintf_filtered (gdb_stderr, complaint->message, args);
- fputs_filtered (".\n", gdb_stderr);
+ if (warning_hook)
+ (*warning_hook) (complaint->message, args);
+ else
+ {
+ begin_line ();
+ fputs_filtered ("During symbol reading, ", gdb_stderr);
+ wrap_here ("");
+ vfprintf_filtered (gdb_stderr, complaint->message, args);
+ fputs_filtered (".\n", gdb_stderr);
+ }
break;
/* First of a series, without `set verbose'. */
case 1:
- begin_line ();
- fputs_filtered ("During symbol reading...", gdb_stderr);
- vfprintf_filtered (gdb_stderr, complaint->message, args);
- fputs_filtered ("...", gdb_stderr);
- wrap_here ("");
- complaint_series++;
+ if (warning_hook)
+ (*warning_hook) (complaint->message, args);
+ else
+ {
+ begin_line ();
+ fputs_filtered ("During symbol reading...", gdb_stderr);
+ vfprintf_filtered (gdb_stderr, complaint->message, args);
+ fputs_filtered ("...", gdb_stderr);
+ wrap_here ("");
+ complaint_series++;
+ }
break;
/* Subsequent messages of a series, or messages under `set verbose'.
(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 (warning_hook)
+ (*warning_hook) (complaint->message, args);
+ else
+ {
+ 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
@@ -133,7 +148,7 @@ clear_complaints (int sym_reading, int noisy)
p->counter = 0;
}
- if (!sym_reading && !noisy && complaint_series > 1)
+ if (!sym_reading && !noisy && complaint_series > 1 && !warning_hook)
{
/* Terminate previous series, since caller won't. */
puts_filtered ("\n");