Re: Brain fart alert

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Aug 16, 2012 at 04:52:24PM -0300, Arnaldo Carvalho de Melo wrote:
> Em Wed, Aug 15, 2012 at 02:56:47PM -0300, Arnaldo Carvalho de Melo escreveu:
> > Em Sat, Jul 21, 2012 at 08:22:33PM +0200, Nicolas escreveu:
> So the problem is that 'in' is (from the .cpp file):
> 
> static const _Ios_Openmode in = _S_in;
> 
>  <2><82>: Abbrev Number: 10 (DW_TAG_member)
>     <83>   DW_AT_name        : in       
>     <86>   DW_AT_decl_file   : 1        
>     <87>   DW_AT_decl_line   : 15       
>     <88>   DW_AT_type        : <0x9b>   
>     <8c>   DW_AT_external    : 1        
>     <8d>   DW_AT_declaration : 1        
>     <8e>   DW_AT_const_value : 8

Although I cannot find it said explicitly in the DWARF spec I think
you can assume that any member with a const_value (and without a
data_member_location) doesn't occupy space.

> I need to capture the fact that it is a static const, and investigate
> the C++ structure encoding rules, why is that it takes 1 byte when it
> has no per instance members?

That is by definition in C++, in C it is a GNU extension to allow empty
structs. Depending on whether you compile an empty struct with gcc or g++
it will have a size on zero or one.
http://gcc.gnu.org/onlinedocs/gcc/Empty-Structures.html

Cheers,

Mark
--
To unsubscribe from this list: send the line "unsubscribe dwarves" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux