diff options
| author | Greg Clayton <gclayton@apple.com> | 2012-03-22 18:15:37 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2012-03-22 18:15:37 +0000 |
| commit | f830dbb77b9ee5ef4a76594e7bc96b8cdd7195ac (patch) | |
| tree | 931b128d73d86f458ad11915c34cc3bb8520ae16 | |
| parent | 1d1435d8a815ee03d7f4e7d52f65e07a60bf8836 (diff) | |
| download | bcm5719-llvm-f830dbb77b9ee5ef4a76594e7bc96b8cdd7195ac.tar.gz bcm5719-llvm-f830dbb77b9ee5ef4a76594e7bc96b8cdd7195ac.zip | |
Added the ability to log a value object just as a value would be display
when using the "frame variable" or "target variable" commands.
llvm-svn: 153266
| -rw-r--r-- | lldb/include/lldb/Core/ValueObject.h | 12 | ||||
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 22 |
2 files changed, 33 insertions, 1 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index 0943cf11fed..ed8948a1719 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -881,7 +881,17 @@ public: 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 diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 4ec7088c780..3d3d03aa746 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -3391,6 +3391,28 @@ DumpValueObject_Impl (Stream &s, } 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) { |

