summaryrefslogtreecommitdiffstats
path: root/lldb/source/Interpreter
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/Interpreter
parent9515b31096e3ef3f00acb9cbd8f4e6f4770005ff (diff)
downloadbcm5719-llvm-4d93b8cdf3f15bf95e6c1522bac14b660b1d5791.tar.gz
bcm5719-llvm-4d93b8cdf3f15bf95e6c1522bac14b660b1d5791.zip
<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/Interpreter')
-rw-r--r--lldb/source/Interpreter/CommandObject.cpp1
-rw-r--r--lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp9
2 files changed, 6 insertions, 4 deletions
diff --git a/lldb/source/Interpreter/CommandObject.cpp b/lldb/source/Interpreter/CommandObject.cpp
index 6ab4af167b6..c71ca28b033 100644
--- a/lldb/source/Interpreter/CommandObject.cpp
+++ b/lldb/source/Interpreter/CommandObject.cpp
@@ -1098,6 +1098,7 @@ CommandObject::g_arguments_data[] =
{ eArgTypeCount, "count", CommandCompletions::eNoCompletion, { NULL, false }, "An unsigned integer." },
{ eArgTypeDirectoryName, "directory", CommandCompletions::eDiskDirectoryCompletion, { NULL, false }, "A directory name." },
{ eArgTypeDisassemblyFlavor, "disassembly-flavor", CommandCompletions::eNoCompletion, { NULL, false }, "A disassembly flavor recognized by your disassembly plugin. Currently the only valid options are \"att\" and \"intel\" for Intel targets" },
+ { eArgTypeDescriptionVerbosity, "description-verbosity", CommandCompletions::eNoCompletion, { NULL, false }, "How verbose the output of 'po' should be." },
{ eArgTypeEndAddress, "end-address", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." },
{ eArgTypeExpression, "expr", CommandCompletions::eNoCompletion, { NULL, false }, "Help text goes here." },
{ eArgTypeExpressionPath, "expr-path", CommandCompletions::eNoCompletion, { ExprPathHelpTextCallback, true }, NULL },
diff --git a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
index 0129d3ed3f8..c79f49dc1d9 100644
--- a/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
+++ b/lldb/source/Interpreter/OptionGroupValueObjectDisplay.cpp
@@ -15,6 +15,7 @@
// C++ Includes
// Other libraries and framework includes
// Project includes
+#include "lldb/DataFormatters/ValueObjectPrinter.h"
#include "lldb/Target/Target.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Utility/Utils.h"
@@ -147,12 +148,12 @@ OptionGroupValueObjectDisplay::OptionParsingStarting (CommandInterpreter &interp
}
}
-ValueObject::DumpValueObjectOptions
-OptionGroupValueObjectDisplay::GetAsDumpOptions (bool objc_is_compact,
+DumpValueObjectOptions
+OptionGroupValueObjectDisplay::GetAsDumpOptions (LanguageRuntimeDescriptionDisplayVerbosity lang_descr_verbosity,
lldb::Format format,
lldb::TypeSummaryImplSP summary_sp)
{
- ValueObject::DumpValueObjectOptions options;
+ DumpValueObjectOptions options;
options.SetMaximumPointerDepth(ptr_depth);
if (use_objc)
options.SetShowSummary(false);
@@ -169,7 +170,7 @@ OptionGroupValueObjectDisplay::GetAsDumpOptions (bool objc_is_compact,
.SetFormat(format)
.SetSummary(summary_sp);
- if (objc_is_compact)
+ if (lang_descr_verbosity == eLanguageRuntimeDescriptionDisplayVerbosityCompact)
options.SetHideRootType(use_objc)
.SetHideName(use_objc)
.SetHideValue(use_objc);
OpenPOWER on IntegriCloud