Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11172] iOS: Debugger: breakpoint at unassigned variable declaration skipped

GitHub Issuen/a
TypeBug
PriorityLow
StatusReopened
ResolutionUnresolved
Affected Version/sRelease 2.1.2, Release 2.1.3, Release 3.0.0
Fix Version/sn/a
ComponentsiOS
Labelsdebugger, parity, qe-ios090112
ReporterDustin Hyde
AssigneeUnknown
Created2012-09-26T20:39:37.000+0000
Updated2018-02-28T20:03:31.000+0000

Description

Breakpoints at unassigned variable declarations are skipped. For example:
var deadVar1; // breakpoint

Ti.API.info('Global Variables Defined!');

(function(){
	var deadVar2; // breakpoint
	
	Ti.API.info('Anonymous Function Called!');
})();

alert('App Exited!');
Running this code in debug mode will skip all breakpoints. This does not occur in Android, this is a parity issue. Steps to Reproduce: 1. Run code in debug (manually insert breakpoints as per code comments):
var deadVar1; // breakpoint

Ti.API.info('Global Variables Defined!');

(function(){
	var deadVar2; // breakpoint
	
	Ti.API.info('Anonymous Function Called!');
})();

alert('App Exited!');
Actual Result: App exits without hitting any breakpoints. Expected Result: The first breakpoint should be hit and pressing 'Resume' should hit the next breakpoint. Here is the expected console log for the sample code:
[INFO] Global Variables Defined!
[INFO] Anonymous Function Called!

Attachments

FileDateSize
androiddebugger.log2012-09-26T20:39:38.000+00003598
app.js2012-09-26T20:39:38.000+0000188
console-log.txt2012-09-26T20:39:38.000+000083
iosdebugger.log2012-09-26T20:39:38.000+00001980
MyProject.zip2012-09-26T20:39:38.000+00003122581

Comments

  1. Dustin Hyde 2012-09-26

    We should also address that if a breakpoint is inserted at a blank line of code, the next statement should be hit by the debugger, as it does in Android. This is a related usability issue that is a manifestation of this underlying bug. Please open another ticket for this behavior if necessary. Currently, if a blank line of code has a breakpoint, it is skipped entirely. It should just hit the next statement.
  2. Ingo Muschenetz 2012-09-26

    When you say that this happens for Android, is this in ADT? Or in the Studio debugger?
  3. Dustin Hyde 2012-09-26

    The next statement is hit if a breakpoint is on a blank line for Android in the Titanium Studio debugger.
  4. Harry Bryant 2015-12-02

    I can still reproduce this issue, breakpoints stated in the above test case are skipped with the following components:
       Mac OSX El Capitan: 10.11.1 (15B42)
       Ti SDK: 5.1.1.GA
       Appc NPM: 4.2.2
       Appc CLI: 5.1.0
       Xcode 7.1(7B91b)
       Node v4.2.2
       
  5. Angel Petkov 2016-03-15

    [~willcode2surf] Hi, this issue should be resolved using the newest debugger, by downloading the most recent master which can be found [here](http://builds.appcelerator.com.s3.amazonaws.com/index.html#master). Also enable on main thread needs to be set to true by adding the following code :
     <run-on-main-thread>true</run-on-main-thread>
    .Breakpoints added now will be hit regardless of which line they're added too.
  6. Abir Mukherjee 2016-10-21

    Testing with this environment, it appears the bug is not resolved: NPM Version: 2.15.9 Node Version: 4.5.0 Mac OS: 10.11.6 Appc CLI: 5.5.1 Appc CLI NPM: 4.2.7 Titanium SDK version: 6.0.0.v20161019091022 Appcelerator Studio, build: 4.8.0.201610171310 Xcode 8.0 GM Using the example code that was posted above, the debugger stops on the the first breakpoint at deadVar1. After clicking on the Resume button it does not stop at deadVar2, or the following statement after deadVar2. It executes completely through, and the 'App exited' alert is seen. This was done on iOS simulator and device. I am using the latest versions of Studio and the SDK. I also added the run-on-main-thread tag in with a value of true.
  7. Chee Kiat Ng 2016-10-24

    [~amukherjee] I'll be interested to know if true will resolve this issue.
  8. Abir Mukherjee 2016-10-24

    Yes it did resolve the issue. I added this tag in : true All the breakpoints were hit.
  9. Abir Mukherjee 2016-10-24

    Is that tag now required for projects where the debugger will be used?
  10. Chee Kiat Ng 2016-10-24

    Eventually it will be set as default, likely in the next major version release. Basically for Titanium SDK 6.0.0, use this tag to address this issue.

JSON Source