From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13824 invoked by alias); 18 Mar 2010 23:37:25 -0000 Received: (qmail 13816 invoked by uid 22791); 18 Mar 2010 23:37:25 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from tully.CS.Berkeley.EDU (HELO tully.CS.Berkeley.EDU) (128.32.153.206) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 18 Mar 2010 23:37:21 +0000 Received: from tully.CS.Berkeley.EDU (localhost [127.0.0.1]) by tully.CS.Berkeley.EDU (8.13.8+Sun/8.13.8) with ESMTP id o2INZbil003403; Thu, 18 Mar 2010 16:35:37 -0700 (PDT) To: Mark Kettenis cc: eliz@gnu.org, pedro@codesourcery.com, gdb@sourceware.org, dje@google.com, temp@sourceboost.com Subject: Re: Getting pissed off by gdb. Please help with stepping in. Reply-To: Hilfinger@CS.Berkeley.EDU In-reply-to: Your message of Thu, 18 Mar 2010 20:53:09 +0100. <201003181953.o2IJr9MV006009@glazunov.sibelius.xs4all.nl> Date: Thu, 18 Mar 2010 23:37:00 -0000 Message-ID: <3401.1268955336@tully.CS.Berkeley.EDU> From: Paul Hilfinger 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: 2010-03/txt/msg00159.txt.bz2 Mark Kettenis wrote: > > Date: Thu, 18 Mar 2010 21:38:18 +0200 > > From: Eli Zaretskii > > > > > From: Pedro Alves > > > Date: Thu, 18 Mar 2010 18:55:39 +0000 > > > Cc: dje@google.com, > > > temp@sourceboost.com > > > > > > Users often find this behaviour unexpected (I've often > > > wished GDB would behave like what the OP is suggesting too). > > > > Then why don't we change the behavior to match what users expect? > > Because different users expect different things. I for example would > be somewhat annoyed by having to issue an extra "step". And the > argument that this is what people that are familliar with Visual > Studio are used to is pretty weak. GDB users are used the GDB behaviour! I have to agree with Eli here. Yes, I suppose I am "used to" GDB behaviour, but there are two senses to this phrase: (1) "have become accustomed to and now prefer" and (2) "have learned to tolerate". After all, there is no contradiction between the two statements "I've gotten used to the howling blizzards that strike here every couple of days" and "I'd really appreciate a transfer to Maui." The problem is that usually, if you are on line L1, 'step' brings you to a line L2 that has some simple relationship with L1: it's (roughly) the next statement to be executed after L1 in the current function or the first statement to be executed in a function call at L1. If L1 is the end of a function, on the other hand, then L2 could be the first statement of any other function, and is in fact unpredictable from the text surrounding L1. Well, this isn't so bad if you got to L1 by a sequence of 'steps' starting at the call that directs you into L1's function, because in principle, you might be expected to retain some vague memory that you got to L1 from a call that would later take you to L2. But what if you landed in L1's function as a result of breakpoint? Yes, I know: judicious use of 'up' and 'down' or 'where' will reorient me. But that just means that I save one 'step' at the cost of issuing another, different, instruction. And as I think others have pointed out, the user who wishes to bounce back to the call statement must interpolate a 'finish' command at the right point in his sequence of 'step's, something I must confess I often manage to mess up. Paul Hilfinger