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: size of non local variables


On Tue, 1 Dec 2009, ranjith kumar wrote:

Hi,
I know that gdb will print non local variable names and file name in
which they are defined ,
when we run 'info variables' command.

Is it possible to print the size of the non local varibles also?
like the size of 'int global[100]' is 400bytes ...like that????

thanks in advance.

Hello Ranjith Kumar,


You could do:

(gdb) print sizeof(global)
$1 = 400

--

- that's an instance of GDB's functionality to evaluate expressions in the source language with the 'print' command.

See 'Examining Data' in the User Manual: http://sourceware.org/gdb/current/onlinedocs/gdb/Data.html#Data

Best Regards,
Anmol.


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