This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: sizeof evaluates expression to compute size?
- From: Joel Brobecker <brobecker at adacore dot com>
- To: Senthil Kumar Selvaraj <senthil_kumar dot selvaraj at atmel dot com>
- Cc: gdb at sourceware dot org
- Date: Wed, 16 Sep 2015 07:56:32 -0700
- Subject: Re: sizeof evaluates expression to compute size?
- Authentication-results: sourceware.org; auth=none
- References: <20150916144109 dot GB14658 at jaguar dot corp dot atmel dot com>
> 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