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]

Re: sizeof evaluates expression to compute size?


>   Is it true that gdb evaluates the expression in a "print
>   sizeof(expression)" to figure out the size?

Yes; it actually evaluates the entire expression (including the use
of the sizeof operator).

>   For one expression on the ARM target 
> 
>      print sizeof((char*)(s->m)

The expression is incomplete; but with the expression you gave and
assuming we're just missing a closing parenthesis, I don't see why
it would need to allocate memory in the inferior. Perhaps you've found
a bug.

-- 
Joel


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