Skip to content

fix(debug): debug-brk option does not work for iOS Simulator #3340

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

Merged
merged 1 commit into from
Jan 30, 2018

Conversation

rosen-vladimirov
Copy link
Contributor

@rosen-vladimirov rosen-vladimirov commented Jan 29, 2018

The debug-brk option was broken in a previous commit as we were trying to connect to the backend port (18181). The problem is that connecting to it makes the runtime thinks debugger is attached and it continues to next statements.
Instead of connecting to the port, check if it is in LISTEN state.
Fixes #3338

const socket = await this.$iOSEmulatorServices.connectToPort({ port: inspectorBackendPort });
if (!socket) {
private async waitForBackendPortToBeOpened(deviceIdentifier: string): Promise<void> {
const portListens = await this.$net.waitForPortToListen(inspectorBackendPort, 10000, 200);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Introducing an object instead of passing three separate values here would increase readability a lot IMO

@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-sim-debug-brk branch 2 times, most recently from cd4d340 to 0216235 Compare January 30, 2018 12:07
Copy link
Contributor

@Mitko-Kerezov Mitko-Kerezov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks all right to me

@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-sim-debug-brk branch from 0216235 to 2ed4507 Compare January 30, 2018 14:41
The `debug-brk` option was broken in a previous commit as we were trying to connect to the backend port (18181). The problem is that connecting to it makes the runtime thinks debugger is attached and it continues to next statements.
Instead of connecting to the port, check if it is in LISTEN state.
@rosen-vladimirov rosen-vladimirov force-pushed the vladimirov/fix-sim-debug-brk branch from 2ed4507 to b35a8fd Compare January 30, 2018 14:44
@rosen-vladimirov rosen-vladimirov merged commit e7039a0 into release Jan 30, 2018
@rosen-vladimirov rosen-vladimirov deleted the vladimirov/fix-sim-debug-brk branch January 30, 2018 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants