Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Re: about how to add support to new c++ compiler in GDB
@ 2005-04-28  6:34 woodzltc
  0 siblings, 0 replies; 10+ messages in thread
From: woodzltc @ 2005-04-28  6:34 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

> You can find the patch, against current CVS GDB, at:
>   http://return.false.org/~drow/gdb/combined-rvct-patches.diff

Got it, a really huge one. :-)

> You should give these a try with xlc++ and see if they help.  If not,
> we'll need to discuss the differences in xlc output.
> 

I just had a try. And it did help. No SEGV error any more. Followed is the
summary report against xlc++(I only run the testcases under gdb.cp directory):

# of expected passes            1514
# of unexpected failures        264
# of unexpected successes       1
# of known failures             29
# of unresolved testcases       2

I had some look at these failure report. Quite a lot of them are contributed by
"__vfp", which is the same as "_vptr.CLASSNAME". GDB treat it as a normal class
member. The debuginfo for "__vfp" is like this:

 <2><36a>: Abbrev Number: 17 (DW_TAG_member)
     DW_AT_name        : __vfp  
     DW_AT_accessibility: 1     (public)
     DW_AT_artificial  : 1      
     DW_AT_data_member_location: 2 byte block: 23 0     (DW_OP_plus_uconst: 0)
     DW_AT_type        : <348> 

 <1><348>: Abbrev Number: 10 (DW_TAG_pointer_type)
     DW_AT_address_class: 0     
     DW_AT_type        : <30c>  

 <1><30c>: Abbrev Number: 16 (DW_TAG_union_type)
     DW_AT_sibling     : <348>
     DW_AT_name        : __vftTypeGCCV3
     DW_AT_byte_size   : 4
     DW_AT_artificial  : 1
 <2><322>: Abbrev Number: 17 (DW_TAG_member)
     DW_AT_name        : __faddr
     DW_AT_accessibility: 1     (public)
     DW_AT_artificial  : 1
     DW_AT_data_member_location: 2 byte block: 23 0     (DW_OP_plus_uconst: 0)
     DW_AT_type        : <2ff>
 <2><334>: Abbrev Number: 17 (DW_TAG_member)
     DW_AT_name        : __offset
     DW_AT_accessibility: 1     (public)
     DW_AT_artificial  : 1
     DW_AT_data_member_location: 2 byte block: 23 0     (DW_OP_plus_uconst: 0)
     DW_AT_type        : <305>  

with which GDB will interpret as: 
  __vftTypeGCCV3 *__vfp;

Would you like to have a look at gdb.log. I could post that if you prefer. 

Thanks

- Wu Zhou


^ permalink raw reply	[flat|nested] 10+ messages in thread
* Re: about how to add support to new c++ compiler in GDB
@ 2005-05-09 12:42 Wu Zhou
  0 siblings, 0 replies; 10+ messages in thread
From: Wu Zhou @ 2005-05-09 12:42 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

Hi Daniel,

Thanks a lot for your kind consideration.  A week passed.  Did you have any
plan to look into these questions in a near future?  

P.S: I am not trying to be annoying,  just curious to know whether you have 
any plan on this. Thanks.  

- Wu Zhou

Quoting Daniel Jacobowitz <drow@false.org>:

> On Fri, Apr 29, 2005 at 03:27:49PM +0800, Wu Zhou wrote:
> > > BTW. I had verify your patch, It did worked. No SEGV error any more.
> > > Althought there are still some error, most of them should be XLC specific
> > I
> > > believe. I could work with XLC guys to improve them.
> > 
> > Daniel, after playing with your patch for some more time, I had the
> > following questions. Would you please answer these? Thanks a lot!
> 
> I am afraid that I'm not going to have time to answer these questions
> for a while :-(  I'll get back to you about them, but I wanted to let
> you know that I did see them.  I'll have to dig my head back into this
> code to answer them.
> 
> 
> -- 
> Daniel Jacobowitz
> CodeSourcery, LLC
> 
> 


Cheers
- Wu Zhou


^ permalink raw reply	[flat|nested] 10+ messages in thread
* about how to add support to new c++ compiler in GDB
@ 2005-04-26  2:54 Wu Zhou
  2005-04-26  3:18 ` Daniel Jacobowitz
  0 siblings, 1 reply; 10+ messages in thread
From: Wu Zhou @ 2005-04-26  2:54 UTC (permalink / raw)
  To: drow, gdb-patches; +Cc: gilliam, manjo

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




^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2005-05-09  6:28 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-04-28  6:34 about how to add support to new c++ compiler in GDB woodzltc
  -- strict thread matches above, loose matches on Subject: below --
2005-05-09 12:42 Wu Zhou
2005-04-26  2:54 Wu Zhou
2005-04-26  3:18 ` Daniel Jacobowitz
2005-04-26  9:53   ` Wu Zhou
2005-04-26 13:20     ` Daniel Jacobowitz
2005-04-27 20:09   ` Daniel Jacobowitz
     [not found]     ` <019101c54bc9$20360cd0$4186b509@ibmcsdl9m89c83>
     [not found]       ` <20050428131902.GB29277@nevyn.them.org>
2005-04-29  2:37         ` Wu Zhou
2005-04-29  7:28           ` Wu Zhou
2005-04-29 13:10             ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox