Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-3767] Android: Debugger breakpoint conditions with failures should report an error in the debugger console, but still break

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2017-07-31T20:52:08.000+0000
Affected Version/sRelease 1.7.0
Fix Version/sn/a
ComponentsAndroid
Labelsmerge-1.8.1, parity
ReporterMarshall Culpepper
AssigneeEric Merriman
Created2011-04-27T13:14:13.000+0000
Updated2017-07-31T20:52:33.000+0000

Description

Comments

  1. Marshall Culpepper 2011-05-15

    Steps to test: - Right click on an enabled breakpoint in a debugged app, go to Properties - Enable the Breakpoint Condition, enter an invalid expression - The next time that code runs, a failure should show in the Console, but the breakpoint should still break
  2. Don Thorp 2011-05-15

    Using
       for (var i = 0; i < 10; i++) {
       	Ti.API.debug("Hello: " + i);
       }
       
    with the breakpoint set on the Ti.API.debug statement and the conditional set to i == . I get the following crash.
       D/TiFileFactory(  669): (main) [174,1299] getting initial from parts: app://app.js
       D/TiLaunchActivity(  669): (main) [2,1301] Eval JS Activity:file:///android_asset/Resources/app.js
       D/TiFileFactory(  669): (kroll$1: app://app.js) [4,1305] getting initial from parts: file:///android_asset/Resources/app.js
       D/TiDebugClient(  669): (kroll$1: app://app.js) [1,1306] debugger evalFile: file:///android_asset/Resources/app.js
       D/TiDebugSession(  669): (kroll$1: app://app.js) [1,1307] write packet: 40*threads*created*9*kroll$1: [app:/app.js]
       D/TiDebugSession(  669): (kroll$1: app://app.js) [6,1313] write packet: 46*scripts*created*9|app:/app.js|app:/app.js|1|18
       E/TiJSError(  669): (kroll$1: app://app.js) [228,1541] ----- Titanium Javascript Error -----
       E/TiJSError(  669): (kroll$1: app://app.js) [2,1543] - In <expr>:1,5
       E/TiJSError(  669): (kroll$1: app://app.js) [1,1544] - Message: Unexpected end of file
       E/TiJSError(  669): (kroll$1: app://app.js) [0,1544] - Source: i == 
       E/TiJSError(  669): (kroll$1: app://app.js) [185,1729] ----- Titanium Javascript Runtime Error -----
       E/TiJSError(  669): (kroll$1: app://app.js) [1,1730] - In <expr>:1,0
       E/TiJSError(  669): (kroll$1: app://app.js) [2,1732] - Message: Compilation produced 1 syntax errors.
       E/TiJSError(  669): (kroll$1: app://app.js) [1,1733] - Source: null
       I/System.out(  669): onExceptionThrown, cx:org.mozilla.javascript.Context@44c4d6e0, exception:java.lang.NullPointerException
       D/TiDebugSession(  669): (kroll$1: app://app.js) [51,1784] write packet: 20*log*err*[ERROR] null
       D/TiDebugSession(  669): (kroll$1: app://app.js) [2,1786] write packet: 36*suspended*9*exception*app:/app.js*16
       D/TiDebugSession(  669): (Thread-11) [13,1799] rcvd request: 22*1305478837459*frames*9
       D/FramesHandler(  669): Frame 0 scope: [object Object]
       D/TiDebugSession(  669): (Thread-11) [6,1805] write packet: 62*1305478837459*0|||app:/app.js|16|false|1305478838301|333894860
       W/ActivityManager(   53): Launch timeout has expired, giving up wake lock!
       W/ActivityManager(   53): Activity idle timeout for HistoryRecord{44d2e878 net.donthorp.adhoc/.AdhocActivity}
       D/TiDebugSession(  669): (Thread-11) [7531,9336] rcvd request: 9**resume*9
       D/TiDebugSession(  669): (Thread-11) [13,9352] write packet: 16*resumed*9*resume
       E/KrollContext(  669): (kroll$1: app://app.js) [3,9339] Error: null
       E/KrollContext(  669): java.lang.NullPointerException
       E/KrollContext(  669): 	at org.mozilla.javascript.Parser.parse(Parser.java:597)
       E/KrollContext(  669): 	at org.mozilla.javascript.Parser.parse(Parser.java:506)
       E/KrollContext(  669): 	at org.mozilla.javascript.Context.compileImpl(Context.java:2401)
       E/KrollContext(  669): 	at org.mozilla.javascript.Context.compileString(Context.java:1367)
       E/KrollContext(  669): 	at org.mozilla.javascript.Context.compileString(Context.java:1356)
       E/KrollContext(  669): 	at org.mozilla.javascript.tools.debugger.Dim$Condition.shouldBreak(Dim.java:1454)
       E/KrollContext(  669): 	at org.mozilla.javascript.tools.debugger.Dim$StackFrame.onLineChange(Dim.java:1293)
       E/KrollContext(  669): 	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2127)
       E/KrollContext(  669): 	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
       E/KrollContext(  669): 	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       E/KrollContext(  669): 	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
       E/KrollContext(  669): 	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
       E/KrollContext(  669): 	at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
       E/KrollContext(  669): 	at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
       E/KrollContext(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.run(Dim.java:1039)
       E/KrollContext(  669): 	at org.mozilla.javascript.Context.call(Context.java:521)
       E/KrollContext(  669): 	at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
       E/KrollContext(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.withContext(Dim.java:1078)
       E/KrollContext(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.access$3(Dim.java:1077)
       E/KrollContext(  669): 	at org.mozilla.javascript.tools.debugger.Dim.evalScript(Dim.java:677)
       E/KrollContext(  669): 	at ti.modules.titanium.debug.g.evaluateFile(Unknown Source)
       E/KrollContext(  669): 	at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)
       E/KrollContext(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)
       E/KrollContext(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)
       E/KrollContext(  669): 	at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
       E/KrollContext(  669): 	at android.os.Handler.dispatchMessage(Handler.java:95)
       E/KrollContext(  669): 	at android.os.Looper.loop(Looper.java:123)
       E/KrollContext(  669): 	at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
       W/dalvikvm(  669): threadid=17: thread exiting with uncaught exception (group=0x4001b188)
       E/TiUncaughtHandler(  669): (kroll$1: app://app.js) [51,9403] Sending event: exception on thread: kroll$1: app://app.js msg:org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException; Titanium 1.7.0,2011/05/14 13:16,6afca8
       E/TiUncaughtHandler(  669): org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786)
       E/TiUncaughtHandler(  669): 	at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.handleException(KrollContext.java:148)
       E/TiUncaughtHandler(  669): 	at ti.modules.titanium.debug.g.handleException(Unknown Source)
       E/TiUncaughtHandler(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:325)
       E/TiUncaughtHandler(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)
       E/TiUncaughtHandler(  669): 	at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
       E/TiUncaughtHandler(  669): 	at android.os.Handler.dispatchMessage(Handler.java:95)
       E/TiUncaughtHandler(  669): 	at android.os.Looper.loop(Looper.java:123)
       E/TiUncaughtHandler(  669): 	at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
       E/TiUncaughtHandler(  669): Caused by: java.lang.NullPointerException
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Parser.parse(Parser.java:597)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Parser.parse(Parser.java:506)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Context.compileImpl(Context.java:2401)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Context.compileString(Context.java:1367)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Context.compileString(Context.java:1356)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.tools.debugger.Dim$Condition.shouldBreak(Dim.java:1454)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.tools.debugger.Dim$StackFrame.onLineChange(Dim.java:1293)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2127)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.run(Dim.java:1039)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.Context.call(Context.java:521)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.withContext(Dim.java:1078)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.access$3(Dim.java:1077)
       E/TiUncaughtHandler(  669): 	at org.mozilla.javascript.tools.debugger.Dim.evalScript(Dim.java:677)
       E/TiUncaughtHandler(  669): 	at ti.modules.titanium.debug.g.evaluateFile(Unknown Source)
       E/TiUncaughtHandler(  669): 	at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)
       E/TiUncaughtHandler(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)
       E/TiUncaughtHandler(  669): 	... 5 more
       E/AndroidRuntime(  669): Uncaught handler: thread kroll$1: app://app.js exiting due to uncaught exception
       D/dalvikvm(  669): GC freed 5691 objects / 463080 bytes in 76ms
       E/AndroidRuntime(  669): org.mozilla.javascript.WrappedException: Wrapped java.lang.NullPointerException
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Context.throwAsScriptRuntimeEx(Context.java:1786)
       E/AndroidRuntime(  669): 	at org.appcelerator.titanium.kroll.KrollContext$DefaultEvaluator.handleException(KrollContext.java:148)
       E/AndroidRuntime(  669): 	at ti.modules.titanium.debug.g.handleException(Unknown Source)
       E/AndroidRuntime(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:325)
       E/AndroidRuntime(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:217)
       E/AndroidRuntime(  669): 	at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:223)
       E/AndroidRuntime(  669): 	at android.os.Handler.dispatchMessage(Handler.java:95)
       E/AndroidRuntime(  669): 	at android.os.Looper.loop(Looper.java:123)
       E/AndroidRuntime(  669): 	at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:86)
       E/AndroidRuntime(  669): Caused by: java.lang.NullPointerException
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Parser.parse(Parser.java:597)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Parser.parse(Parser.java:506)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Context.compileImpl(Context.java:2401)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Context.compileString(Context.java:1367)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Context.compileString(Context.java:1356)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.tools.debugger.Dim$Condition.shouldBreak(Dim.java:1454)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.tools.debugger.Dim$StackFrame.onLineChange(Dim.java:1293)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:2127)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3177)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Context.evaluateString(Context.java:1111)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.run(Dim.java:1039)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.Context.call(Context.java:521)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.ContextFactory.call(ContextFactory.java:535)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.withContext(Dim.java:1078)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.tools.debugger.Dim$DimIProxy.access$3(Dim.java:1077)
       E/AndroidRuntime(  669): 	at org.mozilla.javascript.tools.debugger.Dim.evalScript(Dim.java:677)
       E/AndroidRuntime(  669): 	at ti.modules.titanium.debug.g.evaluateFile(Unknown Source)
       E/AndroidRuntime(  669): 	at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:306)
       E/AndroidRuntime(  669): 	at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:318)
       E/AndroidRuntime(  669): 	... 5 more
       I/Process (   53): Sending signal. PID: 669 SIG: 3
       
  3. Don Thorp 2011-06-13

    This was stuck in TBS. Moved to sprint 25.
  4. Marshall Culpepper 2011-08-14

    This appears to have already been fixed. I've re-tested Don's test case and the breakpoint error is correctly reported to the app's console in TiStudio, while the breakpoint itself seems to work fine.
  5. Natalie Huynh 2011-09-09

    Tested with 1.8.0.v20110909152148 on Win 7 Linux 10.04 Mac OS X 10.6.8 ported test to Debugger test plan
  6. Don Thorp 2011-11-05

    Standardizing summary and labels.
  7. Opie Cyrus 2011-12-30

    moving sprint so it can be verified and closed if need be. was this resolved with 1.8.0?
  8. Wilson Luu 2012-01-09

    TiApp crashes on build 1.8.0.1 running Rhino on Windows 7 and XP:
       D/dalvikvm(  437): GC_FOR_MALLOC freed 6118 objects / 442064 bytes in 56ms
       E/TiApplication(  437): (KrollRuntimeThread) [795,1245] APP PROXY: ti.modules.titanium.app.AppModule@44f9a890
       D/TiAssetHelper(  437): Fetching "app.js" with Fastdev...
       D/dalvikvm(  437): GC_FOR_MALLOC freed 7862 objects / 357984 bytes in 64ms
       E/TiJSError(  437): (main) [2195,3440] ----- Titanium Javascript Error -----
       E/TiJSError(  437): (main) [0,3440] - In <expr>:1,8
       E/TiJSError(  437): (main) [0,3440] - Message: syntax error
       E/TiJSError(  437): (main) [1,3441] - Source: i == 
       E/TiJSError(  437): (main) [97,3538] ----- Titanium Javascript Error -----
       E/TiJSError(  437): (main) [1,3539] - In <expr>:1,10
       E/TiJSError(  437): (main) [3,3542] - Message: missing } in compound statement
       E/TiJSError(  437): (main) [0,3542] - Source: i == 
       E/TiJSError(  437): (main) [4,3546] ----- Titanium Javascript Error -----
       E/TiJSError(  437): (main) [1,3547] - In <expr>:1,10
       E/TiJSError(  437): (main) [1,3548] - Message: missing } in compound statement
       E/TiJSError(  437): (main) [1,3549] - Source: i == 
       E/TiJSError(  437): (main) [2,3551] ----- Titanium Javascript Runtime Error -----
       E/TiJSError(  437): (main) [1,3552] - In <expr>:1,0
       E/TiJSError(  437): (main) [1,3553] - Message: Compilation produced 3 syntax errors.
       E/TiJSError(  437): (main) [1,3554] - Source: null
       E/TiAPI   (  437): Compilation produced 3 syntax errors. (<expr>#1)
       W/ActivityManager(   60): Launch timeout has expired, giving up wake lock!
       
    I do not get the NullPointerException when compared to Don's crash. But, when running the same for loop code on V8 (1.8.0.1, Windows 7 and XP), TiApp does not crash. It loops through and prints out the count.
  9. Natalie Huynh 2012-01-10

    Tested with 1.8.0.1 on Mac 10.6.8, Linux 10.04 and Window 7 and XP. Rhino is working as expected, but V8 does not stop at the breakpoint, may be related to TIMOB-4162, leaving open until we can confirm that it is working on V8
  10. Lee Morris 2017-07-31

    Closing due to inactivity. If this issue still exists, please raise a new ticket.

JSON Source