[flex] IU-95.260 debugger 'Cannot evaluate expression'

While debugging a flex app, I am seeing a number of variables where IDEA says "Cannot evaluate expression".
One case was an Error local variable in catch clause.
Another was a static String.

Not sure what the problem is. I couldn't find any open youtrack issues.
This is Flex SDK 3.4.0

iu-95-260-cannot-evaluate-expression1.png
iu-95-260-cannot-evaluate-expression2.png

0

Catched error evaluation seems to work only with Flex SDK 4 currently. I'll see if it can be improved.
Couldn't reproduce problem with static String. I need some example.

0

I didn't mention this is with Flashplayer version 10.0.45.2.  When debuggering, there are quite a few variables where I get 'Cannot evaluate expression', and it's not an expression just a simple variable.  If I find some time I can try creating self-contained examples and file a youtrack ticket, as I didn't see open issues on this.

I noticed there is a newer version of Flashplayer available 10.1.53.64.  I will try that to see if it makes any difference.

-Alex

0

I tried the new Flashplayer 10.1.53.64 debug version and now flashplayer is crashing regulary after I connect a debugger to it.  Once the debugger stops at a breakpoint, if I just step through a few lines, it usually crashes.  The only thing changed was Adobe flashplayer, so I blame them :)  I will have to try in FlexBuilder and see if it crashes there too.

I got this IDE Error.

For input string: "199
[UnloadSWF] /jsp/swf/ngp.swf/[[DYNAMIC]]/7": For input string: "199
[UnloadSWF] /jsp/swf/ngp.swf/[[DYNAMIC]]/7"
java.lang.NumberFormatException: For input string: "199
[UnloadSWF] /jsp/swf/ngp.swf/[[DYNAMIC]]/7"
    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48)
    at java.lang.Integer.parseInt(Integer.java:458)
    at java.lang.Integer.parseInt(Integer.java:499)
    at com.intellij.lang.javascript.flex.debug.FlexSuspendContext$FlexExecutionStack.processFrames(FlexSuspendContext.java:94)
    at com.intellij.lang.javascript.flex.debug.FlexSuspendContext$FlexExecutionStack.access$100(FlexSuspendContext.java:32)
    at com.intellij.lang.javascript.flex.debug.FlexSuspendContext$FlexExecutionStack$1.onTextAvailable(FlexSuspendContext.java:56)
    at com.intellij.lang.javascript.flex.debug.FlexDebugProcess.processOneCommandLoop(FlexDebugProcess.java:385)
    at com.intellij.lang.javascript.flex.debug.FlexDebugProcess.access$200(FlexDebugProcess.java:66)
    at com.intellij.lang.javascript.flex.debug.FlexDebugProcess$3.run(FlexDebugProcess.java:250)
    at com.intellij.openapi.application.impl.ApplicationImpl$5.run(ApplicationImpl.java:331)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
    at java.lang.Thread.run(Thread.java:619)
    at com.intellij.openapi.application.impl.ApplicationImpl$1$1.run(ApplicationImpl.java:125)

0

Exceptions is already fixed.
Please describe the environment where Flash Player crashes: OS, browser version (if any), Flex SDK version. We know about Flash Player 10.1 crashes on Linux: http://youtrack.jetbrains.net/issue/IDEA-55328 , may be this is the same thing.

0

FlexSDK 3.4.0
FlashPlayer:  10.0.45.2 (cannot evaluate some vars), 10.1.53.64 (crashes frequently)
OS: Windows 2008 R2 x64
Browser: Firefox 3.6.6

The crash in flashplayer 10.1 that I am seeing frequently could be one and the same problem you mentioned. I've never looked at flashplayer crash files before, so I don't know how to tell if it is the same problem.

I wonder if it is also related to  firefox 3.6.4 update which added plugin crash protection ( http://blog.mozilla.com/blog/2010/06/22/firefox-3-6-4-with-crash-protection-now-available/).

Although, I tried on IE and was also able to get it to crash.

-Alex

0

Expression evaluation works better with debugger from Flex SDK 4. As a hacky trick you may substitute /libs/fdb.jar in your Flex SDK 3.4.0 installation to the one from Flex SDK 4.0.0. (Also you'll need to substitute its dependency: swfutils.jar, but at the same time you shouldn't overwrite original file because it is also used by compiler, but you can give it a different name and fix MANIFEST.MF in fdb.jar accordingly :)).

The more interesting thing is Flash Player 10.1 crashes. I don't have Windows 2008 R2 near me, and didn't observe crashes on Vista/Mac, but observed regular crashes on Suse Linux. The problem occured to be in the Flash Player. Here are details: https://bugs.adobe.com/jira/browse/FP-1421?focusedCommentId=370454&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#action_370454

Can you please check my sample from Adobe's jira on Windows 2008 and add a comment (or better new issue) to Adobe's jira if the issue is not Linux-only?

