From owner-freebsd-current@FreeBSD.ORG Fri Jan 4 12:49:36 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A773BB0E; Fri, 4 Jan 2013 12:49:36 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from fep15.mx.upcmail.net (fep15.mx.upcmail.net [62.179.121.35]) by mx1.freebsd.org (Postfix) with ESMTP id C831AC2; Fri, 4 Jan 2013 12:49:35 +0000 (UTC) Received: from edge02.upcmail.net ([192.168.13.237]) by viefep15-int.chello.at (InterMail vM.8.01.05.05 201-2260-151-110-20120111) with ESMTP id <20130104124928.VVAW2598.viefep15-int.chello.at@edge02.upcmail.net>; Fri, 4 Jan 2013 13:49:28 +0100 Received: from mole.fafoe.narf.at ([80.109.55.137]) by edge02.upcmail.net with edge id joqq1k0072xdvHc01oqqTT; Fri, 04 Jan 2013 13:50:50 +0100 X-SourceIP: 80.109.55.137 Received: by mole.fafoe.narf.at (Postfix, from userid 1001) id A079C6D454; Fri, 4 Jan 2013 13:49:27 +0100 (CET) Date: Fri, 4 Jan 2013 13:49:27 +0100 From: Stefan Farfeleder To: David Chisnall Subject: Re: Unbreaking gdb's catch throw Message-ID: <20130104124927.GB1430@mole.fafoe.narf.at> References: <20130104123424.GA1430@mole.fafoe.narf.at> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@FreeBSD.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2013 12:49:36 -0000 On Fri, Jan 04, 2013 at 12:38:44PM +0000, David Chisnall wrote: > Is this on 9.1? In -CURRENT and 9.1, libstdc++ is a filter library, and libsupc++ or or libcxxrt are the filtee. This means that the __cxa_throw symbol appears to be in libstdc++ (for symbol versioning purposes), but is actually in the ABI library. If you tell gdb to put the breakpoint on __cxa_throw itself, then it should tell you that there are multiple definitions and ask which one you want (if it doesn't, it's a gdb bug). > This is on 10.0-CURRENT r244738 amd64. The commands 'b __cxa_throw' and 'catch throw' seemd to be identical, and gdb does not ask about multiple versions of __cxa_throw. To be honest, I don't care exactly whose bug it is, I want it to work again :D $ cat throw.cc int main(void) { throw 1; } $ c++ -g throw.cc $ gdb a.out GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "amd64-marcel-freebsd"... (gdb) b main Breakpoint 1 at 0x4007f9: file throw.cc, line 3. (gdb) r Starting program: /usr/home/stefan/scratch/a.out Breakpoint 1, main () at throw.cc:3 3 throw 1; (gdb) b __cxa_throw Breakpoint 2 at 0x800898d34 (gdb) c Continuing. terminate called after throwing an instance of 'int' Program received signal SIGABRT, Aborted. 0x0000000800e52fca in kill () from /lib/libc.so.7 Stefan