From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9810 invoked by alias); 22 Mar 2007 09:04:40 -0000 Received: (qmail 9798 invoked by uid 22791); 22 Mar 2007 09:04:37 -0000 X-Spam-Check-By: sourceware.org Received: from smtp103.biz.mail.mud.yahoo.com (HELO smtp103.biz.mail.mud.yahoo.com) (68.142.200.238) by sourceware.org (qpsmtpd/0.31) with SMTP; Thu, 22 Mar 2007 09:04:35 +0000 Received: (qmail 98375 invoked from network); 22 Mar 2007 09:04:32 -0000 Received: from unknown (HELO ?192.168.1.126?) (wenbo.yang@simplnano.com@211.101.21.42 with plain) by smtp103.biz.mail.mud.yahoo.com with SMTP; 22 Mar 2007 09:04:28 -0000 X-YMail-OSG: 1saHpuwVM1m7qPW6RYZgX.zKHs94V1pHj21g2bw6yUFAzYs4Q6vhTSgUoHPu6UG4NxnJh6Kn4yF4OoaPifmwel17u.QLr6X2jtSUmO6XI1mC59LVyexQMA-- Message-ID: <4602467E.3000703@simplnano.com> Date: Thu, 22 Mar 2007 09:04:00 -0000 From: Wenbo Yang User-Agent: Thunderbird 1.5.0.10 (X11/20070307) MIME-Version: 1.0 To: qinwei@sunnorth.com.cn CC: gdb@sourceware.org Subject: Re: GDB infinite loop when stepping on "while (1) i++;" References: <46024522.7090007@simplnano.com> In-Reply-To: <46024522.7090007@simplnano.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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/msg00264.txt.bz2 >> (gdb) n >> 4 while (1) i++; >> (gdb) n > > I think there is nothing wrong. You let GDB next, it next. And your > line is a infinite loop, so it never stops. > > If "while (1) i++;" in you source code is put in a line. I think the > debugging information should be a line. If not, maybe you compiler has > problems. It is different with a single line function, i.e. "int a() {}". > > If you want to step into, why not use "step"? I'm sorry. Step should not work too. I mean "stepi". :-) Wenbo -- Wenbo Yang SimpLight Nanoelectronics Ltd.