diff options
| author | Greg Clayton <gclayton@apple.com> | 2011-06-23 18:38:25 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2011-06-23 18:38:25 +0000 |
| commit | f60f375250a9abe1dcf7e96498e56223f14f43fc (patch) | |
| tree | 964d7435c6ea9c6f90d3ec7044e5b9b4d4ceffdf | |
| parent | f7d23404203b7a2d1d34cb08d70d172d579800cf (diff) | |
| download | bcm5719-llvm-f60f375250a9abe1dcf7e96498e56223f14f43fc.tar.gz bcm5719-llvm-f60f375250a9abe1dcf7e96498e56223f14f43fc.zip | |
Another patch from Enrico Granata.
Added a fix for where you might have already displayed something with a given
type, then did a "type format add ...", then you display the type again. This
patch will figure out that the format changed and allow us to display the
type with the correct new format.
llvm-svn: 133743
| -rw-r--r-- | lldb/include/lldb/Core/ValueObject.h | 1 | ||||
| -rw-r--r-- | lldb/source/Core/ValueObject.cpp | 19 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index fcf2b0b25d6..e033ec12992 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -505,6 +505,7 @@ protected: ValueObject *m_deref_valobj; lldb::Format m_format; + lldb::Format m_last_format; bool m_value_is_valid:1, m_value_did_change:1, m_children_count_valid:1, diff --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp index 2f71c02dba8..7d2ffd0212c 100644 --- a/lldb/source/Core/ValueObject.cpp +++ b/lldb/source/Core/ValueObject.cpp @@ -661,6 +661,23 @@ ValueObject::GetValueAsCString () { if (UpdateValueIfNeeded()) { + /* + this is a quick fix for the case in which we display a variable, then change its format with + type format add and the old display string keeps showing until one steps through the code + */ + { + const Value::ContextType context_type = m_value.GetContextType(); + switch (context_type) + { + case Value::eContextTypeClangType: + case Value::eContextTypeLLDBType: + case Value::eContextTypeVariable: + Format format = GetFormat(); + if (format != m_last_format) + m_value_str.clear(); + break; + } + } if (m_value_str.empty()) { const Value::ContextType context_type = m_value.GetContextType(); @@ -682,7 +699,7 @@ ValueObject::GetValueAsCString () if (ClangASTType::DumpTypeValue (GetClangAST(), // The clang AST clang_type, // The clang type to display &sstr, - format, // Format to display this type with + m_last_format = format, // Format to display this type with m_data, // Data to extract from 0, // Byte offset into "m_data" GetByteSize(), // Byte size of item in "m_data" |

