summaryrefslogtreecommitdiffstats
path: root/lldb/source/Commands/CommandObjectTarget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Commands/CommandObjectTarget.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectTarget.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp
index 7f351ab038d..fbf69d88bf0 100644
--- a/lldb/source/Commands/CommandObjectTarget.cpp
+++ b/lldb/source/Commands/CommandObjectTarget.cpp
@@ -21,7 +21,6 @@
#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Host/StringConvert.h"
#include "lldb/Host/Symbols.h"
-#include "lldb/Host/TimeValue.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
@@ -133,6 +132,25 @@ static uint32_t DumpTargetList(TargetList &target_list,
return num_targets;
}
+// TODO: Remove this once llvm can pretty-print time points
+static void DumpTimePoint(llvm::sys::TimePoint<> tp, Stream &s, uint32_t width) {
+#ifndef LLDB_DISABLE_POSIX
+ char time_buf[32];
+ time_t time = llvm::sys::toTimeT(tp);
+ char *time_cstr = ::ctime_r(&time, time_buf);
+ if (time_cstr) {
+ char *newline = ::strpbrk(time_cstr, "\n\r");
+ if (newline)
+ *newline = '\0';
+ if (width > 0)
+ s.Printf("%-*s", width, time_cstr);
+ else
+ s.PutCString(time_cstr);
+ } else if (width > 0)
+ s.Printf("%-*s", width, "");
+#endif
+}
+
#pragma mark CommandObjectTargetCreate
//-------------------------------------------------------------------------
OpenPOWER on IntegriCloud