[Lldb-commits] [lldb] r153266 - in /lldb/trunk: include/lldb/Core/ValueObject.h source/Core/ValueObject.cpp
Greg Clayton
gclayton at apple.com
Thu Mar 22 11:15:39 PDT 2012
Author: gclayton
Date: Thu Mar 22 13:15:37 2012
New Revision: 153266
URL: http://llvm.org/viewvc/llvm-project?rev=153266&view=rev
Log:
Added the ability to log a value object just as a value would be display
when using the "frame variable" or "target variable" commands.
Modified:
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/source/Core/ValueObject.cpp
Modified: lldb/trunk/include/lldb/Core/ValueObject.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObject.h?rev=153266&r1=153265&r2=153266&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/ValueObject.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObject.h Thu Mar 22 13:15:37 2012
@@ -881,7 +881,17 @@
DumpValueObject (Stream &s,
ValueObject *valobj,
const DumpValueObjectOptions& options);
-
+
+ static void
+ LogValueObject (Log *log,
+ ValueObject *valobj);
+
+ static void
+ LogValueObject (Log *log,
+ ValueObject *valobj,
+ const DumpValueObjectOptions& options);
+
+
// returns true if this is a char* or a char[]
// if it is a char* and check_pointer is true,
// it also checks that the pointer is valid
Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=153266&r1=153265&r2=153266&view=diff
==============================================================================
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Thu Mar 22 13:15:37 2012
@@ -3391,6 +3391,28 @@
}
void
+ValueObject::LogValueObject (Log *log,
+ ValueObject *valobj)
+{
+ if (log && valobj)
+ return LogValueObject (log, valobj, DumpValueObjectOptions::DefaultOptions());
+}
+
+void
+ValueObject::LogValueObject (Log *log,
+ ValueObject *valobj,
+ const DumpValueObjectOptions& options)
+{
+ if (log && valobj)
+ {
+ StreamString s;
+ ValueObject::DumpValueObject (s, valobj, options);
+ if (s.GetSize())
+ log->PutCString(s.GetData());
+ }
+}
+
+void
ValueObject::DumpValueObject (Stream &s,
ValueObject *valobj)
{
More information about the lldb-commits
mailing list