Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-11173] Android: Debugger: breakpoint at global unassigned variable declaration hits next statement instead

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionInvalid
Resolution Date2017-07-10T22:17:18.000+0000
Affected Version/sRelease 2.1.2, Release 2.1.3, Release 3.0.0
Fix Version/sn/a
ComponentsAndroid
Labelsdebugger, qe-and090112
ReporterDustin Hyde
AssigneeEric Merriman
Created2012-09-26T20:42:00.000+0000
Updated2017-07-10T22:17:18.000+0000

Description

Breakpoints at global unassigned variable declarations are skipped and hit at next statement instead. However, unassigned variable declarations in anonymous functions are correctly hit. 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 result in the first breakpoint being hit at the next statement (e.g., 'var deadVar1' stops at 'Ti.API.info('Global Variables Defined!')'). 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 skips the first breakpoint, but stops at the next statement. Pressing 'Resume' will correctly hit the unassigned variable in the anonymous function. 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:42:00.000+00003598
app.js2012-09-26T20:42:00.000+0000188
console-log.txt2012-09-26T20:42:00.000+000083
iosdebugger.log2012-09-26T20:42:00.000+00001980
MyProject.zip2012-09-26T20:42:00.000+00003122581

Comments

  1. Lee Morris 2017-07-10

    Closing ticket due to time passed and lack of progress for a number of years. Please open a new ticket if there are any problems.

JSON Source