Skip to content

Commit

Permalink
Fix debugserver stop
Browse files Browse the repository at this point in the history
Summary:
For some reason the debugserver stop command called status by mistake! This means that `debugserver stop` wouldn't actually kill the debugserver.

Now it does.

Reviewed By: jamescoggan

Differential Revision: D33479256

fbshipit-source-id: e4f6b4b85eae800d2ac8a6b275c47d68bbb398e6
  • Loading branch information
lawrencelomax authored and facebook-github-bot committed Jan 10, 2022
1 parent 7762446 commit dc0e7dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions FBDeviceControl/Management/FBDeviceDebugServer.m
Expand Up @@ -168,6 +168,7 @@ - (void)socketServer:(FBSocketServer *)server clientConnected:(struct in6_addr)a
[self.logger log:@"Client Disconnected"];
self.twistedPair = nil;
}];
[self.teardown resolveFromFuture:completed];
self.twistedPair = twistedPair;
}

Expand Down
5 changes: 4 additions & 1 deletion idb_companion/Server/FBIDBCommandExecutor.m
Expand Up @@ -359,10 +359,13 @@ - (instancetype)initWithTarget:(id<FBiOSTarget>)target storageManager:(FBIDBStor
failFuture];
}

return [[self
return [[[self
debugserver_prepare:bundleID]
onQueue:self.target.workQueue fmap:^(FBBundleDescriptor *application) {
return [commands launchDebugServerForHostApplication:application port:self.ports.debugserverPort];
}]
onQueue:self.target.workQueue doOnResolved:^(id<FBDebugServer> debugServer) {
self.debugServer = debugServer;
}];
}

Expand Down
2 changes: 1 addition & 1 deletion idb_companion/Server/FBIDBServiceHandler.mm
Expand Up @@ -1507,7 +1507,7 @@ static void populate_companion_info(idb::CompanionInfo *info, id<FBEventReporter
return Status::OK;
}
case idb::DebugServerRequest::ControlCase::kStop: {
id<FBDebugServer> debugServer = [[_commandExecutor debugserver_status] block:&error];
id<FBDebugServer> debugServer = [[_commandExecutor debugserver_stop] block:&error];
if (!debugServer) {
return Status(grpc::StatusCode::INTERNAL, error.localizedDescription.UTF8String);
}
Expand Down

0 comments on commit dc0e7dc

Please sign in to comment.