This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: GDB watching and printing variables content problem
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: "Teresa Fazio" <fazio at planetek dot it>
- Cc: ecos-discuss at sources dot redhat dot com
- Date: 24 Jul 2003 17:43:31 +0100
- Subject: Re: [ECOS] GDB watching and printing variables content problem
- References: <3F200644.32339.6D9E61F8@localhost>
"Teresa Fazio" <fazio@planetek.it> writes:
> Hi,
> did you never have problem watching and printing variables content (wrong values)
> while debugging in GDB?
>
> I found info regarding problem using compilation option "-O" and "-g" together.
> What do you think about?
>
> Target V850-elf
> Ecos version 0.98
> GNU gdb 5.2
>
This is a know problem. If gcc optimizes the code then it may decide
to eliminate some variables altogether. Other variables may only be
live during a small section of a function, not necessarily across
their entire scope. If you want variables to behave themselves during
debugging, do not optimize.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss