This is the mail archive of the gdb-cvs@sourceware.org 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]
Other format: [Raw text]

[binutils-gdb] Remove file and line from struct complain


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=7ff8817441fcebe3d32343dbd9d514366bfe8e23

commit 7ff8817441fcebe3d32343dbd9d514366bfe8e23
Author: Tom Tromey <tom@tromey.com>
Date:   Wed May 16 23:14:03 2018 -0600

    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.

Diff:
---
 gdb/ChangeLog    |  6 ++++++
 gdb/complaints.c | 20 +++++---------------
 2 files changed, 11 insertions(+), 15 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 08b5f23..cd30155 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
 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>
+
 	* complaints.c (vcomplaint): Remove.
 	(complaint_internal) Merge in contents of vcomplaint.
 
diff --git a/gdb/complaints.c b/gdb/complaints.c
index 4b75325..851d8f5 100644
--- a/gdb/complaints.c
+++ b/gdb/complaints.c
@@ -38,8 +38,6 @@ enum complaint_series {
 
 struct complain
 {
-  const char *file;
-  int line;
   const char *fmt;
   int counter;
   struct complain *next;
@@ -59,9 +57,8 @@ static struct complaints symfile_complaint_book = {
   ISOLATED_MESSAGE
 };
 
-static struct complain * ATTRIBUTE_PRINTF (4, 0)
-find_complaint (struct complaints *complaints, const char *file,
-		int line, const char *fmt)
+static struct complain * ATTRIBUTE_PRINTF (2, 0)
+find_complaint (struct complaints *complaints, const char *fmt)
 {
   struct complain *complaint;
 
@@ -73,17 +70,13 @@ find_complaint (struct complaints *complaints, const char *file,
        complaint != NULL;
        complaint = complaint->next)
     {
-      if (complaint->fmt == fmt
-	  && complaint->file == file
-	  && complaint->line == line)
+      if (complaint->fmt == fmt)
 	return complaint;
     }
 
   /* Oops not seen before, fill in a new complaint.  */
   complaint = XNEW (struct complain);
   complaint->fmt = fmt;
-  complaint->file = file;
-  complaint->line = line;
   complaint->counter = 0;
   complaint->next = NULL;
 
@@ -107,8 +100,7 @@ complaint_internal (const char *fmt, ...)
 {
   va_list args;
 
-  struct complain *complaint = find_complaint (&symfile_complaint_book, NULL,
-					       0, fmt);
+  struct complain *complaint = find_complaint (&symfile_complaint_book, fmt);
   enum complaint_series series;
 
   complaint->counter++;
@@ -125,9 +117,7 @@ complaint_internal (const char *fmt, ...)
      string somewhere up the call chain.  */
   gdb_assert (complaint->fmt == fmt);
 
-  if (complaint->file != NULL)
-    internal_vwarning (complaint->file, complaint->line, fmt, args);
-  else if (deprecated_warning_hook)
+  if (deprecated_warning_hook)
     (*deprecated_warning_hook) (fmt, args);
   else
     {


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