This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Getting pissed off by gdb. Please help with stepping in.


Mark Kettenis <mark.kettenis@xs4all.nl> wrote:

> > Date: Thu, 18 Mar 2010 21:38:18 +0200
> > From: Eli Zaretskii <eliz@gnu.org>
> > 
> > > From: Pedro Alves <pedro@codesourcery.com>
> > > 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]