summaryrefslogtreecommitdiffstats
path: root/lldb/source/Target/ProcessInfo.cpp
diff options
context:
space:
mode:
authorTodd Fiala <todd.fiala@gmail.com>2016-05-31 18:32:20 +0000
committerTodd Fiala <todd.fiala@gmail.com>2016-05-31 18:32:20 +0000
commit7aa4d977eaf3bf8122263227a6af3f5bd32390fd (patch)
treed0493175ab1b57120ff626eb07e4dafa39fd3778 /lldb/source/Target/ProcessInfo.cpp
parent4d29099f7f30cb6d16962346741be72f6ab89b1e (diff)
downloadbcm5719-llvm-7aa4d977eaf3bf8122263227a6af3f5bd32390fd.tar.gz
bcm5719-llvm-7aa4d977eaf3bf8122263227a6af3f5bd32390fd.zip
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/Target/ProcessInfo.cpp')
-rw-r--r--lldb/source/Target/ProcessInfo.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lldb/source/Target/ProcessInfo.cpp b/lldb/source/Target/ProcessInfo.cpp
index 1adb93333fc..214db9ed3d4 100644
--- a/lldb/source/Target/ProcessInfo.cpp
+++ b/lldb/source/Target/ProcessInfo.cpp
@@ -15,6 +15,8 @@
// Project includes
#include "lldb/Target/ProcessInfo.h"
+#include "lldb/Core/Stream.h"
+
using namespace lldb;
using namespace lldb_private;
@@ -65,6 +67,21 @@ ProcessInfo::GetNameLength() const
}
void
+ProcessInfo::Dump (Stream &s, Platform *platform) const
+{
+ s << "Executable: " << GetName() << "\n";
+ s << "Triple: ";
+ m_arch.DumpTriple(s);
+ s << "\n";
+
+ s << "Arguments:\n";
+ m_arguments.Dump(s);
+
+ s << "Environment:\n";
+ m_environment.Dump(s, "env");
+}
+
+void
ProcessInfo::SetExecutableFile (const FileSpec &exe_file, bool add_exe_file_as_first_arg)
{
if (exe_file)
OpenPOWER on IntegriCloud