From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 86988 invoked by alias); 3 Feb 2018 04:54:40 -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 86961 invoked by uid 89); 3 Feb 2018 04:54:39 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 spammy=H*f:sk:CAATAM3, H*i:sk:CAATAM3 X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 03 Feb 2018 04:54:38 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w134sVDx013480 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Fri, 2 Feb 2018 23:54:36 -0500 Received: by simark.ca (Postfix, from userid 112) id C5E8C1E757; Fri, 2 Feb 2018 23:54:31 -0500 (EST) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 585F81E093; Fri, 2 Feb 2018 23:54:30 -0500 (EST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Sat, 03 Feb 2018 04:54:00 -0000 From: Simon Marchi To: Roman Popov Cc: gdb@sourceware.org, gcc@gcc.gnu.org Subject: Re: gdb 8.x - g++ 7.x compatibility In-Reply-To: References: Message-ID: X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.4 X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Sat, 3 Feb 2018 04:54:31 +0000 X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00010.txt.bz2 On 2018-02-02 22:17, Roman Popov wrote: > Hello, > I'm trying to switch from g++ 5.4 to g++ 7.2. > GDB 8.0.1 however does not understand RTTI generated by g++7.2, so my > Python scripts for GDB are not working. > > Here is a code example: > > struct base { virtual ~base(){} }; > > template< int IVAL, unsigned UVAL, unsigned long long ULLVAL> > struct derived : base { > int x = IVAL + + UVAL + ULLVAL; > }; > > int main() > { > base * o = new derived<1,2,3>{}; > return 0; > } > > When compiled with g++5.4 I can read value of x in debugger. > When compiled with g++7.2 gdb reports: > warning: RTTI symbol not found for class 'derived<1, 2u, 3ull>' > > Problem here is that type name saved in debug information is > *derived<1, 2, 3>*, not *derived<1, 2u, 3ull>* > > Do you plan to fix this anytime soon? > > Thanks, > Roman Hi Roman, Your problem is probably linked to these issues, if you want to follow them: gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81932 gdb: https://sourceware.org/bugzilla/show_bug.cgi?id=22013 As Carl said, it's a good idea to try with the latest version of both tools, but I think the issue will still be present. GCC changed how it outputs unsigned template parameters in the debug info (from 2u to just 2), and it doesn't look like it's going to change it back. So I suppose we'll have to find a way to make GDB deal with it. Simon