This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

sizeof evaluates expression to compute size?


Hi,

  Is it true that gdb evaluates the expression in a "print sizeof(expression)" 
  to figure out the size?
  
  For one expression on the ARM target 

     print sizeof((char*)(s->m)

  where s is a struct and m is a fixed length char array member)), gdb even 
  tries to allocate memory in the inferior (through an injected malloc call) to
  compute the size.

  Am I missing something? Is there a reason why gdb does this? Surely it
  should be able to compute the type (and hence the size) statically?

Regards
Senthil


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]