Please use the Apache issue tracking system for new NetBeans issues (https://issues.apache.org/jira/projects/NETBEANS0/issues) !!
Bug 165657 - [67cat] Method return value not displayed by "normal" step through
[67cat] Method return value not displayed by "normal" step through
Status: NEW
Product: debugger
Classification: Unclassified
Component: Code
6.x
PC Windows XP
: P3 with 4 votes (vote)
: 6.x
Assigned To: issues@debugger
issues@debugger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-20 22:11 UTC by ulfzibis
Modified: 2009-05-22 16:58 UTC (History)
0 users

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ulfzibis 2009-05-20 22:11:38 UTC
[ BUILD # : 200905160201 ]
[ JDK VERSION : 1.6.* ]

If stepping through a method by "Step over" until it returns to the
caller, the return value is not displayed.
I think this is unnecessarily annoying, that user has to use "Step
out" on the last statement of a method to get the return value
displayed.
I think, it should also automatically be displayed when using "Step
over".
Comment 1 Martin Entlicher 2009-05-21 09:17:40 UTC
This can not be a defect, it's a missing functionality, that can be requested as an enhancement.
The problem with this is implementation. We have no access to stack content (requested from JDK, but it's not going to
be implemented) and I do not want to add the overhead with method exit breakpoint (which is submitted in step out to get
the return value) to every step. Method exit breakpoint can be hit too many times, ironically, there's no way to
restrict it to a particular method.
Due to these facts, this will not be implemented anytime soon.
Comment 2 ulfzibis 2009-05-21 19:38:46 UTC
But can't you check the source line where debuggers step cursor (green arrow) is pointing to, and if there is a
"return", just execute "Step out", even if "Step over" is invoked from user?

Anyway, isn't it ugly to show "After return from ..." item in Variables window, if there is no value? Maybe it should be
suppressed in such case.

Is there a JDK Bug ID about this? I like to vote on it?

Comment 3 matthies 2009-05-22 16:58:57 UTC
I agree with Ulf. If the breakpoint overhead is okay for "step out", I don't see why it shouldn't be okay for "step 
over". Or if it is a problem, let the user decide by providing an additional "step over with return value".

One thing that probably needs to be considered with the breakpoint solution is recursive calls. If the breakpoint is 
set before the call which is being "stepped over", it needs to be conditional on the stack depth, so that it doesn't 
trigger on a nested call to the same method.

A whole different solution on the JDK level would be for the compiler to have an option to create hidden local 
variables for intermediate results so that debuggers can inspect them. Of course that's a less attractive solution, and 
likely problematic for expressions in static initializers and argument expressions to this() and super(). A true JVM-
based solution would certainly be better.


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo