Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 205793

Summary: Step into selection should also work if no selection
Product: [Eclipse Project] JDT Reporter: Jerome Lanneluc <jerome_lanneluc>
Component: DebugAssignee: JDT-Debug-Inbox <jdt-debug-inbox>
Status: CLOSED WONTFIX QA Contact:
Severity: normal    
Priority: P3 CC: markus.kell.r
Version: 3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard: stalebug

Description Jerome Lanneluc CLA 2007-10-09 05:48:51 EDT
I20071002-1342

Step into selection now steps into the first message send if the cursor is as the beginning of the line, which is great. But it would be even better if it would step into the first message send of the debugged line even if the cursor is on another line, i.e. consider that the cursor is at the beginning of the line if it is not on the debugged line.

E.g.

void foo() {
  bar(); // line being debugged (highlighted)
<|>
}

Ctrl+F5 should step into bar().
Comment 1 Markus Keller CLA 2007-10-18 13:41:13 EDT
Hm, sounds a bit daring, since 'Step Into Selection' also steps into the selection if it is on another line than the current instruction pointer.

E.g. here, putting the caret to the beginning of the bar() line and pressing Ctrl+F5 steps into the next method bar(), and not into foo() on the debug-highlighted line with the breakpoint:

public static void main(String[] args) {
	foo(); // breakpoint

	bar();
}

With your proposal, 'Step Into Selection' can jump into unexpected methods when the caret is e.g. not at the beginning of the line but just before bar() (because an off-by-1 selection can make a huge difference then).

Do you just want this because you'd like to click anywhere in the editor to activate it and then step into the outermost method on the instruction pointer line? If that's the only reason, then I would suggest bug 206797 as a better solution (but maybe I missed your real use case).
Comment 2 Jerome Lanneluc CLA 2007-10-19 05:27:23 EDT
(In reply to comment #1)
Right, I was proposing that step into selection would not step in bar() if the cursor is on bar() but the debugged line is foo().

Comment 3 Markus Keller CLA 2007-10-19 05:41:11 EDT
> Right, I was proposing that step into selection would not step in bar() if the
> cursor is on bar() but the debugged line is foo().

But that behavior can't be called 'Step Into Selection' anymore. It's more like 'Step Into Current Instruction Pointer Line', which I would find very hard to understand.
Comment 4 Michael Rennie CLA 2007-10-23 14:39:18 EDT
It feels like we touched on some of these issues on bug 79529 (comments 12 through 14).

I agree with Markus that it could be very confusing, especially if we are now considering the current instruction pointer as well when 'stepping into selection' (unless I am missing something as well :) )
Comment 5 Eclipse Genie CLA 2020-04-28 19:12:59 EDT
This bug hasn't had any activity in quite some time. Maybe the problem got resolved, was a duplicate of something else, or became less pressing for some reason - or maybe it's still relevant but just hasn't been looked at yet. As such, we're closing this bug.

If you have further information on the current state of the bug, please add it and reopen this bug. The information can be, for example, that the problem still occurs, that you still want the feature, that more information is needed, or that the bug is (for whatever reason) no longer relevant.

--
The automated Eclipse Genie.