From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92663 invoked by alias); 13 Feb 2018 16:52:42 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 92648 invoked by uid 89); 13 Feb 2018 16:52:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=artifacts, H*MI:sk:1518536 X-HELO: eggs.gnu.org Received: from eggs.gnu.org (HELO eggs.gnu.org) (208.118.235.92) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 13 Feb 2018 16:52:40 +0000 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eldoq-0004RM-Bo for gdb@sourceware.org; Tue, 13 Feb 2018 11:52:39 -0500 Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46711) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eldoh-0004PD-4T; Tue, 13 Feb 2018 11:52:27 -0500 Received: from [50.226.24.42] (port=48992 helo=pdsdesk) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1eldog-0002l4-Kb; Tue, 13 Feb 2018 11:52:26 -0500 Message-ID: <1518540745.1130.14.camel@gnu.org> Subject: Re: GDB syntax error if class members overlap C++ header file names From: Paul Smith Reply-To: psmith@gnu.org To: Simon Marchi Cc: gdb@sourceware.org Date: Tue, 13 Feb 2018 16:52:00 -0000 In-Reply-To: References: <1518536232.1130.9.camel@gnu.org> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00093.txt.bz2 On Tue, 2018-02-13 at 10:52 -0500, Simon Marchi wrote: > On 2018-02-13 10:37, Paul Smith wrote: > > Has anyone had any thoughts about > > https://sourceware.org/bugzilla/show_bug.cgi?id=22231 > > > > This is a really unfortunate bug, because there are so many useful > > symbol names which are also C++ header files! Just ran into this > > again with "queue". > > Hi Paul, > > This looks like an issue that has been fixed recently, but it's not > in 8.1, only master. > > https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=5 > 9498c305e6f1db2a1ed8d44cb58f0d24ec092fe > > Can you verify if it works for you? I ran applied SHA 59498c305e6f1db2a1ed8d44cb58f0d24ec092fe as a patch to 8.1 (but had to toss the changelog diffs... yet another reason to stop including them as source code artifacts...) and that does fix the main problem... awesome! There's still a weird error if there's no symbol in context; my first example the the bug still prints "syntax error in expression, near `'" rather than something more reasonable such as "No symbol "memory" in current context". That's probably still something that should be fixed, but it's basically an error messaging issue. However, if there's a "memory" symbol in the current context (either implicitly as in we're in a method and the class has a "memory" member, or using something like foo.memory) it will find and print the right thing. So that's excellent! Thanks.