From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25521 invoked by alias); 18 Aug 2011 21:45:01 -0000 Received: (qmail 25495 invoked by uid 22791); 18 Aug 2011 21:45:00 -0000 X-SWARE-Spam-Status: No, hits=-2.8 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,TW_PR X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Aug 2011 21:44:46 +0000 From: "anonyme_uprh at hotmail dot com" To: gdb-prs@sourceware.org Subject: [Bug c++/12266] Typedefs are not expanded to their base types in breakpoint definitions Date: Thu, 18 Aug 2011 22:19:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: anonyme_uprh at hotmail dot com X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: keiths at redhat dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2011-q3/txt/msg00231.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=3D12266 --- Comment #11 from Martin Schr=C3=B6der = 2011-08-18 21:44:40 UTC --- Hello Keith! I've finally found the time to examine this bug again, and I can report tha= t, indeed, some things work better, but not across the board. At first I tried to apply the patches that were linked to in http://sourceware.org/ml/gdb-patches/2011-07/msg00795.html to the GDB-7.3 b= ase archive. The patches succeeded with minor offsets. Unfortunately, the compilation failed. After that, I checked out the CVS he= ad (because I interpret your recent posting to mean that you merged your chang= es into the mainline). Anyway, that version compiled and I started to test it. First, I selected my own initial test code: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D #include typedef std::string foo; void calltest(foo val) {} int main() { calltest(foo("")); } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D The good news is that "whatis" still correctly reports both "foo" and "std::string". It tells us that foo maps to string and string to basic_stri= ng. Then I tried to execute "break calltest(foo)", "break calltest(std::string)" and "break calltest(basic_string...). In GDB 7.1 and earlier all three work= ed. In GDB 7.2/7.3 the break on std::string failed, but the break on foo worked after an initial "whatis" query. Without this initial query, only the full expansion worked. The good news is that with your changes, the break on "calltest(std::string= )" works right out of the box. But unfortunately, now the breaks on "calltest(foo)" AND "calltest(basic_string)" don't not work at all -- even after a whatis query. After that, I tried your plain-C test case of: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D #include typedef const char* const* my_type; typedef my_type my_other_type; void test (my_other_type foo) { } int main (void) { test (NULL); return 0; } =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Here, GDB 7.1 worked with everything whereas GDB 7.2/7.3 only worked halfway after whatis coercion. With the CVS HEAD, the situation looks even worse. Only "break test" works;= but nothing else. Of course, both "whatis" and "ptype" still report things correctly, according to their differing type-depth expansion styles: =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D (gdb) whatis test type =3D void (my_other_type) (gdb) whatis my_other_type type =3D my_type (gdb) whatis my_type type =3D const char * const * (gdb) ptype test type =3D void (my_other_type) (gdb) ptype my_type type =3D const char * const * (gdb) ptype my_other_type type =3D const char * const * =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D So, as long as I am correct in presuming that the CVS Head contains your changes, I can only say that some things are improved, but some things still don't work right. Ideally, the user should be able to use all types interchangeably, because = as you can see with whatis and ptype, GDB occassionally reports the expanded types, instead of the typedefs that were actually used in the code. Thanks again for your continued work and patience with this nasty bug, Martin. --=20 Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=3Demail ------- You are receiving this mail because: ------- You are on the CC list for the bug.