This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: execution does not run in the source line's order
- From: Eli Zaretskii <eliz at gnu dot org>
- To: rivers horse <horserivers at gmail dot com>
- Cc: gdb at sourceware dot org
- Date: Sat, 11 Aug 2012 09:30:39 +0300
- Subject: Re: execution does not run in the source line's order
- References: <CAJR88piT=nkuG_M6Us+jWNiDEqSxOGFxKPnSBHzio+byyuSUfw@mail.gmail.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Sat, 11 Aug 2012 11:14:41 +0800
> From: rivers horse <horserivers@gmail.com>
>
> I debug gdb using itself, i find a strange issue :
> the programme being debugged execute not in line
> order,for example, it goes into line 20,then it goes into line 18 ,
> which are simply assignment operations,
>
> what is the reasin for this?
Compiler optimizations are known to reorder code, if doing so cannot
affect the result. If your GDB is compiled with optimizations, that's
the reason.