aboutsummaryrefslogtreecommitdiff
path: root/gdb/complaints.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-05-16 23:05:54 -0600
committerTom Tromey <tom@tromey.com>2018-05-23 09:17:01 -0600
commit2ac237e52beb08e09037ff917924319246b5ea6d (patch)
treefcadfdbb93eea45fa9bbb135a414447b2dd23287 /gdb/complaints.c
parentb98664d3862579c5a0d23901b1e2fc1f595f39ff (diff)
downloadgdb-2ac237e52beb08e09037ff917924319246b5ea6d.zip
gdb-2ac237e52beb08e09037ff917924319246b5ea6d.tar.gz
gdb-2ac237e52beb08e09037ff917924319246b5ea6d.tar.bz2
Remove struct explanation
Now that there's only a single reason for a complaint to be emitted, this removes "struct explanation" and changes vcomplaint to emit the desired messages directly. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (struct complaints) <explanation>: Remove. (symfile_explanations): Remove. (symfile_complaint_book): Update. (vcomplaint): Update. (struct explanation): Remove.
Diffstat (limited to 'gdb/complaints.c')
-rw-r--r--gdb/complaints.c56
1 files changed, 8 insertions, 48 deletions
diff --git a/gdb/complaints.c b/gdb/complaints.c
index 4ee35a6..80b9595 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -45,43 +45,18 @@ struct complain
struct complain *next;
};
-/* The explanatory message that should accompany the complaint. The
- message is in two parts - pre and post - that are printed around
- the complaint text. */
-struct explanation
-{
- const char *prefix;
- const char *postfix;
-};
-
struct complaints
{
struct complain *root;
enum complaint_series series;
-
- /* The explanatory messages that should accompany the complaint.
- NOTE: cagney/2002-08-14: In a desperate attempt at being vaguely
- i18n friendly, this is an array of two messages. When present,
- the PRE and POST EXPLANATION[SERIES] are used to wrap the
- message. */
- const struct explanation *explanation;
};
static struct complain complaint_sentinel;
-/* The symbol table complaint table. */
-
-static struct explanation symfile_explanations[] = {
- { "During symbol reading, ", "." },
- { "", "..."},
- { NULL, NULL }
-};
-
static struct complaints symfile_complaint_book = {
&complaint_sentinel,
- ISOLATED_MESSAGE,
- symfile_explanations
+ ISOLATED_MESSAGE
};
static struct complain * ATTRIBUTE_PRINTF (4, 0)
@@ -156,29 +131,14 @@ vcomplaint (const char *file,
(*deprecated_warning_hook) (fmt, args);
else
{
- if (symfile_complaint_book.explanation == NULL)
- /* A [v]warning() call always appends a newline. */
- vwarning (fmt, args);
+ std::string msg = string_vprintf (fmt, args);
+ wrap_here ("");
+ begin_line ();
+ if (series == ISOLATED_MESSAGE)
+ fprintf_filtered (gdb_stderr, "During symbol reading, %s.\n",
+ msg.c_str ());
else
- {
- std::string msg = string_vprintf (fmt, args);
- wrap_here ("");
- begin_line ();
- /* XXX: i18n */
- fprintf_filtered (gdb_stderr, "%s%s%s",
- symfile_complaint_book.explanation[series].prefix,
- msg.c_str (),
- symfile_complaint_book.explanation[series].postfix);
- /* Force a line-break after any isolated message. */
- if (series == ISOLATED_MESSAGE)
- /* It would be really nice to use begin_line() here.
- Unfortunately that function doesn't track GDB_STDERR and
- consequently will sometimes supress a line when it
- shouldn't. */
- fputs_filtered ("\n", gdb_stderr);
- else
- wrap_here ("");
- }
+ fprintf_filtered (gdb_stderr, "%s...", msg.c_str ());
}
/* If GDB dumps core, we'd like to see the complaints first.