<rdar://problem/13365424>

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



git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@177893 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/Commands/CommandObjectExpression.cpp b/source/Commands/CommandObjectExpression.cpp
index 357d8f7..ccb2f8e 100644
--- a/source/Commands/CommandObjectExpression.cpp
+++ b/source/Commands/CommandObjectExpression.cpp
@@ -387,22 +387,23 @@
                         result_valobj_sp->SetFormat (format);
 
                     ValueObject::DumpValueObjectOptions options;
-                    options.SetMaximumPointerDepth(m_varobj_options.ptr_depth)
-                    .SetMaximumDepth(m_varobj_options.max_depth)
-                    .SetShowTypes(m_varobj_options.show_types)
-                    .SetShowLocation(m_varobj_options.show_location)
-                    .SetUseObjectiveC(m_varobj_options.use_objc)
-                    .SetUseDynamicType(m_varobj_options.use_dynamic)
-                    .SetUseSyntheticValue(m_varobj_options.use_synth)
-                    .SetFlatOutput(m_varobj_options.flat_output)
-                    .SetOmitSummaryDepth(m_varobj_options.no_summary_depth)
-                    .SetIgnoreCap(m_varobj_options.ignore_cap)
-                    .SetFormat(format)
-                    .SetSummary()
-                    .SetShowSummary(!m_varobj_options.use_objc)
-                    .SetHideRootType(m_varobj_options.use_objc)
-                    .SetHideName(m_varobj_options.use_objc)
-                    .SetHideValue(m_varobj_options.use_objc);
+                    options.SetMaximumPointerDepth(m_varobj_options.ptr_depth);
+                    if (m_varobj_options.use_objc)
+                        options.SetShowSummary(false);
+                    else
+                        options.SetOmitSummaryDepth(m_varobj_options.no_summary_depth);
+                    options.SetMaximumDepth(m_varobj_options.max_depth)
+                           .SetShowTypes(m_varobj_options.show_types)
+                           .SetShowLocation(m_varobj_options.show_location)
+                           .SetUseObjectiveC(m_varobj_options.use_objc)
+                           .SetUseDynamicType(m_varobj_options.use_dynamic)
+                           .SetUseSyntheticValue(m_varobj_options.use_synth)
+                           .SetFlatOutput(m_varobj_options.flat_output)
+                           .SetIgnoreCap(m_varobj_options.ignore_cap)
+                           .SetFormat(format)
+                           .SetHideRootType(m_varobj_options.use_objc)
+                           .SetHideName(m_varobj_options.use_objc)
+                           .SetHideValue(m_varobj_options.use_objc);
                     
                     if (m_varobj_options.be_raw)
                         options.SetRawDisplay(true);