This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Re: Why GCC/ GDB ignore a normal C statement?
- From: "D.Venkatasubramanian, Noida" <dvenkat at noida dot hcltech dot com>
- To: Huaxia Zhao <delzhao_linux at yahoo dot com>
- Cc: gdb at sources dot redhat dot com
- Date: 06 May 2003 14:32:40 +0530
- Subject: Re: Why GCC/ GDB ignore a normal C statement?
- References: <20030505113250.55949.qmail@web20709.mail.yahoo.com>
Hi,
Did you use some optimization during compilation. If yes, then that
could be the problem. Optimization should be used only for the final
release. This is a common mistake made by new users.
Venky
On Mon, 2003-05-05 at 17:02, Huaxia Zhao wrote:
> Hi:
>
> As a beginner of linux programming, I am learning to
> recompile and rebuild my previous programs in Linux
> with GCC/GDB. However, there is something really
> annoying me. The code is showed as :
>
> if ( ( d_z - current ) < MIN_ERROR && ( d_z - current
> ) > -MIN_ERROR)
> {
> d_z += dz_inc;
> mp += mstep_k;
> i_cz += step_k;
> offset+= mstep_k;
> }
> some graphical front-ends of GDB like GVD show that
> the statement
>
> i_cz +=step_k;
>
> is NOT recongnised as a statement. The GDB just
> simpily ignores it when stepping to there. This
> means the varible i_cz,which is declared as a register
> int varible, has not updated after executing. The
> contexts work well and this part of code runs
> perfectlly when compiled with VC in Windows.
>
> Could someone give me an idea about this problem? I
> would be very grateful...
>
> Frank Zhao
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com