Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* sizeof evaluates expression to compute size?
@ 2015-09-16 14:41 Senthil Kumar Selvaraj
  2015-09-16 14:56 ` Joel Brobecker
  0 siblings, 1 reply; 4+ messages in thread
From: Senthil Kumar Selvaraj @ 2015-09-16 14:41 UTC (permalink / raw)
  To: gdb

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


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

end of thread, other threads:[~2015-09-17 14:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-16 14:41 sizeof evaluates expression to compute size? Senthil Kumar Selvaraj
2015-09-16 14:56 ` Joel Brobecker
2015-09-17 14:10   ` Senthil Kumar Selvaraj
2015-09-17 14:19     ` Joel Brobecker

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