diff options
author | Tamas Berghammer <tberghammer@google.com> | 2015-12-08 14:08:19 +0000 |
---|---|---|
committer | Tamas Berghammer <tberghammer@google.com> | 2015-12-08 14:08:19 +0000 |
commit | ccd6cffba3545bec41864b0c3fa4ca7cc3e854c5 (patch) | |
tree | 47ae8040ff8d1ce1485f2789a848bd181403c605 /lldb/source/Commands/CommandObjectPlatform.cpp | |
parent | 59d092f883a44c35822f3038128a11452801c7a4 (diff) | |
download | bcm5719-llvm-ccd6cffba3545bec41864b0c3fa4ca7cc3e854c5.tar.gz bcm5719-llvm-ccd6cffba3545bec41864b0c3fa4ca7cc3e854c5.zip |
Modify "platform connect" to connect to processes as well
The standard remote debugging workflow with gdb is to start the
application on the remote host under gdbserver (e.g.: gdbserver :5039
a.out) and then connect to it with gdb.
The same workflow is supported by debugserver/lldb-gdbserver with a very
similar syntax but to access all features of lldb we need to be
connected also to an lldb-platform instance running on the target.
Before this change this had to be done manually with starting a separate
lldb-platform on the target machine and then connecting to it with lldb
before connecting to the process.
This change modifies the behavior of "platform connect" with
automatically connecting to the process instance if it was started by
the remote platform. With this command replacing gdbserver in a gdb
based worflow is usually as simple as replacing the command to execute
gdbserver with executing lldb-platform.
Differential revision: http://reviews.llvm.org/D14952
llvm-svn: 255016
Diffstat (limited to 'lldb/source/Commands/CommandObjectPlatform.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectPlatform.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lldb/source/Commands/CommandObjectPlatform.cpp b/lldb/source/Commands/CommandObjectPlatform.cpp index 00e291192dc..aad8bea692e 100644 --- a/lldb/source/Commands/CommandObjectPlatform.cpp +++ b/lldb/source/Commands/CommandObjectPlatform.cpp @@ -409,12 +409,19 @@ protected: if (error.Success()) { platform_sp->GetStatus (ostrm); - result.SetStatus (eReturnStatusSuccessFinishResult); + result.SetStatus (eReturnStatusSuccessFinishResult); + + platform_sp->ConnectToWaitingProcesses(m_interpreter.GetDebugger(), error); + if (error.Fail()) + { + result.AppendError (error.AsCString()); + result.SetStatus (eReturnStatusFailed); + } } else { result.AppendErrorWithFormat ("%s\n", error.AsCString()); - result.SetStatus (eReturnStatusFailed); + result.SetStatus (eReturnStatusFailed); } } else |