From c2a58d73ce3aa7a678b9a00b086944c111aea02a Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Mon, 25 Mar 2013 19:46:48 +0000 Subject: Ensure that option -Y also works for expression as it does for frame variable Also, if the user passes an explicit format specifier when printing a variable, override the summary's decision to hide the value. This is required for scenarios like this to work: (lldb) p/x c (Class) $0 = 0x0000000100adb7f8 NSObject Previously this would say: (lldb) p/x c (Class) $0 = NSObject ignoring the explicit format specifier llvm-svn: 177893 --- lldb/source/Core/ValueObject.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lldb/source/Core/ValueObject.cpp') diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 4e5e921f287..783fa129163 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -3396,7 +3396,8 @@ DumpValueObject_Impl (Stream &s, // Make sure we have a value and make sure the summary didn't // specify that the value should not be printed - and do not print // the value if this thing is nil - if (!is_nil && !value_str.empty() && (entry == NULL || entry->DoesPrintValue() || sum_cstr == NULL) && !options.m_hide_value) + // (but show the value if the user passes a format explicitly) + if (!is_nil && !value_str.empty() && (entry == NULL || (entry->DoesPrintValue() || options.m_format != eFormatDefault) || sum_cstr == NULL) && !options.m_hide_value) s.Printf(" %s", value_str.c_str()); if (sum_cstr) -- cgit v1.2.3