This is an archive of the discontinued LLVM Phabricator instance.

Prevent ProcessGDBRemote from launching local debug server in case of remote debug server connection failure
ClosedPublic

Authored by ovyalov on Nov 20 2015, 4:25 PM.

Details

Reviewers
clayborg
labath
Summary

If remote platform is used and we're losing remote debug server connection in between Process::ConnectRemote and Process::Attach (in context of PlatformRemoteGDBServer::Attach) current implementation of ProcessGDBRemote thinks that we're in local debug mode and tries to spawn a local debug server. This CL checks whether ProcessGDBRemote is using a remote platform and fails if remote debug server connection is lost.

Diff Detail

Event Timeline

ovyalov updated this revision to Diff 40845.Nov 20 2015, 4:25 PM
ovyalov retitled this revision from to Prevent ProcessGDBRemote from launching local debug server in case of remote debug server connection failure.
ovyalov updated this object.
ovyalov added reviewers: clayborg, labath.
ovyalov added a subscriber: lldb-commits.
labath accepted this revision.Nov 23 2015, 1:48 AM
labath edited edge metadata.

Nice catch. Looks good.

source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
3516

I find this name somewhat misleading. Check would generally imply a read-only operation, but this actually establishes the connection in some circumstances. I'd go for EstablishConnectionIfNeeded or something like that.

This revision is now accepted and ready to land.Nov 23 2015, 1:48 AM
ovyalov updated this revision to Diff 40948.Nov 23 2015, 10:00 AM
ovyalov edited edge metadata.

Addressed review comments - renamed the method to EstablishConnectionIfNeeded.

ovyalov closed this revision.Nov 23 2015, 11:35 AM

Files:

/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h

Users:

ovyalov (Author)

http://reviews.llvm.org/rL253906