summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Debugger.cpp
diff options
context:
space:
mode:
authorEnrico Granata <egranata@apple.com>2014-03-25 22:03:52 +0000
committerEnrico Granata <egranata@apple.com>2014-03-25 22:03:52 +0000
commit894f735953ce08c08bcd9ee687a3dff065bb3323 (patch)
tree7438c0b06a3f053bf2a1aa4af0ec0188f63d6ef4 /lldb/source/Core/Debugger.cpp
parentf6601d0498e27e9939bf60a4fd3a97c08bd0c02a (diff)
downloadbcm5719-llvm-894f735953ce08c08bcd9ee687a3dff065bb3323.tar.gz
bcm5719-llvm-894f735953ce08c08bcd9ee687a3dff065bb3323.zip
<rdar://problem/14862302>
For small structs, the frame format now prints them as one-liners This follows the same definition that frame variable does for deciding what a "small struct" is, and as such should be fairly consistent with the variable display in general llvm-svn: 204762
Diffstat (limited to 'lldb/source/Core/Debugger.cpp')
-rw-r--r--lldb/source/Core/Debugger.cpp21
1 files changed, 18 insertions, 3 deletions
diff --git a/lldb/source/Core/Debugger.cpp b/lldb/source/Core/Debugger.cpp
index e596fc23b50..434029d89a8 100644
--- a/lldb/source/Core/Debugger.cpp
+++ b/lldb/source/Core/Debugger.cpp
@@ -31,6 +31,7 @@
#include "lldb/Core/ValueObjectVariable.h"
#include "lldb/DataFormatters/DataVisualization.h"
#include "lldb/DataFormatters/FormatManager.h"
+#include "lldb/DataFormatters/TypeSummary.h"
#include "lldb/Host/DynamicLibrary.h"
#include "lldb/Host/Terminal.h"
#include "lldb/Interpreter/CommandInterpreter.h"
@@ -2241,16 +2242,30 @@ FormatPromptRecurse
const size_t num_args = args.GetSize();
for (size_t arg_idx = 0; arg_idx < num_args; ++arg_idx)
{
+ std::string buffer;
+
VariableSP var_sp (args.GetVariableAtIndex (arg_idx));
ValueObjectSP var_value_sp (ValueObjectVariable::Create (exe_scope, var_sp));
+ const char *var_representation = nullptr;
const char *var_name = var_value_sp->GetName().GetCString();
- const char *var_value = var_value_sp->GetValueAsCString();
+ if (var_value_sp->GetClangType().IsAggregateType() &&
+ DataVisualization::ShouldPrintAsOneLiner(*var_value_sp.get()))
+ {
+ static StringSummaryFormat format(TypeSummaryImpl::Flags()
+ .SetHideItemNames(false)
+ .SetShowMembersOneLiner(true),
+ "");
+ format.FormatObject(var_value_sp.get(), buffer);
+ var_representation = buffer.c_str();
+ }
+ else
+ var_representation = var_value_sp->GetValueAsCString();
if (arg_idx > 0)
s.PutCString (", ");
if (var_value_sp->GetError().Success())
{
- if (var_value)
- s.Printf ("%s=%s", var_name, var_value);
+ if (var_representation)
+ s.Printf ("%s=%s", var_name, var_representation);
else
s.Printf ("%s=%s at %s", var_name, var_value_sp->GetTypeName().GetCString(), var_value_sp->GetLocationAsCString());
}
OpenPOWER on IntegriCloud