Skip to content

[iOS] [Simulator] Inspecting an NSValue object causes the debug session to hang #261

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
VladimirAmiorkov opened this issue Aug 1, 2019 · 1 comment

Comments

@VladimirAmiorkov
Copy link

VladimirAmiorkov commented Aug 1, 2019

Environment
Provide version numbers for the following components (information can be retrieved by running tns info in your project folder or by inspecting the package.json of the project):

  • CLI: 6.0.2
  • Cross-platform modules: 6.0.4
  • iOS Runtime: 6.0.1
  • Plugin(s):
  • VSCode: 1.36.1 (1.36.1)

Describe the bug
When you hit a breakpoint where there is an NSValue object and you try to inspect that object VS Code hangs and you can no longer proceed with the debug session.

To Reproduce
Start any NativeScript app and add a breakpoint to this row: https://github.com/NativeScript/NativeScript/blob/09d370919f909aa4f89a350c04fd9d80b76fe9ca/tns-core-modules/application/application.ios.ts#L158. Try to inspect it and after that go to the next row in the debug session.

Expected behavior
Inspecting an NSValue object works.

Sample project

Workaround
Doing the same using Chrome Dev tools works as expected.

@mbektchiev
Copy link

This crash is related to the fact that VS Code tries to read all properties of an object when inspecting it. NSValue has many properties that interpret the wrapped object as different types (e.g. CGPointValue, CGVectorValue, CGRectValue etc.). Depending on the actual value of the object, only valid interpretations succeed, while the others will throw an Objective-C exception (e.g. [[NSValue valueWithCGSize: CGSize {15,10} ] rectValue] will throw). That leads to app crashes on the simulator because of a known issue in the iOS runtime (NativeScript/ios-jsc#1044).

As a workaround (until the main issue gets fixed), you can debug your app on a real device instead of the simulator.

@mbektchiev mbektchiev changed the title Inspecting an NSValue object causes the debug session to hang [iOS] [Simulator] Inspecting an NSValue object causes the debug session to hang Aug 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants