GitHub Issue | n/a |
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2016-10-10T03:06:10.000+0000 |
Affected Version/s | Release 6.0.0 |
Fix Version/s | Release 6.0.0 |
Components | iOS |
Labels | alloy, debugger-ios, qe-6.0.0, regression |
Reporter | Satyam Sekhri |
Assignee | Christopher Williams |
Created | 2016-10-04T07:09:13.000+0000 |
Updated | 2016-11-18T18:00:42.000+0000 |
During debug on iOS of an Alloy application the breakpoints are not hit.
This is a regression on SDK as the issue happens with the 6.0 SDK but does not happen with 5.5.1.GA version of SDK
* The issue happens only for Alloy apps. For classic apps the breakpoints are hit successfully
* The issue occurs on both device and simulator
* This issue was found while testing the debug with TiCore framework
Steps to reproduce issue
1. Create a new alloy project
2. Add a breakpoint
3. Debug the project on iOS device or sim
Expected Results
The breakpoints are hit
Actual Results
The breakpoints are not hit
Verified again. SDK 6.0.0.v20160928101945 - Debugger doesn't hit the break point. SDK 5.5.1.v20160921190109 - Debugger works well. Please find the attached debugger log - [^iosdebugger.log]
Here is the console trace - [^debugger_console_trace.log]
Still investigating, So most likely the regression happened when this PR is merged: https://github.com/appcelerator/titanium_mobile/pull/8004 But as time pass, we made even more changes, so here's a comparison of some interesting log that might shed some light in the issue. When it was working:
using
6.0.0.v20161003233807
it looks like it might have something to do with
Krollbridge.m
on method- (id)require:(KrollContext *)kroll path:(NSString *)path
[~cwilliams] will need your help checking this out :)Probably similar issues as in TIMOB-23971. The file-extensions look really weird:
So one thing I noticed when looking at why hyperloop was broken on 2.0.0 was that ultimately the new require functionality caused that because we still generated "bad" require paths with no leading prefix (and I think there's a bug where if the first segment of the path is the name of a native module it won't fall back to legacy require behavior if the file is not found in the module). Anyways, Alloy still uses incorrect paths as well. We should fix Alloy to use proper paths in 6+ to avoid the worst case require lookup scenarios seen up above in Kiat's comments. I'm guessing that the require behavior is indirectly causing this due to returning proper paths with a leading '/' in them and Studio not handling that (expecting no leading slash). I had fixed this already, I thought. Maybe just for Android? I'll double-check.
I didn't see mention of whether this was the new JSC/iOS debugger or the old one. Did you guys try with use-jscore-framework set to true or false?
So I'm trying with the old debugger and run-on-main-thread set to false and can confirm it is failing. The root cause appears to be not getting a sourceParsed callback in https://github.com/appcelerator/titanium_debugger/blob/9b6730a40ffdc8a59f00bb505f95535a17ce7444/ios/Classes/TiDebuggerInterface.cpp#L57 from TiJSCore. I have no idea why that is the case. I only ever get the event for app.js, but not any of the other files. As a result I don't think it populates it's internal map in our debugger and can't therefore set the breakpoints on any other files (like alloy/controllers/index.js).
Ok, I have a fix for the "legacy" iOS debugger (used when use-jscore-framework is false or not set). 6_0_X: https://github.com/appcelerator/titanium_mobile/pull/8484 master: https://github.com/appcelerator/titanium_mobile/pull/8485 I'm looking into why the new JSC debugger is also failing now.
Studio fixes for the new debugger: 4.8.0: https://github.com/appcelerator/titanium_studio/pull/826 4.9.0: https://github.com/appcelerator/titanium_studio/pull/825
Ok, I have PRs for titanium_mobile and titanium_studio for 6.0/4.8 and 6.1/4.9. cc [~kkolipaka]
The fix for 'legacy' debugger works perfect! PRs merged.
PR's looks good to me. I'm able to debug Alloy apps without setting
use-jscore-framework
flag as well. Merged into 4.8.0 and 4.9.0 branches.Breakpoint hit successfully on iOS device and Simulator for an Alloy app Verified on: Device: iPhone 6S Plus (9.0), iPhone 7 (10.0), iOS Simulator 10.0 Mac OSX El Capitan 10.11.6 Ti SDK: 6.0.0.v20161101155110 Appc Studio: 4.8.0.201611020954 Appc NPM: 4.2.8-9 App CLI: 6.0.0-68 Xcode 8.0 Node v4.6.0 Preprod Environment