Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24079] Android Debugger: Not all breakpoints are hit during debug of android app with SDK 6.0.0

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2016-10-28T16:46:50.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.0.0
ComponentsAndroid
Labelsqe-6.0.0, regression
ReporterSatyam Sekhri
AssigneeChristopher Williams
Created2016-10-27T09:37:44.000+0000
Updated2018-08-06T17:49:11.000+0000

Description

With SDK 6.0.0 not all breakpoints are hit during debug on android. This is a regression as the issue does not occur with SDK 5.5.1.GA Steps to Reproduce: 1. Create a classic app 2. Replace the code in app.js with the following code
Ti.include("import.js");
var y = {foo:'bar'};
 
var f = function() {
	var foo = "a";
	Ti.API.info("Inside anonymous function: "+foo);
	Ti.API.info("Global val: "+x);
	x+=1;
};
f();
3. Add a new file import.js and add following code in it
var x = 10;
Ti.API.info("x = "+x);
4. Add a breakpoint in import.js and also on in app.js (like line 2 and any line in function f) 5. Debug on android device Actual result: On debug the breakpoint in import.js is hit. Click on resume and the breakpoints in app.js are not hit. Expected Result: All the appropriate breakpoints should be hit during debug

Comments

  1. Christopher Williams 2016-10-27

    So I'm seeing the exact *opposite* of what you report here. I get the breakpoints in app.js to hit (line 2 and 5), but never hit the breakpoint at line 2 in import.js. (Tested with SDK 6.0.0.v20161026195651, using a dev eclipse environment for Studio on release branch) That gives me an idea what might be causing the issues, though. With SDK 6+, we use proper file paths, on older SDKs we didn't use leading '/' in the paths. I added code into Studio to add the prefix or not based on SDK version. But when I changed the SDK, I never touched Ti.include, so it likely needs the old non-prefixed paths right now. So maybe you have a Studio version not containing that fix - so Ti.include works, but required paths don't. While I have a version with the Studio prefixing of paths so require paths work, but Ti.include doesn't. So - two things to ensure: - Fix Ti.include to use the leading slash on file paths internally for SDK 6+ - Ensure the Studio code conditionally a adding the prefix is on every branch it should be.
  2. Christopher Williams 2016-10-27

    SDK PRs: - 6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8560 - master/6.1.x: https://github.com/appcelerator/titanium_mobile/pull/8559
  3. Christopher Williams 2016-10-27

    The conditional prefixing of paths used for breakpoints based on SDK version is on all three branches (master, release and development) of Studio, so I'm not sure why we're seeing exact opposite behavior here.
  4. Christopher Williams 2016-10-27

    The SDK fixes should go in since we haven't rid ourselves of Ti.include yet. (Or hey, we could still get rid of Ti.include, there's *already* a PR for that instead). May need an eventual Studio PR to fix the opposite behavior Satyam and I are seeing...
  5. Chee Kiat Ng 2016-10-28

  6. Satyam Sekhri 2016-10-28

    Not including the fix as per the PR from Chris, below is the behavior across the GA and 6.0/4.8 versions of SDK and Studio when using Ti.include and using Require. The table below shows if the breakpoint is hit in the particular file or not. With Studio 4.8 || ||Ti.Include|| ||Require|| || ||SDK||Included File||app.js||Required File||app.js|| |5.5.1.GA|Y|Y|Y|Y| |6.0|N|Y|Y|Y| With Studio 4.7.1 || ||Ti.Include|| ||Require|| || ||SDK||Included File||app.js||Required File||app.js|| |5.5.1.GA|Y|Y|Y|Y| |6.0|Y|N|N|N|
  7. (deactived) Brian Immel 2016-10-31

  8. Eric Merriman 2018-08-06

    Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.

JSON Source