summaryrefslogtreecommitdiff
path: root/gdb/complaints.h
diff options
context:
space:
mode:
authorAndrew Cagney <cagney@redhat.com>2002-09-19 00:42:41 +0000
committerAndrew Cagney <cagney@redhat.com>2002-09-19 00:42:41 +0000
commitb9caf5053f5684f063a33357b6483cd2b62de0ec (patch)
tree139bdef42c509a2f7a6423a91b77883965200a0c /gdb/complaints.h
parentd2e6263c4a7536e5e07990c1bd270fa36d8e092a (diff)
downloadbinutils-gdb-b9caf5053f5684f063a33357b6483cd2b62de0ec.tar.gz
2002-09-18 Andrew Cagney <ac131313@redhat.com>
* complaints.h: Update copyright. (struct complaints): Declare. (struct complaint): Make `message' constant. (internal_complaint): Declare. (complaint): Declare. (complaint_root): Delete declaration. (symfile_complaints): Delete declaration. (struct complaints): Add opaque declaration. (clear_complaints): Add a complaints parameter. * complaints.c: Update copyright. (enum complaint_series): Define. (complaint_root): Delete. (struct complaints): Define. (complaint_sentinel, symfile_complaint_book): New variables. (symfile_explanations, symfile_complaints): New variables. New variables. (get_complaints): New function. (vcomplaint): New function. (complaint): New function. (internal_complaint): New function. (complain): Call vcomplain with symfile_complaint. (clear_complaints): Rewrite. (_initialize_complaints): Use add_setshow_command. * Makefile.in (complaints.o): Update dependencies. * symfile.c (syms_from_objfile): Add symfile_complaints parameter to call to clear_complaints. (new_symfile_objfile, reread_symbols): Ditto. (oldsyms_complaint): Delete. (empty_symtab_complaint, unknown_option_complaint): Delete. (free_named_symtabs): Use complaint instead of complain.
Diffstat (limited to 'gdb/complaints.h')
-rw-r--r--gdb/complaints.h56
1 files changed, 38 insertions, 18 deletions
diff --git a/gdb/complaints.h b/gdb/complaints.h
index ecd822f5b04..c176b190588 100644
--- a/gdb/complaints.h
+++ b/gdb/complaints.h
@@ -1,6 +1,7 @@
/* Definitions for complaint handling during symbol reading in GDB.
- Copyright 1990, 1991, 1992, 1995, 1998, 2000
- Free Software Foundation, Inc.
+
+ Copyright 1990, 1991, 1992, 1995, 1998, 2000, 2002 Free Software
+ Foundation, Inc.
This file is part of GDB.
@@ -23,8 +24,37 @@
#if !defined (COMPLAINTS_H)
#define COMPLAINTS_H
+/* Opaque object used to track the number of complaints of a
+ particular category. */
+struct complaints;
+
+/* Predefined categories. */
+extern struct complaints *symfile_complaints;
+
+/* Register a complaint. */
+extern void complaint (struct complaints **complaints, const char *fmt,
+ ...) ATTR_FORMAT (printf, 2, 3);
+extern void internal_complaint (struct complaints **complaints,
+ const char *file, int line, const char *fmt,
+ ...) ATTR_FORMAT (printf, 4, 5);
+
+/* Clear out / initialize all complaint counters that have ever been
+ incremented. If LESS_VERBOSE is 1, be less verbose about
+ successive complaints, since the messages are appearing all
+ together during a command that is reporting a contiguous block of
+ complaints (rather than being interleaved with other messages). If
+ noisy is 1, we are in a noisy command, and our caller will print
+ enough context for the user to figure it out. */
+
+extern void clear_complaints (struct complaints **complaints,
+ int less_verbose, int noisy);
+
-/* Support for complaining about things in the symbol file that aren't
+/* Legacy interfaces to keep the old code working (until it is all
+ converted to the above). While the structure below contains a
+ number of fields, all but .message are ignored.
+
+ Support for complaining about things in the symbol file that aren't
catastrophic.
Each such thing gets a counter. The first time we have the problem,
@@ -32,22 +62,12 @@
if verbose, we report how many of each problem we had. */
struct complaint
- {
- char *message;
- unsigned counter;
- struct complaint *next;
- };
-
-/* Root of the chain of complaints that have at some point been issued.
- This is used to reset the counters, and/or report the total counts. */
-
-extern struct complaint complaint_root[1];
-
-/* Functions that handle complaints. (in complaints.c) */
+{
+ const char *message;
+ unsigned counter_ignored;
+ struct complaint *next_ignored;
+};
extern void complain (struct complaint *, ...);
-extern void clear_complaints (int, int);
-
-
#endif /* !defined (COMPLAINTS_H) */