aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectFrame.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2013-09-30 19:11:51 +0000
committerEnrico Granata <egranata@apple.com>2013-09-30 19:11:51 +0000
commit4d93b8cdf3f15bf95e6c1522bac14b660b1d5791 (patch)
tree171686bdcc54855cc856713986a0aa7fa51b7b3e /lldb/source/Commands/CommandObjectFrame.cpp
parent9515b31096e3ef3f00acb9cbd8f4e6f4770005ff (diff)
downloadllvm-4d93b8cdf3f15bf95e6c1522bac14b660b1d5791.zip
llvm-4d93b8cdf3f15bf95e6c1522bac14b660b1d5791.tar.gz
llvm-4d93b8cdf3f15bf95e6c1522bac14b660b1d5791.tar.bz2
<rdar://problem/14393032>
DumpValueObject() 2.0 This checkin restores pre-Xcode5 functionality to the "po" (expr -O) command: - expr now has a new --description-verbosity (-v) argument, which takes either compact or full as a value (-v is the same as -vfull) When the full mode is on, "po" will show the extended output with type name, persistent variable name and value, as in (lldb) expr -O -v -- foo (id) $0 = 0x000000010010baf0 { 1 = 2; 2 = 3; } When -v is omitted, or -vcompact is passed, the Xcode5-style output will be shown, as in (lldb) expr -O -- foo { 1 = 2; 2 = 3; } - for a non-ObjectiveC object, LLDB will still try to retrieve a summary and/or value to display (lldb) po 5 5 -v also works in this mode (lldb) expr -O -vfull -- 5 (int) $4 = 5 On top of that, this is a major refactoring of the ValueObject printing code. The functionality is now factored into a ValueObjectPrinter class for easier maintenance in the future DumpValueObject() was turned into an instance method ValueObject::Dump() which simply calls through to the printer code, Dump_Impl has been removed Test case to follow llvm-svn: 191694
Diffstat (limited to 'lldb/source/Commands/CommandObjectFrame.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectFrame.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp
index 202d62e..2e852d0 100644
--- a/lldb/source/Commands/CommandObjectFrame.cpp
+++ b/lldb/source/Commands/CommandObjectFrame.cpp
@@ -25,6 +25,7 @@
#include "lldb/Core/ValueObject.h"
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/DataFormatters/DataVisualization.h"
+#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Host/Host.h"
#include "lldb/Interpreter/Args.h"
#include "lldb/Interpreter/CommandInterpreter.h"
@@ -400,7 +401,7 @@ protected:
else if (!m_option_variable.summary_string.IsCurrentValueEmpty())
summary_format_sp.reset(new StringSummaryFormat(TypeSummaryImpl::Flags(),m_option_variable.summary_string.GetCurrentValue()));
- ValueObject::DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions(false,eFormatDefault,summary_format_sp));
+ DumpValueObjectOptions options(m_varobj_options.GetAsDumpOptions(eLanguageRuntimeDescriptionDisplayVerbosityFull,eFormatDefault,summary_format_sp));
if (variable_list)
{
@@ -447,9 +448,7 @@ protected:
if (var_sp->DumpDeclaration(&s, show_fullpaths, show_module))
s.PutCString (": ");
}
- ValueObject::DumpValueObject (result.GetOutputStream(),
- valobj_sp.get(),
- options);
+ valobj_sp->Dump(result.GetOutputStream(),options);
}
}
}
@@ -493,9 +492,7 @@ protected:
Stream &output_stream = result.GetOutputStream();
options.SetRootValueObjectName(valobj_sp->GetParent() ? name_cstr : NULL);
- ValueObject::DumpValueObject (output_stream,
- valobj_sp.get(),
- options);
+ valobj_sp->Dump(output_stream,options);
}
else
{
@@ -571,9 +568,7 @@ protected:
options.SetFormat(format);
options.SetRootValueObjectName(name_cstr);
- ValueObject::DumpValueObject (result.GetOutputStream(),
- valobj_sp.get(),
- options);
+ valobj_sp->Dump(result.GetOutputStream(),options);
}
}
}