From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1760 invoked by alias); 29 Oct 2006 22:21:48 -0000 Received: (qmail 1751 invoked by uid 22791); 29 Oct 2006 22:21:47 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sun, 29 Oct 2006 22:21:44 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1GeJ2E-0003g8-GE; Sun, 29 Oct 2006 17:21:42 -0500 Date: Sun, 29 Oct 2006 22:21:00 -0000 From: Daniel Jacobowitz To: "Kulkarni, Mayuresh (IT)" Cc: gdb@sourceware.org Subject: Re: Finding the type of an exception Message-ID: <20061029222142.GA14050@nevyn.them.org> Mail-Followup-To: "Kulkarni, Mayuresh (IT)" , gdb@sourceware.org References: <20061029211751.GA19301@sdf.lonestar.org> <1F8E762E1B3F814F9630D0D32A1C65F808DA323E@NYWEXMB81.msad.ms.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1F8E762E1B3F814F9630D0D32A1C65F808DA323E@NYWEXMB81.msad.ms.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-10/txt/msg00286.txt.bz2 On Sun, Oct 29, 2006 at 05:15:47PM -0500, Kulkarni, Mayuresh (IT) wrote: > Hello, > > I am looking at a core generated by a C++ process because a throw spec > was violated by a function. > > The concerned frame in the stack trace is : > #5 0xf65c2485 in __cxa_call_unexpected (exc_obj_in=0xb58cbb4) at > /sw/gcc/src/libstdc++-v3/libsupc++/eh_personality.cc:485 > > > At this point in the process (after std::unexpected() has been called > and we end up in the above function), is it still somehow possible to > deduce the type of the exception from the exc_obj_in void * argument? > Say by trying to interpret the above void * argument as a std::exception > (from other reasons, I am pretty sure that this was a std::exception) > and then doing what typeid does to get at the type_info ? The best place to look for more information about this is the common C++ ABI document; it's named for Itanium, but don't let that throw you off, it is actually used with only minor variations (such as the sizes of types) on other platforms. You can learn more about it here: http://www.codesourcery.com/cxx-abi/abi.html http://www.codesourcery.com/cxx-abi/abi-eh.html The object you've got there is a __cxa_exception, if I'm remembering how this works right. If so then the first pointer is going to be to a type_info. -- Daniel Jacobowitz CodeSourcery