From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 108799 invoked by alias); 7 Dec 2018 15:49:30 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 108680 invoked by uid 89); 7 Dec 2018 15:49:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.9 required=5.0 tests=BAYES_00,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Break, Hx-languages-length:1905, luck X-HELO: mail-wr1-f47.google.com Received: from mail-wr1-f47.google.com (HELO mail-wr1-f47.google.com) (209.85.221.47) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 07 Dec 2018 15:49:27 +0000 Received: by mail-wr1-f47.google.com with SMTP id q18so4224936wrx.9 for ; Fri, 07 Dec 2018 07:49:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QPvQCTeUdpEDO5r1Hy1zrdJ/NgNyFebS6zDRoojxNes=; b=cg/z0g5caemwmb5R2kUi+weP2gRcsU2JNz9kMlhvndOASX4+YsGHE2bFjQvrxMyfeN ex8PXrQnlHHEPeKGxp2X+UTTOtD/KrWk7b9MloZrAs2ZrlogJz9vKfEJud+PC6K0SavO dggHRnxxKf4Q3qg8vAZzAZa9wERZ9fJ8jaeBnxEM+oYdO/f+VxY0qdHX7bLTOb1R814/ Hiq7j+WVCqFRcv4O826XWxmwrBRkG11h32hUe3OnPMtl2BZa1QMRNGtsq+VHWAERjsPr f9piaUsBk6Hh7MKccYF42WvbhyVQ9UfzInmgdk14iGRiBGa4tzWpqO/4pDcfIWl3pnqP EPXQ== Return-Path: Received: from localhost (host86-156-236-210.range86-156.btcentralplus.com. [86.156.236.210]) by smtp.gmail.com with ESMTPSA id o17sm6742953wmg.35.2018.12.07.07.49.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Dec 2018 07:49:24 -0800 (PST) Date: Fri, 07 Dec 2018 15:49:00 -0000 From: Andrew Burgess To: Bob Steagall Cc: gdb-patches@sourceware.org Subject: Re: potential patch for gdb bug c++/20020 - updated Message-ID: <20181207154923.GB18841@embecosm.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Fortune: Yes, but every time I try to see things your way, I get a headache. X-Editor: GNU Emacs [ http://www.gnu.org/software/emacs ] User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg00090.txt.bz2 * Bob Steagall [2018-12-07 07:57:28 -0500]: > Description: > > This patch, against released version 8.2, fixes the > problem reported in gdb bug c++/20020, using the > approach described in comment 1 of that report. As Tom said, it would be great to have a proper reproducer for this in the testsuite. I had a little go digging through all the various linked bugs, but I wasn't able to come up with anything that could trigger this issue. Would you be able to identify exactly which error is being thrown that causes cp_print_value_fields to have 'v == NULL' condition? If you run gdb under gdb, then in this code: TRY { v = value_static_field (type, i); // <--- Break on this line } CATCH (ex, RETURN_MASK_ERROR) { fprintf_filtered (stream, _(""), ex.message); } END_CATCH Break on the marked line, and do: (gdb) catch throw (gdb) continue With luck this should allow you to figure out exactly which error is landing GDB in the CATCH block. Another data point that will be useful would be a dump of all the DWARF related to the static field that is causing the problem. If you could dig this information out then we should be able to put together a reproducer. Thanks, Andrew > > Changelog entry: > > 2018-12-06 Bob Steagall > > * cp-valprint.c: Fixes bug c++/20020. > --- gdb/cp-valprint.c 2018-09-05 03:27:13.000000000 -0400 > +++ gdb/cp-valprint.c.new 2018-12-07 07:41:00.657110092 -0500 > @@ -329,9 +329,10 @@ cp_print_value_fields (struct type *type > } > END_CATCH > > - cp_print_static_field (TYPE_FIELD_TYPE (type, i), > - v, stream, recurse + 1, > - options); > + if (v != NULL) > + cp_print_static_field (TYPE_FIELD_TYPE (type, i), > + v, stream, recurse + 1, > + options); > } > else if (i == vptr_fieldno && type == vptr_basetype) > {