Bug 36914 - Pgm stopping because of a breakpoint or exception should cancel "Run to Line" action
Summary: Pgm stopping because of a breakpoint or exception should cancel "Run to Line"...
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: Debug (show other bugs)
Version: 2.1   Edit
Hardware: PC Windows XP
: P3 normal with 1 vote (vote)
Target Milestone: 3.1 M5   Edit
Assignee: Darin Swanson CLA
QA Contact:
URL:
Whiteboard:
Keywords:
: 51507 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-04-25 11:38 EDT by Alan Boxall CLA
Modified: 2005-01-26 14:07 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Boxall CLA 2003-04-25 11:38:43 EDT
According to the online help:

"Breakpoints and exceptions can cause the thread to suspend before reaching 
the specified line."

What really happens is that the "Run to Line" internal breakpoint is left 
enabled and at sometime later the program might stop at the "Run to Line" 
location.

This is potentially confusing to the user since they will stop on a line that 
has no breakpoint icon and they would have to look at the status of the thread 
to determine why it stopped.

More important, is that this behaviour is different from many other 
debuggers.   The "Run to Line" action is considered an immediate request 
similar to a "Step over".  If a "Step over" is interrupted by a breakpoint (in 
the called method) then the step over is cancelled.   The user doesn't expect 
to stop at the original target location of the step over.

In summary, Run to Line should be cancelled either when the program stops on 
the target location of the run to line or if the program stops for some other 
reason like a user breakpoint or exception as the help points out.
Comment 1 Darin Wright CLA 2004-04-23 11:57:20 EDT
note that a preference now exists to "skip breakpoints for run to line". It is 
off by default for backwards compatibility. However, we could still update our 
run to line target to delete the run-to-line breakpoint when a non-run-to-line 
breakpoint is encountered.
Comment 2 Alan Boxall CLA 2004-04-27 09:31:15 EDT
On the topic of ignoring breakpoints on run to line, I have had a request to 
do the same for step over and step return.

I was thinking about the "step filtering".   It would be possible to add an 
entry in the list of things to filter... "Breakpoints" 
Comment 3 Darin Wright CLA 2004-05-03 09:08:36 EDT
Please enter a new feature reqest for skipping breakpoints while stepping (not 
likely to happen in 3.0).
Comment 4 Darin Wright CLA 2004-05-10 11:55:16 EDT
*** Bug 51507 has been marked as a duplicate of this bug. ***
Comment 5 Darin Wright CLA 2004-05-17 12:44:19 EDT
Deferred
Comment 6 Darin Wright CLA 2004-12-14 15:56:56 EST
open for 3.1
Comment 7 Darin Wright CLA 2005-01-05 17:14:10 EST
Fixed in RunToLineHandler and RunToLineAdapter.
Comment 8 Darin Wright CLA 2005-01-05 17:14:26 EST
please verify, Darin (S).
Comment 9 Darin Swanson CLA 2005-01-05 23:46:30 EST
Verified and fixed that the AntLineBreakpoint created for the Ant run to line 
is not registered with the BreakpointManager so it correctly follows the Java 
debugger example. Changes to the Ant RunToLineAdapter.
Comment 10 C. Lamont Gilbert CLA 2005-01-25 14:01:25 EST
I disagree that the Run-To-Line should be cancelled.  I don't like any 
automatic/ hidden actions to occur when I am debugging.  I believe that most of 
the time when run-to-line is executed but stops before it reaches that line, 
its because the user forgot to remove an old breakpoint.  If you cancel the run-
to-line breakpoint, you could force the user to start their whole debugging 
procedure over.

I think the preferred method would be to have a "temporary breakpoint" icon.  
It should be removed when the debugging session is ended, or when the 
breakpoint is reached and subsequently passed, but not sooner. It can simply be 
a regular icon but it blinks.  Again it will disappear when you leave the line, 
but not until it has been reached and stopped on at least once.

Plus the option in preferrences.  But for those who dont want this automatic 
skipping, it would be best to have a new icon.  
Comment 11 Alan Boxall CLA 2005-01-25 17:06:14 EST
I think of RuntoLine as a single action.  If anything interrupts it, the 
action is complete.

If the user really needs to get to a line then they should add a breakpoint.

In fact I have used run to line knowing that it might stop at a breakpoint 
because I want the code to run but not go any further than the run to line 
location.   If it hits the breakpoint then I start my work there. 

I don't want the program to later stop at the run to line location because I 
may not remember why it hit that line.

Not sure I like the idea of a temporary breakpoint.  There are already so many 
things being displayed in the ruler bar that they overlap and I can't tell 
what they are.
Comment 12 C. Lamont Gilbert CLA 2005-01-26 14:07:44 EST
Perhaps my perspective is wrong, and I am actually thinking about "skip" to
line.  When you say "Run" to line, perhaps it is proper to stop at any existing
breakpoints.  However, we can't forget about the "to line."  I don't think we
should discard the notion of stopping at the line as commanded.

Instead of having a special temporary breakpoint, we could have a status icon
somewhere indicating that a RTL command is still active.  It could blink or turn
grey when the line is reached and the RTL command is completed.  Also if you
click on it you can cancel the active RTL command.  I do like the notion of
simply indicating to the user what is taking place, rather than discarding his
command.

Alternately we can add "skip (breakpoints) to line"