From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29326 invoked by alias); 26 Apr 2005 03:18:59 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 29236 invoked from network); 26 Apr 2005 03:18:48 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 26 Apr 2005 03:18:48 -0000 Received: from drow by nevyn.them.org with local (Exim 4.50 #1 (Debian)) id 1DQGad-0001KS-GZ; Mon, 25 Apr 2005 23:18:23 -0400 Date: Tue, 26 Apr 2005 03:18:00 -0000 From: Daniel Jacobowitz To: Wu Zhou Cc: gdb-patches@sources.redhat.com, gilliam@us.ibm.com, manjo@austin.ibm.com Subject: Re: about how to add support to new c++ compiler in GDB Message-ID: <20050426031822.GA4998@nevyn.them.org> Mail-Followup-To: Wu Zhou , gdb-patches@sources.redhat.com, gilliam@us.ibm.com, manjo@austin.ibm.com References: <001f01c54a0b$146e8450$7286b509@ibmcsdl9m89c83> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001f01c54a0b$146e8450$7286b509@ibmcsdl9m89c83> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-04/txt/msg00335.txt.bz2 On Tue, Apr 26, 2005 at 10:53:03AM +0800, Wu Zhou wrote: > Hello Daniel and all, > > I am recently running GDB testsuite against IBM's xlc compiler, and found > some problems with c++ testcases, especially while handling virtual-table > related stuff. After some analysis, I found there are some difference > between the debuginfo output between xlc++ and g++. The main difference I > noted now is that the class in xlc++ didn't depend on DW_TAG_containing_type > to find its virutal function table. Instead, every virtual class in xlc++ > had its own "__vfp", which act the same role as "_vptr.CLASSNAME" in g++. > This will make gdb crash (SEGV) on quite a few c++ testcase. I have some patches for this, originally developed for the ARM RVCT compiler. I haven't had the time to clean them up and post them. They will probably be helpful to you. If I haven't posted them by the end of this week, please, remind me. > I am now considering add some code in GDB to fix this. After doing some > search in this mail-list, I found there are some discussion on similar > problem before, such as http://sourceware.org/ml/gdb/2004-12/msg00077.html. > So I think maybe some of you might have experience or thought or idea on > this already. So I write this mail to ask for your expert advice: > > 1. To support a new c++ compiler, what work need to bo done? I am now > thinking of is a new source file(maybe xlc-abi.c) to register its own cp-abi > operation, and some tweak in dwarf2read.c to let GDB understand xlc specific > debuginfo. Any else places need my special attention? Please advice. Do you need an xlc-abi.c? What ABI does this compiler follow? If it doesn't follow the Itanium C++ ABI or one of the older GNU ABIs, then considerably more work may be required. Is its ABI documented? > 2. while coding this support, what design consideration I need to take into > account? Is there any document on this? GDB internal didn't mention this. > Maybe there are some in somebody's mind, would you like to share with me? > Thanks a lot. :-) I'd be glad to answer more specific questions, but I've not got any answers for this general one. Do you have arangements for copyright assignment? I don't know how exactly that works in IBM, but I suspect it's complicated. > 3. To verify that my code does work ok and don't bring any other > side-effect, what I need to take into account? Running the testsuite against > the modified code might be a help. Any specific area need some more > attention? Testing with already supported C++ compilers is very important. It's easy to fix one ABI and break another. -- Daniel Jacobowitz CodeSourcery, LLC