From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20425 invoked by alias); 22 Mar 2007 09:15:36 -0000 Received: (qmail 20416 invoked by uid 22791); 22 Mar 2007 09:15:35 -0000 X-Spam-Check-By: sourceware.org Received: from mail.sunnorth.com.cn (HELO mswbj01.sunnorth.com.cn) (124.42.0.200) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 22 Mar 2007 09:15:34 +0000 Received: from maillog.sunnorth.com.cn (unverified [172.20.10.250]) by mswbj01.sunnorth.com.cn (Clearswift SMTPRS 5.2.5) with ESMTP id for ; Thu, 22 Mar 2007 17:15:23 +0800 Received: from ntns1cn.sunnorth.com.cn (ntns1cn.sunnorth.com.cn [172.20.10.252]) by maillog.sunnorth.com.cn (8.12.10/8.12.10) with ESMTP id l2MB7oO6014961 for ; Thu, 22 Mar 2007 19:07:50 +0800 In-Reply-To: <1174552530.5491.4.camel@localhost> To: gdb@sourceware.org Subject: Re: GDB infinite loop when stepping on "while (1) i++;" MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5 September 26, 2003 Message-ID: From: qinwei Date: Thu, 22 Mar 2007 09:15:00 -0000 Content-Type: text/plain; charset="US-ASCII" 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: 2007-03/txt/msg00265.txt.bz2 > > When program stops at "while (1) i++;", and printing "next" command will > > cause gdb infinite loop. > > The target are x86, score, or other? (gdb-6.6 release version) > > > > Is the reason that the following dwarf-2 info: > > > > "Special opcode 104: advance Address by 7 to 0x8048357 and Line by 1 to > > 4" > > "Advance PC by 7 to 804835e" > > > > which makes "while (1)" and "i++;" the same line number? And gdb will get > > "stop_pc" from the range [0x8048357, 0x804835e] and will not stop? > > Yes. The command `next' is used to move to advance execution to the next > line of the current function. Thanks!