This is an archive of the discontinued LLVM Phabricator instance.

remote-gdb-server platform able to run processes on a remote system
AbandonedPublic

Authored by vharron on Jan 18 2015, 11:15 PM.

Details

Summary

This patch gets remote-gdb-server platform able to run processes on a remote system

  1. Make sure the selected platform is always used
  2. Make sure that the host uses the connect://hostname to connect to both the lldb-platform and the lldb-gdbserver rather than what the platform reports as the hostname of the lldb-gdbserver
  3. Make sure that lldb-platform uses the IP address on it's connection back to the host instead of the hostname that the host sends to it when launching lldb-gdbserver with the remote host information

Details:

source/Commands/CommandObjectPlatform.cpp
added SetSelectedPlatform call, because this is what SB does
source/Commands/CommandObjectTarget.cpp
removed m_platform_options - why was it ever in target?
calling CreateTarget with the selected platform (remote-gdb-server) instead of using m_platform_options, which was creating and using a new "host" platform instead of whatever is selected
source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.cpp
implemented PlatformRemoteGDBServer::ResolveExecutable, mostly copied from iOS version
added primitive PlatformRemoteGDBServer::GetSupportedArchitectureAtIndex implementation
PlatformRemoteGDBServer::ConnectRemote - retaining hostname where lldb-platform is running so we can re-use it when we connect to the gdb server.
source/Target/Platform.cpp
implemented Platform::PutFile
source/Target/TargetList.cpp
make sure we're using a platform if one is selected

Diff Detail

Event Timeline

vharron updated this revision to Diff 18370.Jan 18 2015, 11:15 PM
vharron retitled this revision from to remote-gdb-server platform able to run processes on a remote system.
vharron updated this object.
vharron edited the test plan for this revision. (Show Details)
vharron added a reviewer: clayborg.
vharron added a subscriber: Unknown Object (MLST).
vharron edited the test plan for this revision. (Show Details)Jan 18 2015, 11:16 PM
vharron added reviewers: ovyalov, sivachandra.
vharron set the repository for this revision to rL LLVM.
ovyalov added inline comments.Jan 20 2015, 11:19 AM
source/Target/Platform.cpp
1272

Do we need to check for error here?

1274

ditto.

clayborg requested changes to this revision.Jan 20 2015, 11:30 AM
clayborg edited edge metadata.

See inline command about checking "bytes_written" for zero. Fix that and it is good to go.

source/Target/Platform.cpp
1274

We need to check for "bytes_written" being zero and break out if it is zero otherwise we will spin for ever here.

This revision now requires changes to proceed.Jan 20 2015, 11:30 AM
vharron updated this revision to Diff 18472.Jan 20 2015, 5:48 PM
vharron edited edge metadata.
vharron edited the test plan for this revision. (Show Details)

Refactored PlatformPOSIX::PutFile, removed duplicated code

Platform::PutFile
Added error check after WriteFile, reformatted

ovyalov accepted this revision.Jan 21 2015, 10:02 AM
ovyalov edited edge metadata.
vharron accepted this revision.May 9 2015, 11:54 PM
vharron added a reviewer: vharron.

Updated to address comments, committed back in r226712

vharron abandoned this revision.May 9 2015, 11:55 PM