Remove file and line from struct complain
The file and line handling in complaints.c wasn't used once internal_complaint was removed. This patch removes all the related code. gdb/ChangeLog 2018-05-23 Tom Tromey <tom@tromey.com> * complaints.c (struct complain) <file, line>: Remove. (find_complaint): Remove file, line parameters. (complaint_internal): Update.
This commit is contained in:
parent
de54e1a5d2
commit
7ff8817441
|
@ -1,3 +1,9 @@
|
||||||
|
2018-05-23 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
|
* complaints.c (struct complain) <file, line>: Remove.
|
||||||
|
(find_complaint): Remove file, line parameters.
|
||||||
|
(complaint_internal): Update.
|
||||||
|
|
||||||
2018-05-23 Tom Tromey <tom@tromey.com>
|
2018-05-23 Tom Tromey <tom@tromey.com>
|
||||||
|
|
||||||
* complaints.c (vcomplaint): Remove.
|
* complaints.c (vcomplaint): Remove.
|
||||||
|
|
|
@ -38,8 +38,6 @@ enum complaint_series {
|
||||||
|
|
||||||
struct complain
|
struct complain
|
||||||
{
|
{
|
||||||
const char *file;
|
|
||||||
int line;
|
|
||||||
const char *fmt;
|
const char *fmt;
|
||||||
int counter;
|
int counter;
|
||||||
struct complain *next;
|
struct complain *next;
|
||||||
|
@ -59,9 +57,8 @@ static struct complaints symfile_complaint_book = {
|
||||||
ISOLATED_MESSAGE
|
ISOLATED_MESSAGE
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct complain * ATTRIBUTE_PRINTF (4, 0)
|
static struct complain * ATTRIBUTE_PRINTF (2, 0)
|
||||||
find_complaint (struct complaints *complaints, const char *file,
|
find_complaint (struct complaints *complaints, const char *fmt)
|
||||||
int line, const char *fmt)
|
|
||||||
{
|
{
|
||||||
struct complain *complaint;
|
struct complain *complaint;
|
||||||
|
|
||||||
|
@ -73,17 +70,13 @@ find_complaint (struct complaints *complaints, const char *file,
|
||||||
complaint != NULL;
|
complaint != NULL;
|
||||||
complaint = complaint->next)
|
complaint = complaint->next)
|
||||||
{
|
{
|
||||||
if (complaint->fmt == fmt
|
if (complaint->fmt == fmt)
|
||||||
&& complaint->file == file
|
|
||||||
&& complaint->line == line)
|
|
||||||
return complaint;
|
return complaint;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Oops not seen before, fill in a new complaint. */
|
/* Oops not seen before, fill in a new complaint. */
|
||||||
complaint = XNEW (struct complain);
|
complaint = XNEW (struct complain);
|
||||||
complaint->fmt = fmt;
|
complaint->fmt = fmt;
|
||||||
complaint->file = file;
|
|
||||||
complaint->line = line;
|
|
||||||
complaint->counter = 0;
|
complaint->counter = 0;
|
||||||
complaint->next = NULL;
|
complaint->next = NULL;
|
||||||
|
|
||||||
|
@ -107,8 +100,7 @@ complaint_internal (const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list args;
|
va_list args;
|
||||||
|
|
||||||
struct complain *complaint = find_complaint (&symfile_complaint_book, NULL,
|
struct complain *complaint = find_complaint (&symfile_complaint_book, fmt);
|
||||||
0, fmt);
|
|
||||||
enum complaint_series series;
|
enum complaint_series series;
|
||||||
|
|
||||||
complaint->counter++;
|
complaint->counter++;
|
||||||
|
@ -125,9 +117,7 @@ complaint_internal (const char *fmt, ...)
|
||||||
string somewhere up the call chain. */
|
string somewhere up the call chain. */
|
||||||
gdb_assert (complaint->fmt == fmt);
|
gdb_assert (complaint->fmt == fmt);
|
||||||
|
|
||||||
if (complaint->file != NULL)
|
if (deprecated_warning_hook)
|
||||||
internal_vwarning (complaint->file, complaint->line, fmt, args);
|
|
||||||
else if (deprecated_warning_hook)
|
|
||||||
(*deprecated_warning_hook) (fmt, args);
|
(*deprecated_warning_hook) (fmt, args);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue