[TISTUD-8942] Android Debugger: Some breakpoints not hit if "Resume" is done anytime during debug #860
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
JIRA: https://jira.appcelerator.org/browse/TISTUD-8942
Description
This boiled down to "some breakpoints were never honored in alloy apps".
After a lot of digging to isolate where the root cause was, I was able to validate the the debugger/SDK seemed fine, as a built alloy app could be debugged on the generated sources just fine.
Classic apps were OK, so it had to be alloy-specific.
I then dug into alloy's source mapping, since it's really a two-pass operation. First, we generate an initial file and our own source map. Then we hand that off to babel and it's supposed to transform the file more and generate the final source mapping. Great, right? Except babel produces intermittently invalid source maps: babel/babel#6008
The workaround here is to avoid trying to feed source maps to babel or consume the ones they generate, but to have it "retainLines" so our original source map is still correct/valid for line mappings (it may get wonky with columns, but Studio is incapable of handling sub-line precision right now anyways).