From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12471 invoked by alias); 26 Apr 2005 02:54:17 -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 11180 invoked from network); 26 Apr 2005 02:53:34 -0000 Received: from unknown (HELO ausmtp01.au.ibm.com) (202.81.18.186) by sourceware.org with SMTP; 26 Apr 2005 02:53:34 -0000 Received: from sd0112e0.au.ibm.com (d23rh903.au.ibm.com [202.81.18.201]) by ausmtp01.au.ibm.com (8.12.10/8.12.10) with ESMTP id j3Q2td4q015064 for ; Tue, 26 Apr 2005 12:55:42 +1000 Received: from d23av01.au.ibm.com (d23av01.au.ibm.com [9.190.250.242]) by sd0112e0.au.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j3Q2u5fL085906 for ; Tue, 26 Apr 2005 12:56:05 +1000 Received: from d23av01.au.ibm.com (loopback [127.0.0.1]) by d23av01.au.ibm.com (8.12.11/8.12.11) with ESMTP id j3Q2rLwQ015710 for ; Tue, 26 Apr 2005 12:53:22 +1000 Received: from ibmcsdl9m89c83 (ibmcsdl-9m89c83.cn.ibm.com [9.181.134.114]) by d23av01.au.ibm.com (8.12.11/8.12.11) with SMTP id j3Q2r96a015488; Tue, 26 Apr 2005 12:53:17 +1000 Message-ID: <001f01c54a0b$146e8450$7286b509@ibmcsdl9m89c83> From: "Wu Zhou" To: , Cc: , Subject: about how to add support to new c++ compiler in GDB Date: Tue, 26 Apr 2005 02:54:00 -0000 X-SW-Source: 2005-04/txt/msg00334.txt.bz2 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 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. 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. :-) 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? Above is only my initial thought. Any idea, advice or comments are highly appreciated. Cheers. - Wu Zhou