Message ID | 20180712205208.32646-11-tom@tromey.com |
---|---|
State | New, archived |
Headers |
Received: (qmail 57246 invoked by alias); 12 Jul 2018 20:52:39 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: <gdb-patches.sourceware.org> List-Unsubscribe: <mailto:gdb-patches-unsubscribe-##L=##H@sourceware.org> List-Subscribe: <mailto:gdb-patches-subscribe@sourceware.org> List-Archive: <http://sourceware.org/ml/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-help@sourceware.org>, <http://sourceware.org/ml/#faqs> Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 56801 invoked by uid 89); 12 Jul 2018 20:52:37 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.7 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: gateway21.websitewelcome.com Received: from gateway21.websitewelcome.com (HELO gateway21.websitewelcome.com) (192.185.45.228) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 12 Jul 2018 20:52:34 +0000 Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway21.websitewelcome.com (Postfix) with ESMTP id 2478B400C95CC for <gdb-patches@sourceware.org>; Thu, 12 Jul 2018 15:52:32 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id diZRfRGb2aSeydiZdf4E4d; Thu, 12 Jul 2018 15:52:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=Z+LrdW8l3uljl4NuVGzOARAR9GLRQv70t+VUxkQDomU=; b=SFZ6PjN32cC3ziNbIkMyA39kBA WeuW664Tymk1n5XxW7g62SQ2qWKAdozENgwgxPjhBGd0RBxbvujQ5R9nxe0rCAGH7iTGLfdHkUyfp tBkwGFUA3r89D8HC6iau8AGgV; Received: from 75-166-85-72.hlrn.qwest.net ([75.166.85.72]:49432 helo=bapiya.Home) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from <tom@tromey.com>) id 1fdiZR-001ZuD-HA; Thu, 12 Jul 2018 15:52:13 -0500 From: Tom Tromey <tom@tromey.com> To: gdb-patches@sourceware.org Cc: Tom Tromey <tom@tromey.com> Subject: [RFA 10/13] Remove unused declaration from value.c Date: Thu, 12 Jul 2018 14:52:05 -0600 Message-Id: <20180712205208.32646-11-tom@tromey.com> In-Reply-To: <20180712205208.32646-1-tom@tromey.com> References: <20180712205208.32646-1-tom@tromey.com> |
Commit Message
Tom Tromey
July 12, 2018, 8:52 p.m. UTC
This removes an unused declaration from value_fetch_lazy_bitfield, but leaves the call to check_typedef, because it may be called for effect. gdb/ChangeLog 2018-07-12 Tom Tromey <tom@tromey.com> * value.c (value_fetch_lazy_bitfield): Call check_typedef for effect. --- gdb/ChangeLog | 5 +++++ gdb/value.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-)
Comments
On 2018-07-12 04:52 PM, Tom Tromey wrote: > This removes an unused declaration from value_fetch_lazy_bitfield, but > leaves the call to check_typedef, because it may be called for effect. Do you know for sure this is necessary (e.g. without this, some test fails), or you are just being cautious? Simon
>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes: Simon> On 2018-07-12 04:52 PM, Tom Tromey wrote: >> This removes an unused declaration from value_fetch_lazy_bitfield, but >> leaves the call to check_typedef, because it may be called for effect. Simon> Do you know for sure this is necessary (e.g. without this, some test fails), Simon> or you are just being cautious? Just being cautious. It's entirely possible that this isn't needed. Maybe removing it is correct in that nothing in the function appears to need it, and if it causes a bug then that means that some other spot ought to have called check_typedef. Tom
On 2018-07-13 16:51, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi <simark@simark.ca> writes: > > Simon> On 2018-07-12 04:52 PM, Tom Tromey wrote: >>> This removes an unused declaration from value_fetch_lazy_bitfield, >>> but >>> leaves the call to check_typedef, because it may be called for >>> effect. > > Simon> Do you know for sure this is necessary (e.g. without this, some > test fails), > Simon> or you are just being cautious? > > Just being cautious. It's entirely possible that this isn't needed. > Maybe removing it is correct in that nothing in the function appears to > need it, and if it causes a bug then that means that some other spot > ought to have called check_typedef. > > Tom Then my opinion would be to check if removing it causes any test failure. If not, I'd remove it (in its own commit such as this patch is good, so it's easy to bisect if needed). Simon
On 07/13/2018 10:49 PM, Simon Marchi wrote:
> Then my opinion would be to check if removing it causes any test failure. If not, I'd remove it (in its own commit such as this patch is good, so it's easy to bisect if needed).
Agreed. If/when we find out it was needed, we can add
a testcase then.
Thanks,
Pedro Alves
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Simon> Then my opinion would be to check if removing it causes any test
Simon> failure. If not, I'd remove it (in its own commit such as this
Simon> patch is good, so it's easy to bisect if needed).
Pedro> Agreed. If/when we find out it was needed, we can add
Pedro> a testcase then.
I've made this change.
Tom
diff --git a/gdb/value.c b/gdb/value.c index 9f9e78ece2b..1747a62980f 100644 --- a/gdb/value.c +++ b/gdb/value.c @@ -3726,7 +3726,7 @@ value_fetch_lazy_bitfield (struct value *val) per bitfield. It would be even better to read only the containing word, but we have no way to record that just specific bits of a value have been fetched. */ - struct type *type = check_typedef (value_type (val)); + check_typedef (value_type (val)); struct value *parent = value_parent (val); if (value_lazy (parent))