From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14302 invoked by alias); 21 Nov 2003 16:06:51 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 14295 invoked from network); 21 Nov 2003 16:06:50 -0000 Received: from unknown (HELO mx1.redhat.com) (66.187.233.31) by sources.redhat.com with SMTP; 21 Nov 2003 16:06:50 -0000 Received: from int-mx1.corp.redhat.com (int-mx1.corp.redhat.com [172.16.52.254]) by mx1.redhat.com (8.11.6/8.11.6) with ESMTP id hALG6nH00987 for ; Fri, 21 Nov 2003 11:06:49 -0500 Received: from pobox.corp.redhat.com (pobox.corp.redhat.com [172.16.52.156]) by int-mx1.corp.redhat.com (8.11.6/8.11.6) with ESMTP id hALG6nw20516; Fri, 21 Nov 2003 11:06:49 -0500 Received: from deneb.localdomain (msalter.cipe.redhat.com [10.0.0.36]) by pobox.corp.redhat.com (8.12.8/8.12.8) with ESMTP id hALG6nHT029455; Fri, 21 Nov 2003 11:06:49 -0500 Received: by deneb.localdomain (Postfix, from userid 500) id E3FC97879F; Fri, 21 Nov 2003 11:06:48 -0500 (EST) From: Mark Salter To: manojv@noida.hcltech.com Cc: gdb@sources.redhat.com In-reply-to: <1B3885BC15C7024C845AAC78314766C501033536@EXCH-01> (manojv@noida.hcltech.com) Subject: Re: remote debugging packets References: <1B3885BC15C7024C845AAC78314766C501033536@EXCH-01> Message-Id: <20031121160648.E3FC97879F@deneb.localdomain> Date: Fri, 21 Nov 2003 16:06:00 -0000 X-SW-Source: 2003-11/txt/msg00197.txt.bz2 >>>>> Manoj Verma, Noida writes: > Let me explain my concern in this way... > I have following C snippet: > ... > for(i=0; i<100; i++) // say line #xx > *b0++ = *b1++; // say line #yy > ... > and the assembly instruction corresponding to it is: > ... > lc = 100; > rep(lc) *b0++ = *b1++; > ... > I set the breakpoint to both of these lines xx & yy. > Now when I am at XX, I say 'Continue'. If it steps first then it comes to > line #yy. Then if it continues, then I will not see my program stopping at > YY where it should. > Or is it like, before proceeding from line #YY the debugger looks for some > traps present at that particular line and then continues.. > Pl. correct me if I am wrong. If compiler optimization causes the loop to be executed as a single machine instruction (as in your example), then there is nothing GDB can do about it. GDB's behavior would be to stop after the loop finishes because the loop is actually one machine instruction. This seems reasonable to me. --Mark