[RFA] Support for multiple calling conventions, patch 1/3: Add calling convention to struct type

Daniel Jacobowitz drow@false.org
Thu Apr 17 16:28:00 GMT 2008


On Tue, Apr 15, 2008 at 01:51:38PM +0200, Corinna Vinschen wrote:
> The result looks like this:
> 
>   ftype->calling_convention == 0
>   
>     if no debug information is available for the function or if the
>     debug information is not given as dwarf2.
> 
>   ftype->calling_convention == DW_CC_normal
>   
>     if dwarf2 debug information is available for the function but no
>     DW_AT_calling_convention attribute has been given for the function.
> 
>   ftype->calling_convention == DW_UNSND(DW_AT_calling_convention)
> 
>     if dwarf2 debug information is available for the function and the
>     DW_AT_calling_convention attribute has been specified.

This part looks generally fine.  My only complaint is the size
and placement of the new field.  struct type is a hefty portion
of GDB's memory usage.

For a first optimization, it can go in main_type instead.  Then
there won't be an extra copy for every const or volatile type
variant.  For a second optimization, it's only for TYPE_CODE_FUNC - so
I think it will fit in union type_specific.

Assuming that's right, changed version is OK.

-- 
Daniel Jacobowitz
CodeSourcery



More information about the Gdb-patches mailing list