diff options
| author | Enrico Granata <granata.enrico@gmail.com> | 2011-08-18 16:38:26 +0000 |
|---|---|---|
| committer | Enrico Granata <granata.enrico@gmail.com> | 2011-08-18 16:38:26 +0000 |
| commit | 85933ed40c74509b903555488d5e137a6721c24a (patch) | |
| tree | 90c658f27d34178b3b632fa462180e97cf515af2 /lldb/source/Core/ValueObject.cpp | |
| parent | 2b8078a2cdb8fecd3e3be3fe0a9bd6f823c4ca43 (diff) | |
Second round of code cleanups:
- reorganizing classes layout to have public part first
Typedefs that we want to keep private, but must be defined for some public code to work correctly are an exception
- avoiding methods in the form T foo() { code; } all on one-line
- moving method implementations from .h to .cpp whenever feasible
Templatized code is an exception and so are very small methods
- generally, adhering to coding conventions followed project-wide
Functional changes:
- fixed an issue where using ${var} in a summary for an aggregate, and then displaying a pointer-to-aggregate would lead to no summary being displayed
The issue was not a major one because all ${var} was meant to do in that context was display an error for invalid use of pointer
Accordingly fixed test cases and added a new test case
llvm-svn: 137944
Diffstat (limited to 'lldb/source/Core/ValueObject.cpp')
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index c05c227d8798..aabfd7163139 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -224,13 +224,13 @@ ValueObject::UpdateFormatsIfNeeded(lldb::DynamicValueType use_dynamic) log->Printf("checking for FormatManager revisions. VO named %s is at revision %d, while the format manager is at revision %d", GetName().GetCString(), m_last_format_mgr_revision, - DataVisualization::ValueFormats::GetCurrentRevision()); + DataVisualization::GetCurrentRevision()); if (HasCustomSummaryFormat() && m_update_point.GetModID() != m_user_id_of_forced_summary) { ClearCustomSummaryFormat(); m_summary_str.clear(); } - if ( (m_last_format_mgr_revision != DataVisualization::ValueFormats::GetCurrentRevision()) || + if ( (m_last_format_mgr_revision != DataVisualization::GetCurrentRevision()) || m_last_format_mgr_dynamic != use_dynamic) { if (m_last_summary_format.get()) @@ -246,7 +246,7 @@ ValueObject::UpdateFormatsIfNeeded(lldb::DynamicValueType use_dynamic) DataVisualization::GetSummaryFormat(*this, use_dynamic, m_last_summary_format); DataVisualization::GetSyntheticChildren(*this, use_dynamic, m_last_synthetic_filter); - m_last_format_mgr_revision = DataVisualization::ValueFormats::GetCurrentRevision(); + m_last_format_mgr_revision = DataVisualization::GetCurrentRevision(); m_last_format_mgr_dynamic = use_dynamic; ClearUserVisibleData(); @@ -1029,7 +1029,8 @@ ValueObject::GetPrintableRepresentation(Stream& s, bool ValueObject::DumpPrintableRepresentation(Stream& s, ValueObjectRepresentationStyle val_obj_display, - lldb::Format custom_format) + lldb::Format custom_format, + bool only_special) { clang_type_t elem_or_pointee_type; @@ -1147,6 +1148,10 @@ ValueObject::DumpPrintableRepresentation(Stream& s, (custom_format == lldb::eFormatDefault)) // use the [] operator return false; } + + if (only_special) + return false; + bool var_success = GetPrintableRepresentation(s, val_obj_display, custom_format); if (custom_format != eFormatInvalid) SetFormat(eFormatDefault); @@ -1727,7 +1732,8 @@ ValueObject::GetExpressionPath (Stream &s, bool qualify_cxx_base_classes, GetExp { const bool is_deref_of_parent = IsDereferenceOfParent (); - if (is_deref_of_parent && epformat == eDereferencePointers) { + if (is_deref_of_parent && epformat == eDereferencePointers) + { // this is the original format of GetExpressionPath() producing code like *(a_ptr).memberName, which is entirely // fine, until you put this into StackFrame::GetValueForVariableExpressionPath() which prefers to see a_ptr->memberName. // the eHonorPointers mode is meant to produce strings in this latter format @@ -1789,7 +1795,8 @@ ValueObject::GetExpressionPath (Stream &s, bool qualify_cxx_base_classes, GetExp } } - if (is_deref_of_parent && epformat == eDereferencePointers) { + if (is_deref_of_parent && epformat == eDereferencePointers) + { s.PutChar(')'); } } |
