From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 96011 invoked by alias); 3 Feb 2018 05:02:03 -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 95980 invoked by uid 89); 3 Feb 2018 05:02:02 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,HTML_MESSAGE,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=no version=3.3.2 spammy=H*i:sk:e9442bb, H*f:sk:e9442bb, H*c:alternative X-HELO: mail-wr0-f169.google.com Received: from mail-wr0-f169.google.com (HELO mail-wr0-f169.google.com) (209.85.128.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 03 Feb 2018 05:02:01 +0000 Received: by mail-wr0-f169.google.com with SMTP id s5so24505801wra.0 for ; Fri, 02 Feb 2018 21:02:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=viVAhw9ERcS+NVUanxVMcb0gyj38BUeJTlmjaSudIdg=; b=LgRjAb1OdZV7VeP7wJiNoaG9OqfzV/KGLS7r/FDKpNFC1ZbYPtS8WtTu0S3J31QTod SNMR32mIztLrjqOB8MwsGIanDrP1pp8qHyf8DWKABY/WaDDz+c1xWT7U3sTQXkbVBWwl aSOH98b4NFb8gVk3D6zVqMdkNZ0rbfm9pbTwRSGY77rXiGiSncoSfqHEwGi24UbdGhjE hlJ8SsUqRx7eJPraNKImSeOWa0Tc3RtEUunelHzD23doFQVpnc/ATSj3hSfSrCWRvTj9 Y4mNI28ZR5n1n39MkLwqTgZYEvQCOMuYIQAIpSGexnvRT5WsAm0qaS0bqccQ03TK1Skv eX4w== X-Gm-Message-State: AKwxytcvaM9WYkPLWCpUf+pF8mtHAJqH4MK9G9qgWQPbNJ/00jlcwvsW yXKI6abqz9ptL4FK8IazmLgjYG2ebl/mv8evgio= X-Google-Smtp-Source: AH8x226ffrknxYcyk0dRpW/jKix85OwMCzTP6sGRooDzK7xzJQn5MJqR/kywsAfIvsByN/oWcnbhiw0UlyLaOP+0pEM= X-Received: by 10.223.176.174 with SMTP id i43mr22169772wra.77.1517634119090; Fri, 02 Feb 2018 21:01:59 -0800 (PST) MIME-Version: 1.0 Received: by 10.28.122.19 with HTTP; Fri, 2 Feb 2018 21:01:58 -0800 (PST) In-Reply-To: References: From: Roman Popov Date: Sat, 03 Feb 2018 05:02:00 -0000 Message-ID: Subject: Re: gdb 8.x - g++ 7.x compatibility To: Simon Marchi Cc: gdb@sourceware.org, gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2018-02/txt/msg00011.txt.bz2 Yes, problem is still there in g++7.3 / gdb 8.1. I wonder why they decided to emit different strings to RTTI and debug info? What is the technical reason behind this? -Roman 2018-02-02 20:54 GMT-08:00 Simon Marchi : > 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 >