This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Hovering with the mouse over an ActiveRecord delete_all method in a debug session seems to invoke the statement | ||
---|---|---|---|
Product: | ruby | Reporter: | nuberion <nuberion> |
Component: | Debugger | Assignee: | Erno Mononen <emononen> |
Status: | VERIFIED FIXED | ||
Severity: | blocker | CC: | mmirilovic, mschovanek, pjiricka, sustaining |
Priority: | P2 | ||
Version: | 6.x | ||
Hardware: | All | ||
OS: | Windows Vista | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: | screenshot |
Description
nuberion
2009-06-23 14:53:57 UTC
Created attachment 83938 [details]
screenshot
Yay, that sounds pretty nasty. I'll take a look at this. Meanwhile you can disable tooltip evaluation to avoid this by using the ruby.debugger.skip.balloon.evaluation system variable, e.g. add -J-Druby.debugger.skip.balloon.evaluation=true to netbeans_default_conf in <nb_install_dir>/etc/netbeans.conf and restart the IDE. I think tooltip evaluation should not be enabled for method invocations by default as that can cause this kind of nasty side effects. Unfortunately the debugger isn't currently aware of the underlying AST and hence it isn't really possible to reliably recognize a method call from a variable. Making the debugger to use AST for this so close to FCS would be a bit risky, so I think we should target 6.7 patch 1. The workaround for now would be to use the system property described above (I'm also setting this to P2 due to the workaround) and I will start working on a proper fix for patch1 when I'm back from my vacation next week. The issue has actually been there for as long as tooltip evaluation, so this isn't a regression in 6.7 and hence I'm a bit reluctant to completely disable tooltip evaluation by default (that would be just a question of setting the system property true by default). Just in case folks decide to fix this for 6.7 when I'm away, here are two ways to do it (I'm writing them here so that someone else can handle this if needed): 1. As written above, just change the default value of the org.netbeans.modules.ruby.debugger.ToolTipAnnotation#SKIP_BALLOON_EVAL system property to true 2. Enable tooltip evaluation only for the selected text so that the user can't accidentally evaluate harmful methods (I'd prefer this solution): diff -r 0539ec21c6dc ruby.debugger/src/org/netbeans/modules/ruby/debugger/ToolTipAnnotation.java --- a/ruby.debugger/src/org/netbeans/modules/ruby/debugger/ToolTipAnnotation.java Tue Jun 23 14:22:44 2009 +0200 +++ b/ruby.debugger/src/org/netbeans/modules/ruby/debugger/ToolTipAnnotation.java Tue Jun 23 17:47:28 2009 +0200 @@ -119,6 +119,7 @@ t = ep.getSelectedText(); } if (t != null) { return t; } + if (t == null) { return null; } int line = NbDocument.findLineNumber(doc, offset); int col = NbDocument.findLineColumn(doc, offset); Element lineElem = NbDocument.findLineRootElement(doc).getElement(line); Should be fixed now in 5fd86688f814. The debugger now checks the type of the node under evaluation and proceeds to evaluate only if it wasn't a method call. To evaluate method calls, you need to select the method call. This should this kind of unfortunate side effects. Thanks once again for the report. Martin, can you please verify when you have the chance so that we can get the fix to patch1 -- thanks! Integrated into 'main-golden', will be available in build *200906300200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main-golden/rev/5fd86688f814 User: Erno Mononen <emononen@netbeans.org> Log: #167536: Hovering with the mouse over an ActiveRecord delete_all method in a debug session seems to invoke the statement - the tooltip annotation now checks the ast node type before evaluating and evaluates only if it should be safe to do so (based on the type) - to evaluate method calls the user now needs to select the method call to evaluate. This prevents accidental side effects. v. The fix has been ported into the release67_fixes repository. http://hg.netbeans.org/release67_fixes/rev/5f6a1137f140 |