From patchwork Tue May 22 05:07:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 27393 Received: (qmail 95280 invoked by alias); 22 May 2018 05:09:23 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 18894 invoked by uid 89); 22 May 2018 05:08:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, TIME_LIMIT_EXCEEDED autolearn=unavailable version=3.3.2 spammy=1259 X-HELO: gateway20.websitewelcome.com Received: from gateway20.websitewelcome.com (HELO gateway20.websitewelcome.com) (192.185.64.36) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 22 May 2018 05:07:53 +0000 Received: from cm11.websitewelcome.com (cm11.websitewelcome.com [100.42.49.5]) by gateway20.websitewelcome.com (Postfix) with ESMTP id 4D4BF400E5708 for ; Tue, 22 May 2018 00:07:09 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id KzVtfe0eDA3CSKzVtff1nA; Tue, 22 May 2018 00:07:09 -0500 X-Authority-Reason: nr=8 Received: from 174-29-44-154.hlrn.qwest.net ([174.29.44.154]:36532 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.89_1) (envelope-from ) id 1fKzVt-003pV7-3c; Tue, 22 May 2018 00:07:09 -0500 From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [RFA 7/9] Remove file and line from struct complain Date: Mon, 21 May 2018 23:07:02 -0600 Message-Id: <20180522050704.10845-8-tom@tromey.com> In-Reply-To: <20180522050704.10845-1-tom@tromey.com> References: <20180522050704.10845-1-tom@tromey.com> X-BWhitelist: no X-Source-L: No X-Exim-ID: 1fKzVt-003pV7-3c X-Source-Sender: 174-29-44-154.hlrn.qwest.net (bapiya.Home) [174.29.44.154]:36532 X-Source-Auth: tom+tromey.com X-Email-Count: 8 X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes 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-21 Tom Tromey * complaints.c (struct complain) : Remove. (find_complaint): Remove file, line parameters. (complaint_internal): Update. --- gdb/ChangeLog | 6 ++++++ gdb/complaints.c | 20 +++++--------------- 2 files changed, 11 insertions(+), 15 deletions(-) diff --git a/gdb/complaints.c b/gdb/complaints.c index 4b7532582f..851d8f5d6f 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 {