0
Avatar
Permanently deleted user

The hacky trick you mentioned does not really work. I tried it in many different ways including that of you proposed with substituting its dependency and so on. We (and I believe others) do need to use debugger out of Flex 4 for projects built with Flex 3. For team I'm a member its a main drawback to prefer IDEA to your rivals. Do not ask me why we don't move to Flex 4 instead :-).

0

Please be more specific on what expression can not be evaluated and
where the debugger is stopped (preferably with code example).


On 29.07.2010 23:30, Boris Byk wrote:

The hacky trick you mentioned does not really work. I tried it in many different ways including that of you proposed with substituting its dependency and so on. We (and I believe others) do need to use debugger out of Flex 4 for projects built with Flex 3. For team I'm a member its a main drawback to prefer IDEA to your rivals. Do not ask me why we don't move to Flex 4 instead :).

>

---
Original message URL: http://devnet.jetbrains.net/message/5268934#5268934



--
Best regards,
   Maxim Mossienko
IntelliJ Labs / JetBrains Inc.
http://www.intellij.com
"Develop with pleasure!"

0
Avatar
Permanently deleted user

Here the example:

HelloWorld.as Game.as
package {

import flash.display.Sprite;

public class HelloWorld extends Sprite {
      public function HelloWorld() {
            var s:String = Game.str;
            trace(s)
      }
}
}

package {
public class Game {
      public static var str:String = "Hello world";

      public function Game() {
      }
}
}



I put breakpoint in HelloWorld.as line 'var s:String = Game.str;'. Breakpoint is hit:

  1. when it's built on top of Flex4 SDK, the expression Game.str is evaluated successfully.
  2. when it's built on top of Flex 3 SDK (3.4.1/3.5.0), it results into 'Cannot evaluate expression'
  3. when it's built on top of Flex 3 SDK with the hacky trick I get

Exception in thread "main" java.lang.NoSuchMethodError: flex.tools.debugger.cli.ExpressionCache.appendVariable(Ljava/lang/StringBuilder;Lflash/tools/debugger/Variable;)V
at flex.tools.debugger.cli.DebugCLI.appendFrameInfo(DebugCLI.java:1210)
at flex.tools.debugger.cli.DebugCLI.doInfoStack(DebugCLI.java:1165)
at flex.tools.debugger.cli.DebugCLI.processLine(DebugCLI.java:6623)
at flex.tools.debugger.cli.DebugCLI.process(DebugCLI.java:725)
at flex.tools.debugger.cli.DebugCLI.execute(DebugCLI.java:567)
at flex.tools.debugger.cli.DebugCLI.main(DebugCLI.java:370)


when  the breakpoint is hit.

What I did for point 3:

  1. Coped fbd.jar from Flex SDK 4 over the one in Flex SDK3.
  2. Edited its fdb.jar/META-INF/MANIFEST.MF changing swfutils.jar->swfutils4.jar
  3. Copied swfutils.jar from Flex SDK 4 to Flex SDK 3 having renamed it to swfutils4.jar


What was wrong?

UPDATED: forgot to say, I use IDEA 9.0.3

0
Avatar
Permanently deleted user

Thanks. But forgot to say that if I run fdb.exe from Flex SDK 4 everything works fine even on the code built on top of Flex Sdk 3.

  • run <flex-4-sdk-path>\bin\fdb.exe
  • issue 'run' command
  • break HelloWorld
  • continue
  • print Game.str


It seems like it is an issue with your  bindings for the debugger when/if using the hacky trick.

0

As described in the beginning of the thread:
FDB from Flex SDK 3 can not evaluate static members.
FDB from Flex SDK 4 can (as you also confirmed).
Mentioned hacky way describes how to get Flex SDK 3 + fdb from Flex SDK 4, you seems not copied enough files.
As workaround, I believe, you can launch FDB 4 if specify Flex SDK 4 as SDK, switch off automatic compile and compile via ANT.
Let's continue discussion on relevant stuff in the YouTrack ticket.

0

For complete hacky trick you need to copy (with giving different name and fixing MANIFEST.MF) not only swfutils.jar, but also mxmlc.jar, asc.jar, and all other dependencies mentioned in these jars.

0
Avatar
Permanently deleted user

I think I was able to fix it. I did exactly what you suggested including ALL dependencies. But important thing to do is to rename {IDEA Intallation}\plugins\flex\lib\idea-fdb-3-fix.jar -> {IDEA Intallation}\plugins\flex\lib\idea-fdb-3-fix.jar.bak. Otherwise you will still be getting exceptions due to the explicit bindings.

For those lazy you can download the renamed patched files from http://www.borisbyk.com/idea-flex3sdk-patch.zip. Check out the readme.txt file for further instructions.

Now it works for me on my simple examples. I'm going to give it a whirl in a more complicated project.

0

请先登录再写评论。