This is the mail archive of the gdb@sources.redhat.com 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: [discuss] Support for reverse-execution


On Fri, May 20, 2005 at 05:37:17PM +0300, Eli Zaretskii wrote:
> That's an interesting subtle point.  At first I wanted to say "the
> former", but then I remembered the issue with moving a word forward
> and backward in editors.  With some editors, such as Emacs,
> forward-word ends up one character _before_ the beginning of the next
> word, while backward-word ends up on the first character of the
> previous word.  Other editors end up on the first character of a word
> with either forward or backward movement.

More precisely, emacs' forward-word appears to put your cursor at the
end of the current word, unless it was already there, in which case you
go to the end of the next word.  Similarly previous-word takes you to
the beginning of the current word, unless you're already there.

[The difference from what Eli wrote is purely pedantic - try it with
multiple spaces between words.  Not an issue for us :-)]

> So it could make sense for GDB to stop at the _last_ instruction of
> the previous source line when we move backwards by lines.  The
> question is, will this be useful for the user.  I'm not sure; perhaps
> they will want to skip all the code of the line and stop before its
> first instrcution, like "next" does.

Even the Emacs idea would work: back to the beginning of this source
line.  I think that beginning of the previous source line will be the
most generally useful; the beginning of source lines is a more useful
place for the debugger to go than the end, because the interface is
much more apparent that the line "really" hasn't been execute yet.

In any case, this is a subtle point - let's flag this subthread and
make sure we write it down!  And test it, if possible! :-)

-- 
Daniel Jacobowitz
CodeSourcery, LLC


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