From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by sourceware.org (Postfix) with ESMTP id 5A5573857C62 for ; Fri, 28 Aug 2020 14:36:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 5A5573857C62 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-370-8Y36Zy5xNza36iM8AE1EMQ-1; Fri, 28 Aug 2020 10:35:59 -0400 X-MC-Unique: 8Y36Zy5xNza36iM8AE1EMQ-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D8FDA10082E5; Fri, 28 Aug 2020 14:35:57 +0000 (UTC) Received: from blade.nx (ovpn-114-125.ams2.redhat.com [10.36.114.125]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9A14B5DE81; Fri, 28 Aug 2020 14:35:57 +0000 (UTC) Received: by blade.nx (Postfix, from userid 1000) id 95870816CCA9; Fri, 28 Aug 2020 15:35:56 +0100 (BST) Date: Fri, 28 Aug 2020 15:35:56 +0100 From: Gary Benson To: Luis Machado Cc: Pedro Alves , gdb-patches@sourceware.org Subject: Re: [PATCH] Reject ambiguous C++ field accesses Message-ID: <20200828143556.GA15596@blade.nx> References: <20200827180251.20244-1-pedro@palves.net> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0.002 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-13.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Aug 2020 14:36:04 -0000 Luis Machado wrote: > On 8/27/20 3:02 PM, Pedro Alves wrote: > > diff --git a/gdb/valops.c b/gdb/valops.c > > index 0eb2b096211..0e030a03ecd 100644 > > --- a/gdb/valops.c > > +++ b/gdb/valops.c > > @@ -1766,25 +1766,105 @@ typecmp (int staticp, int varargs, int nargs, > > return i + 1; > > } > > -/* Helper class for do_search_struct_field that updates *RESULT_PTR > > - and *LAST_BOFFSET, and possibly throws an exception if the field > > - search has yielded ambiguous results. */ > > +/* Helper class for search_struct_field that keeps track of found > > + results. See search_struct_field for description of > > + LOOKING_FOR_BASECLASS. If LOOKING_FOR_BASECLASS is true, possibly > > + throws an exception if the base class search has yielded ambiguous > > "throw" an exception instead? I think remove "possibly" and "has" also. "If LOOKING_FOR_BASECLASS is true, throw an exception if the base class search yielded ambiguous results." Thanks, Gary