Debugging on h8/300
Ralf Gütlein
ralf.guetlein@aranea.de
Thu Sep 21 02:05:00 GMT 2000
----- Original Message -----
From: RakeshN <rakeshn@kpit.com>
> Hello,
>
> I am using gdb to debug a small program......
>
> Prog Name:test.c
>
> int main()
> {
> int a,d;
>
> a=1;
> a=a+3;
>
> }
>
(...)
>
> When i print the value of 'a' using print /x a
> the value is
>
> $1 = 0x0
>
> Why so? since i have assigned a to 1.
With optimizations switched on (-O2 is default) assignments
to automatic variables are eliminated when possible (that is,
when the automatics are not used as rvalues.
Either switch optimizations off (-O0) or make the variables static:
int a;
int main()
{
a=1;
a=a+3;
}
>
> Thanks for any help
Regards,
Ralf
.....
ô ô )
-----oOOo--(_)---oOOo------
Ralf Guetlein
Biotest Medizintechnik GmbH
Industriestrasse 19
D-63755 Alzenau
Germany
---------------------------
Tel. +49 6023 9487-42
Fax. +49 6023 9487-33
ralf.guetlein@biotest-mt.de
---------------------------
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
More information about the crossgcc
mailing list