diff options
author | Greg Clayton <gclayton@apple.com> | 2010-09-02 02:59:18 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2010-09-02 02:59:18 +0000 |
commit | 288bdf9c1df39ae2be88dac6ca80adb9d123e9c9 (patch) | |
tree | 6705032b3965a864f2ec3f2560a52e8277702c85 /lldb/include | |
parent | 6a7f63448702860ec23d2d98a2a78d1c85cc7a50 (diff) | |
download | bcm5719-llvm-288bdf9c1df39ae2be88dac6ca80adb9d123e9c9.tar.gz bcm5719-llvm-288bdf9c1df39ae2be88dac6ca80adb9d123e9c9.zip |
StackFrame objects now own ValueObjects for any frame variables (locals, args,
function statics, file globals and static variables) that a frame contains.
The StackFrame objects can give out ValueObjects instances for
each variable which allows us to track when a variable changes and doesn't
depend on variable names when getting value objects.
StackFrame::GetVariableList now takes a boolean to indicate if we want to
get the frame compile unit globals and static variables.
The value objects in the stack frames can now correctly track when they have
been modified. There are a few more tweaks needed to complete this work. The
biggest issue is when stepping creates partial stacks (just frame zero usually)
and causes previous stack frames not to match up with the current stack frames
because the previous frames only has frame zero. We don't really want to
require that all previous frames be complete since stepping often must check
stack frames to complete their jobs. I will fix this issue tomorrow.
llvm-svn: 112800
Diffstat (limited to 'lldb/include')
-rw-r--r-- | lldb/include/lldb/API/SBValue.h | 2 | ||||
-rw-r--r-- | lldb/include/lldb/Core/ValueObject.h | 16 | ||||
-rw-r--r-- | lldb/include/lldb/Core/ValueObjectList.h | 11 | ||||
-rw-r--r-- | lldb/include/lldb/Core/ValueObjectVariable.h | 2 | ||||
-rw-r--r-- | lldb/include/lldb/Symbol/VariableList.h | 13 | ||||
-rw-r--r-- | lldb/include/lldb/Target/StackFrame.h | 13 | ||||
-rw-r--r-- | lldb/include/lldb/lldb-forward-rtti.h | 1 |
7 files changed, 33 insertions, 25 deletions
diff --git a/lldb/include/lldb/API/SBValue.h b/lldb/include/lldb/API/SBValue.h index b5ac5efb0e0..032f1db78f1 100644 --- a/lldb/include/lldb/API/SBValue.h +++ b/lldb/include/lldb/API/SBValue.h @@ -45,7 +45,7 @@ public: GetValue (const lldb::SBFrame &frame); bool - GetValueDidChange (); + GetValueDidChange (const lldb::SBFrame &frame); const char * GetSummary (const lldb::SBFrame &frame); diff --git a/lldb/include/lldb/Core/ValueObject.h b/lldb/include/lldb/Core/ValueObject.h index 75ae31bdffb..0e805f4e77f 100644 --- a/lldb/include/lldb/Core/ValueObject.h +++ b/lldb/include/lldb/Core/ValueObject.h @@ -145,10 +145,10 @@ public: GetUpdateID() const; bool - GetValueIsValid (); + GetValueIsValid () const; bool - GetValueDidChange () const; + GetValueDidChange (ExecutionContextScope *exe_scope); bool UpdateValueIfNeeded (ExecutionContextScope *exe_scope); @@ -173,11 +173,6 @@ public: GetSyntheticArrayMemberFromPointer (int32_t index, bool can_create); protected: - enum { - eValueChanged = (1 << 0), - eNumChildrenHasBeenSet = (1 << 1), - eValueIsValid = (1 << 2) - }; //------------------------------------------------------------------ // Classes that inherit from ValueObject can see and modify these //------------------------------------------------------------------ @@ -191,12 +186,17 @@ protected: DataExtractor m_data; // A data extractor that can be used to extract the value. Value m_value; Error m_error; // An error object that can describe any errors that occur when updating values. - Flags m_flags; // A boolean that indicates this value has changed std::string m_value_str; // Cached value string that will get cleared if/when the value is updated. + std::string m_old_value_str;// Cached old value string from the last time the value was gotten std::string m_location_str; // Cached location string that will get cleared if/when the value is updated. std::string m_summary_str; // Cached summary string that will get cleared if/when the value is updated. std::vector<lldb::ValueObjectSP> m_children; std::map<ConstString, lldb::ValueObjectSP> m_synthetic_children; + bool m_value_is_valid:1, + m_value_did_change:1, + m_children_count_valid:1, + m_old_value_valid:1; + //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ diff --git a/lldb/include/lldb/Core/ValueObjectList.h b/lldb/include/lldb/Core/ValueObjectList.h index 1b310289082..9c5cde647fd 100644 --- a/lldb/include/lldb/Core/ValueObjectList.h +++ b/lldb/include/lldb/Core/ValueObjectList.h @@ -48,11 +48,18 @@ public: FindValueObjectByPointer (ValueObject *valobj); uint32_t - GetSize() const; + GetSize () const; + + void + Resize (uint32_t size); lldb::ValueObjectSP - GetValueObjectAtIndex (uint32_t); + GetValueObjectAtIndex (uint32_t idx); + void + SetValueObjectAtIndex (uint32_t idx, + const lldb::ValueObjectSP &valobj_sp); + lldb::ValueObjectSP FindValueObjectByValueName (const char *name); diff --git a/lldb/include/lldb/Core/ValueObjectVariable.h b/lldb/include/lldb/Core/ValueObjectVariable.h index 80e0d05272e..f3d91dde39d 100644 --- a/lldb/include/lldb/Core/ValueObjectVariable.h +++ b/lldb/include/lldb/Core/ValueObjectVariable.h @@ -25,7 +25,7 @@ namespace lldb_private { class ValueObjectVariable : public ValueObject { public: - ValueObjectVariable (lldb::VariableSP &var_sp); + ValueObjectVariable (const lldb::VariableSP &var_sp); virtual ~ValueObjectVariable(); diff --git a/lldb/include/lldb/Symbol/VariableList.h b/lldb/include/lldb/Symbol/VariableList.h index 53d21e659f8..cadd2182148 100644 --- a/lldb/include/lldb/Symbol/VariableList.h +++ b/lldb/include/lldb/Symbol/VariableList.h @@ -27,7 +27,7 @@ public: virtual ~VariableList(); void - AddVariable (lldb::VariableSP &var_sp); + AddVariable (const lldb::VariableSP &var_sp); void AddVariables(VariableList *variable_list); @@ -42,14 +42,11 @@ public: GetVariableAtIndex(uint32_t idx); lldb::VariableSP - FindVariable(const ConstString& name); + FindVariable (const ConstString& name); + + uint32_t + FindIndexForVariable (Variable* variable); -// const SymbolContext& -// GetSymbolContext() const -// { -// return m_symbol_context; -// } -// size_t MemorySize() const; diff --git a/lldb/include/lldb/Target/StackFrame.h b/lldb/include/lldb/Target/StackFrame.h index 2732708dd4c..c8b482aeea3 100644 --- a/lldb/include/lldb/Target/StackFrame.h +++ b/lldb/include/lldb/Target/StackFrame.h @@ -91,14 +91,11 @@ public: } VariableList * - GetVariableList (); + GetVariableList (bool get_file_globals); bool HasDebugInformation (); - ValueObjectList & - GetValueObjectList(); - const char * Disassemble (); @@ -120,6 +117,12 @@ public: return m_unwind_frame_index; } + lldb::ValueObjectSP + GetValueObjectForFrameVariable (const lldb::VariableSP &variable_sp); + + lldb::ValueObjectSP + TrackGlobalVariable (const lldb::VariableSP &variable_sp); + //------------------------------------------------------------------ // lldb::ExecutionContextScope pure virtual functions //------------------------------------------------------------------ @@ -165,7 +168,7 @@ private: Scalar m_frame_base; Error m_frame_base_error; lldb::VariableListSP m_variable_list_sp; - ValueObjectList m_value_object_list; + ValueObjectList m_variable_list_value_objects; // Value objects for each variable in m_variable_list_sp StreamString m_disassembly; DISALLOW_COPY_AND_ASSIGN (StackFrame); }; diff --git a/lldb/include/lldb/lldb-forward-rtti.h b/lldb/include/lldb/lldb-forward-rtti.h index 8841322a156..aca620c5ed8 100644 --- a/lldb/include/lldb/lldb-forward-rtti.h +++ b/lldb/include/lldb/lldb-forward-rtti.h @@ -62,6 +62,7 @@ namespace lldb { typedef SharedPtr<lldb_private::ValueObject>::Type ValueObjectSP; typedef SharedPtr<lldb_private::Variable>::Type VariableSP; typedef SharedPtr<lldb_private::VariableList>::Type VariableListSP; + typedef SharedPtr<lldb_private::ValueObjectList>::Type ValueObjectListSP; } // namespace lldb |