This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Static variables incorrect address
- From: "Eli Zaretskii" <eliz at is dot elta dot co dot il>
- To: kiranmaye dot gannabathula at powervr dot com
- Cc: gdb at sources dot redhat dot com
- Date: Thu, 21 Mar 2002 21:30:24 +0200
- Subject: Re: Static variables incorrect address
- References: <E821125BE8B4D5119E7E00A0C94BF0AD2158A6@smtp1.videologic.co.uk>
- Reply-to: Eli Zaretskii <eliz at is dot elta dot co dot il>
> 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?