Static variables incorrect address
Eli Zaretskii
eliz@is.elta.co.il
Thu Mar 21 11:34:00 GMT 2002
> From: Kiranmaye Gannabathula <kiranmaye.gannabathula@powervr.com>
> Date: Thu, 21 Mar 2002 17:18:43 -0000
>
> static int Data = 9;
>
> int Func1(void)
> {
> return Data;
> }
>
> if i compile this with debug info and run it under gdb, when i breakpoint on
> the variable Data and try to print its value i get some value and
> if i look at the address
> p /x Data
> i get some invalid address.
I'm sorry, from your description I cannot figure out exactly what
happened. Please post a complete GDB session showing the commands you
typed and what GDB printed in response.
Also, what version of GDB is that, and on what platforms?
More information about the Gdb
mailing list