From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19941 invoked by alias); 23 Jul 2011 21:17:59 -0000 Received: (qmail 19931 invoked by uid 22791); 23 Jul 2011 21:17:58 -0000 X-SWARE-Spam-Status: No, hits=-2.2 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_BJ,TW_CX,TW_JC X-Spam-Check-By: sourceware.org Received: from mail-gx0-f169.google.com (HELO mail-gx0-f169.google.com) (209.85.161.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 23 Jul 2011 21:17:44 +0000 Received: by gxk23 with SMTP id 23so1999596gxk.0 for ; Sat, 23 Jul 2011 14:17:43 -0700 (PDT) MIME-Version: 1.0 Received: by 10.236.200.131 with SMTP id z3mr3928092yhn.322.1311455863614; Sat, 23 Jul 2011 14:17:43 -0700 (PDT) Received: by 10.236.109.131 with HTTP; Sat, 23 Jul 2011 14:17:43 -0700 (PDT) In-Reply-To: <20110715191920.GA29975@host1.jankratochvil.net> References: <20110715191920.GA29975@host1.jankratochvil.net> Date: Sat, 23 Jul 2011 22:12:00 -0000 Message-ID: Subject: Re: [rfc] Be in language c more c++ compatible From: Matt Rice To: Jan Kratochvil Cc: gdb-patches@sourceware.org Content-Type: multipart/mixed; boundary=20cf305b09bce3ac5704a8c31c09 X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-07/txt/msg00658.txt.bz2 --20cf305b09bce3ac5704a8c31c09 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-length: 1503 On Fri, Jul 15, 2011 at 12:19 PM, Jan Kratochvil wrote: > Hi, > > I always see some terrible C++ GDB bug so I fix in some hours and then fi= nd out > it works in GDB when one has `set language c++'. =A0This usually happens = with > artificial testcases like the one today: > =A0 =A0 =A0 =A0http://sourceware.org/ml/gdb-patches/2011-07/msg00387.html was curious what it did with the attached objc++ version. which isn't really a supported language by any means. gdb considers it to be 'minimal'/doesn't recognize the CU language in the debuginfo. and it is difficult to say how meaningful it would be if it did. I imagine gdb wants DW_TAG_partial_unit/DW_AT_language when switching between c++/objective-c functions, I hadn't been able to coax this out of gcc anyhow the last line was a bit suprising. gcc -g -o objcxx objc++.mm -lobjc GNU gdb (GDB) Fedora (7.2-51.fc14) (gdb) set language c++ (gdb) whatis C::t No symbol "C" in current context. (gdb) set language objective-c (gdb) whatis C::t No symbol "C" in current context. (gdb) break main Breakpoint 1 at 0x400808: file objc++.mm, line 47. (gdb) r Breakpoint 1, main () at objc++.mm:47 47 Foo *foo =3D [[Foo alloc] init]; Warning: the current language does not match this frame. (gdb) whatis C::t type =3D t (gdb) show language The current source language is "objective-c". Warning: the current language does not match this frame. (gdb) set language c++ (gdb) whatis C::t A syntax error in expression, near `'. --20cf305b09bce3ac5704a8c31c09 Content-Type: text/plain; charset=US-ASCII; name="objc++.mm" Content-Disposition: attachment; filename="objc++.mm" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gqh2vfoh1 Content-length: 598 I2luY2x1ZGUgPG9iamMvT2JqZWN0Lmg+CgpjbGFzcyBDIHsgCiAgcHVibGlj OgogIHR5cGVkZWYgaW50IHQ7CiAgQygpOwogIEModCk7CiAgdCBpOwp9IGM7 CgpDOjpDKCkKewogIGkgPSA5Owp9CgpDOjpDKHQgeCkKewogIGkgPSB4Owp9 CgpAaW50ZXJmYWNlIEZvbyA6IE9iamVjdAp7CiAgQHB1YmxpYwogICAgQzo6 dCBpOwp9Ci0gKEM6OnQpIGJhcjsKQGVuZAoKQGltcGxlbWVudGF0aW9uIEZv bwotIChpZCkgaW5pdAp7CiAgaWYgKChzZWxmID0gW3N1cGVyIGluaXRdKSkK ICAgIGkgPSA1OwoKICByZXR1cm4gc2VsZjsKfQoKLSAoQzo6dCkgYmFyIAp7 CiAgcmV0dXJuIGk7Cn0KCkBlbmQKCmludCBtYWluKCkKewogIEZvbyAqZm9v ID0gW1tGb28gYWxsb2NdIGluaXRdOwogIEMgYyA9IEMoW2ZvbyBiYXJdKTsK ICBwcmludGYoIiVpICVpXG4iLCBmb28tPmksIGMuaSk7Cn0K --20cf305b09bce3ac5704a8c31c09--