From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7773 invoked by alias); 11 Aug 2012 06:31:41 -0000 Received: (qmail 7764 invoked by uid 22791); 11 Aug 2012 06:31:40 -0000 X-SWARE-Spam-Status: No, hits=-4.2 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,SPF_SOFTFAIL X-Spam-Check-By: sourceware.org Received: from mtaout20.012.net.il (HELO mtaout20.012.net.il) (80.179.55.166) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Aug 2012 06:31:23 +0000 Received: from conversion-daemon.a-mtaout20.012.net.il by a-mtaout20.012.net.il (HyperSendmail v2007.08) id <0M8K00C00VE9ZC00@a-mtaout20.012.net.il> for gdb@sourceware.org; Sat, 11 Aug 2012 09:30:31 +0300 (IDT) Received: from HOME-C4E4A596F7 ([87.69.4.28]) by a-mtaout20.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M8K00C3JVEUSI40@a-mtaout20.012.net.il>; Sat, 11 Aug 2012 09:30:31 +0300 (IDT) Date: Sat, 11 Aug 2012 06:31:00 -0000 From: Eli Zaretskii Subject: Re: execution does not run in the source line's order In-reply-to: To: rivers horse Cc: gdb@sourceware.org Reply-to: Eli Zaretskii Message-id: <83y5lmc54g.fsf@gnu.org> MIME-version: 1.0 Content-type: text/plain; charset=gb2312 Content-transfer-encoding: 8BIT References: X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00035.txt.bz2 > Date: Sat, 11 Aug 2012 11:14:41 +0800 > From: rivers horse > > 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.