Bug 112358 - Make Value field in Local Variables writable
Make Value field in Local Variables writable
Status: NEW
Product: ruby
Classification: Unclassified
Component: Debugger
6.x
All All
: P1 with 1 vote (vote)
: 6.x
Assigned To: issues@ruby
issues@ruby
:
: 112357 116366 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2007-08-08 21:41 UTC by nmullerny
Modified: 2011-01-28 20:10 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nmullerny 2007-08-08 21:41:50 UTC
It should be possible to modify code while debugging, or run code in the context of your running application while
tracing the code. This is possible in Java, it would be very helpful to do this in Ruby as well.
Comment 1 Martin Krauskopf 2007-08-09 06:00:37 UTC
Yes, you are right, thanks for the report. In the meantime you might use workaround, that you will evaluate an
expression, i.e. add New Watch and put there e.g. "n = 20". Also there is similar RFE, issue 107761, you might add
yourself to the CC of the issue.
Comment 2 Martin Krauskopf 2007-08-09 12:44:40 UTC
*** Issue 112357 has been marked as a duplicate of this issue. ***
Comment 3 nmullerny 2007-08-10 10:41:55 UTC
Issue 112357 was a little different.
This issue is really intended to request the ability to execute code in the context of the running application while
debugging. IntelliJ gives me a dialog where I can write code to inspect or modify objects while at a breakpoint in a
debugging session.
I can also click on a field and change it's value, but that's a separate issue.
I know both of these CAN be implemented the same way through setting up a watch, but they're really separate features.
It would be nice if debugging would allow you to 
1) click on a variable to inspect or modify it's value
2) Execute code in an IRB like console, in the context of the running application, where you can see the stdout.
3) Modify the actual source code while the script is executing. For Ruby this shouldn't be a big deal, since it's
interpreted line by line. I could see how the debugger might have a hard time adapting to changing source on the fly,
but it would definately be handy.
Comment 4 Martin Krauskopf 2007-08-10 11:05:46 UTC
> Issue 112357 was a little different.

In the beginning it was the same. Same 'body' and same 'summary'. I though it was just accidentally submitted twice. But
to be sure we track all issues:

> 1) click on a variable to inspect or modify it's value

This feature is already implemented. Just hover the mouse for a while above some variable in the editor and tooltip
should come with the value of variable/expression under the cursor. You can also select some text in the editor, e.g
select _(1+2)*3_, point mouse above the selection and tooltip should appear with text "(1+2)*3 = 9".

See this screenshot:
  http://wiki.netbeans.org/wiki/view/RubyDebugging#section-RubyDebugging-RHTMLDebuggingScreenshot

> 2) Execute code in an IRB like console, in the context of the running application, where you can see the stdout.

Yes. This is tracked under issue 107761. You might add yourself to the CC in the issue to be notified about changes. We
are after feature-freeze, so will be targeted in the after 6.0 time frame.

> 3) Modify the actual source code while the script is executing. For Ruby this shouldn't be a big deal, since it's
> interpreted line by line. I could see how the debugger might have a hard time adapting to changing source on the fly,
> but it would definately be handy.

Definitely true. I thought that this is tracked somewhere, but did not find it. I've filed new issue 112534.

And this one is 4) which is different than above three and will be tracked here.

Thanks for the feedback and let me know if I forgot or misunderstood something.
Comment 5 Martin Krauskopf 2007-09-21 21:17:29 UTC
This is rather RFE. Will target for post-6.0 time frame.
Comment 6 Martin Krauskopf 2007-09-21 21:17:54 UTC
*** Issue 116366 has been marked as a duplicate of this issue. ***
Comment 7 ossat 2009-09-17 09:59:38 UTC
In comment 5 above, it is stated:

“> 1) click on a variable to inspect or modify it's value
This feature is already implemented. Just hover the mouse for a while above some variable in the editor and tooltip
should come with the value of variable/expression under the cursor.”

While the inspect feature is indeed already implemented and working as described above, the modify feature does not work
(or is it that I did not manage to figure out how to modify the value of a variable while debugging a Ruby program?).
The workaround described in comment 2 does work, however with the addition that after having modified the value of the
variable as described, one must delete the assignment (e.g. “n = 20”), otherwise the value of n is locked to 20, i.e.
any changes made by the Ruby program to the variable is immediately overwritten by the debugger to reset the variable to
the value set in the “Watches” tab. Thus this workaround is no more than a kludge.

Looking forward to see the modify feature implemented and working for Ruby programs, in the same way as it already does
when debugging Java programs.
Comment 8 mark_moseley 2009-09-22 00:34:57 UTC
I've released a patch that fixes this. See: http://wiki.github.com/mark-moseley/ruby-debug/netbeans-671-ide-updates


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