Skip to content
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

Under certain conditions, placing a break point into a method called when an onPress event fire in a button, causes the vscode debugger to apparently hang when the method breakpoint is reached. #368

Closed
bgiavotto opened this issue Dec 20, 2016 · 7 comments

Comments

@bgiavotto
Copy link

Actual Behavior

  1. Create a new project and use copy-paste the source code below.
  2. on the emulator enable the debugging, click on the button. the code in method buttonclick execute correctly
  3. Now, place a breakpoint on the line "console.error" in method buttonclick()
  4. Click the button. Apparently the emulator device does not respond to clicks. this happens because on the emulator the process is stopped because of the break point, but vscode does not catch up the breakpoint reached.
  5. Now switch to vscode and press the "||" (pause) button on the debug toolbar. You will notice that execution is paused at the line with breakpoint but VSCode never noticed this.
  6. Hit F10 and execution will continue.

please notice that changing the onPress handler from
onPress={ this.buttonclick }
to
onPress={ ()=> { this.buttonclick() } }
make the problem disappear.

Expected Behavior

Instead on hanging up the vscode should catch up the breakpoint and show in the source code the current execution line

Software versions

  • React-Native VS Code extension version: 0.2.4
  • VSCode version: 1.8.1
  • OS platform and version: win
  • NodeJS version: 6.9.1
  • React Native version: 1.3.x

Outputs (Include if relevant)

  • Output of the Debug Console (View -> Toggle Debug Console):
PASTE OUTPUT HERE
  • Output of the React-Native output channel (View -> Toggle Output -> Select React-Native in ListBox):
PASTE OUTPUT HERE
  • Output of the Developer Tools console (Help -> Toggle Developer Tools -> Select Console tab):
PASTE OUTPUT HERE
@bgiavotto
Copy link
Author

the chrome debugger works fine.

@bgiavotto bgiavotto changed the title Under certain conditions, placing a break point into a method called as a result of a onPress event in a button causes the vscode debugger to apparently hang when the method breakpoint is reached. Under certain conditions, placing a break point into a method called when an onPress event fire in a button, causes the vscode debugger to apparently hang when the method breakpoint is reached. Dec 20, 2016
@vladimir-kotikov
Copy link
Contributor

@bgiavotto, this souds like a dupe of #273 and appears to be a node@6.x issue

@bgiavotto
Copy link
Author

I got also problems with node 7.x

@MSLaguana
Copy link
Member

I still suspect that it is the same issue, which we've reported at nodejs/node#8347

Node is currently going through a change of how debugging works. Unfortunately for us, the new system (which I believe works in this case) is still experimental and changing, while the old system is essentially deprecated and doesn't seem likely to have much more done on it.

@bgiavotto
Copy link
Author

maybe getting a quick view on how the chrome debugger does the interaction with debugger can help?
the chrome debugger handles correctly the issue, no malfunctions.

@bgiavotto
Copy link
Author

however i agree about your suspect, it's probably the same problem

@vladimir-kotikov
Copy link
Contributor

This issue has been fixed by switching to node2 debugging engine in #390. @MSLaguana, can we close this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants