diff options
author | Todd Fiala <todd.fiala@gmail.com> | 2016-05-31 18:32:20 +0000 |
---|---|---|
committer | Todd Fiala <todd.fiala@gmail.com> | 2016-05-31 18:32:20 +0000 |
commit | 7aa4d977eaf3bf8122263227a6af3f5bd32390fd (patch) | |
tree | d0493175ab1b57120ff626eb07e4dafa39fd3778 /lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | |
parent | 4d29099f7f30cb6d16962346741be72f6ab89b1e (diff) | |
download | llvm-7aa4d977eaf3bf8122263227a6af3f5bd32390fd.zip llvm-7aa4d977eaf3bf8122263227a6af3f5bd32390fd.tar.gz llvm-7aa4d977eaf3bf8122263227a6af3f5bd32390fd.tar.bz2 |
Implement ProcessInfo::Dump(), log gdb-remote stub launch
This change implements dumping the executable, triple,
args and environment when using ProcessInfo::Dump().
It also tweaks the way Args::Dump() works so that it prints
a configurable label rather than argv[{index}]={value}. By
default it behaves the same, but if the Dump() method with
the additional arg is provided, it can be overridden. The
environment variables dumped as part of ProcessInfo::Dump()
make use of that.
lldb-server has been modified to dump the gdb-remote stub's
ProcessInfo before launching if the "gdb-remote process" channel
is logged.
llvm-svn: 271312
Diffstat (limited to 'lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp')
-rw-r--r-- | lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp index 4689e0b..f164b14 100644 --- a/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunication.cpp @@ -1120,7 +1120,7 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *url, { Log *log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet (GDBR_LOG_PROCESS)); if (log) - log->Printf ("GDBRemoteCommunication::%s(url=%s, port=%" PRIu16, __FUNCTION__, url ? url : "<empty>", port ? *port : uint16_t(0)); + log->Printf ("GDBRemoteCommunication::%s(url=%s, port=%" PRIu16 ")", __FUNCTION__, url ? url : "<empty>", port ? *port : uint16_t(0)); Error error; // If we locate debugserver, keep that located version around @@ -1352,7 +1352,14 @@ GDBRemoteCommunication::StartDebugserverProcess (const char *url, launch_info.AppendSuppressFileAction (STDIN_FILENO, true, false); launch_info.AppendSuppressFileAction (STDOUT_FILENO, false, true); launch_info.AppendSuppressFileAction (STDERR_FILENO, false, true); - + + if (log) + { + StreamString string_stream; + Platform *const platform = nullptr; + launch_info.Dump(string_stream, platform); + log->Printf("launch info for gdb-remote stub:\n%s", string_stream.GetString().c_str()); + } error = Host::LaunchProcess(launch_info); if (error.Success() && |