From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7426 invoked by alias); 21 Dec 2007 13:24:11 -0000 Received: (qmail 7417 invoked by uid 22791); 21 Dec 2007 13:24:10 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 21 Dec 2007 13:24:04 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 0385A98243; Fri, 21 Dec 2007 13:24:03 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id CFD5898236; Fri, 21 Dec 2007 13:24:02 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.68) (envelope-from ) id 1J5hr7-0005ru-WF; Fri, 21 Dec 2007 08:24:02 -0500 Date: Fri, 21 Dec 2007 14:01:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: gdb-patches@sourceware.org Subject: Re: [RFC/RFA] continue stepping if landed in new range of same line Message-ID: <20071221132401.GA22244@caradoc.them.org> Mail-Followup-To: Joel Brobecker , gdb-patches@sourceware.org References: <20071219075903.GA6184@adacore.com> <20071219141812.GA21072@caradoc.them.org> <20071220052617.GE6154@adacore.com> <20071220140023.GB7244@caradoc.them.org> <20071221060730.GM6184@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20071221060730.GM6184@adacore.com> User-Agent: Mutt/1.5.17 (2007-12-11) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-12/txt/msg00370.txt.bz2 On Fri, Dec 21, 2007 at 10:07:30AM +0400, Joel Brobecker wrote: > I am wondering what emacs would do with the following example: > > void increment (int *a, int *b) { *a = *a + 1; *b = *b + 1; } > > I wanted to try, but I must be missing something in my setup as > emacs doesn't indent either cases. You should just need to be in c-mode. Might need (c-toggle-auto-state 1) too (C-c C-a). void increment (int *a, int *b) { *a = *a + 1; *b = *b + 1; } (I was wrong about it being perfect; still, pretty good) > I think that the debugger would need the help of the compiler in order > to be able to do that. With the example above, I get the following code > on x86: Ideally we'd combine this with the is_stmt flag and column number support, and put a caret where we wanted. > Indeed, when I deactived the code that checks for the last line > in our function, here is the new behavior: > > (gdb) b *increment > Breakpoint 1 at 0x80483c0: file f.c, line 1. > (gdb) run > Starting program: /home/no-backup/brobecke/next/C/g > > Breakpoint 1, increment (a=0xbfd16d60, b=0xbfd16d5c) at f.c:1 > 1 void increment (int *a, int *b) { *a = *a + 1; *b = *b + 1; } > (gdb) n > main () at g.c:12 > 12 printf ("a = %d, b = %d\n", a, b); > > Before I disabled this code, GDB would stop at line f.c:1 one more > time before landing back in the caller. > > Perhaps if this is a requirement, we might want to add a testcase > for it in our testsuite. Optimization is not necessary in order > to reproduce this... Just for kicks, I ran the testsuite with > the disabled code, to see if anything would fail because of it, > and not unexpectedly, nothing did... To be honest, I find this behavior a bit surprising. -- Daniel Jacobowitz CodeSourcery