[TIMOB-24079] Android Debugger: Not all breakpoints are hit during debug of android app with SDK 6.0.0
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-10-28T16:46:50.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 6.0.0 |
Components | Android |
Labels | qe-6.0.0, regression |
Reporter | Satyam Sekhri |
Assignee | Christopher Williams |
Created | 2016-10-27T09:37:44.000+0000 |
Updated | 2018-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
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.
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
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.
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...
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|
Cleaning up older fixed issues. If this issue should not have been closed as fixed, please reopen.