diff options
31 files changed, 314 insertions, 282 deletions
diff --git a/include/lldb/API/SBBreakpoint.h b/include/lldb/API/SBBreakpoint.h index faa970ab4..aae0446b3 100644 --- a/include/lldb/API/SBBreakpoint.h +++ b/include/lldb/API/SBBreakpoint.h @@ -11,7 +11,6 @@ #define LLDB_SBBreakpoint_h_ #include "lldb/API/SBDefines.h" -#include <stdio.h> namespace lldb { diff --git a/include/lldb/API/SBType.h b/include/lldb/API/SBType.h index 8142b9b03..981f269a9 100644 --- a/include/lldb/API/SBType.h +++ b/include/lldb/API/SBType.h @@ -11,8 +11,6 @@ #define LLDB_SBType_h_ #include "lldb/API/SBDefines.h" -#include "lldb/Symbol/ClangASTType.h" -#include "lldb/Symbol/Type.h" namespace lldb { @@ -75,17 +73,16 @@ public: GetName(); protected: - std::auto_ptr<lldb_private::TypeImpl> m_opaque_ap; + lldb::TypeImplSP m_opaque_sp; friend class SBModule; friend class SBTarget; friend class SBValue; friend class SBTypeList; - SBType (clang::ASTContext*, clang_type_t); - SBType (lldb_private::ClangASTType type); - SBType (lldb::TypeSP type); - SBType (lldb_private::TypeImpl impl); + SBType (const lldb_private::ClangASTType &); + SBType (const lldb::TypeSP &); + SBType (const lldb::TypeImplSP &); SBType(); }; @@ -101,7 +98,7 @@ public: operator = (const SBTypeList& rhs); void - AppendType(SBType type); + Append (const SBType& type); SBType GetTypeAtIndex(int index) const; diff --git a/include/lldb/API/SBValue.h b/include/lldb/API/SBValue.h index a145aef0c..5bae9a480 100644 --- a/include/lldb/API/SBValue.h +++ b/include/lldb/API/SBValue.h @@ -71,6 +71,12 @@ public: const char * GetValue (); + int64_t + GetValueAsSigned(int64_t fail_value=0); + + uint64_t + GetValueAsUnsigned(uint64_t fail_value=0); + ValueType GetValueType (); diff --git a/include/lldb/Symbol/ClangASTType.h b/include/lldb/Symbol/ClangASTType.h index e50735beb..71fa375f8 100644 --- a/include/lldb/Symbol/ClangASTType.h +++ b/include/lldb/Symbol/ClangASTType.h @@ -31,8 +31,8 @@ class ClangASTType public: ClangASTType (clang::ASTContext *ast_context, lldb::clang_type_t type) : - m_type (type), - m_ast (ast_context) + m_type (type), + m_ast (ast_context) { } @@ -58,6 +58,12 @@ public: return *this; } + bool + IsValid () const + { + return m_type != NULL && m_ast != NULL; + } + lldb::clang_type_t GetOpaqueQualType() const { @@ -288,6 +294,9 @@ private: clang::ASTContext *m_ast; }; +bool operator == (const ClangASTType &lhs, const ClangASTType &rhs); +bool operator != (const ClangASTType &lhs, const ClangASTType &rhs); + } // namespace lldb_private diff --git a/include/lldb/Symbol/Type.h b/include/lldb/Symbol/Type.h index 0868d4626..a35f10030 100644 --- a/include/lldb/Symbol/Type.h +++ b/include/lldb/Symbol/Type.h @@ -14,6 +14,7 @@ #include "lldb/Core/ClangForward.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/UserID.h" +#include "lldb/Symbol/ClangASTType.h" #include "lldb/Symbol/Declaration.h" #include <set> @@ -272,9 +273,12 @@ public: operator= (const TypeAndOrName &rhs); ConstString GetName () const; - lldb::TypeSP GetTypeSP () const { + + lldb::TypeSP + GetTypeSP () const + { return m_type_sp; - }; + } void SetName (ConstString &type_name_const_str); @@ -298,21 +302,23 @@ private: class TypeImpl { -private: - std::auto_ptr<ClangASTType> m_clang_ast_type; - lldb::TypeSP m_lldb_type; - public: TypeImpl() : - m_clang_ast_type(NULL), - m_lldb_type(lldb::TypeSP()) - {} + m_clang_ast_type(), + m_type_sp() + { + } TypeImpl(const TypeImpl& rhs) : - m_clang_ast_type(rhs.m_clang_ast_type.get()), - m_lldb_type(rhs.m_lldb_type) - {} + m_clang_ast_type(rhs.m_clang_ast_type), + m_type_sp(rhs.m_type_sp) + { + } + + TypeImpl(const lldb_private::ClangASTType& type); + + TypeImpl(const lldb::TypeSP& type); TypeImpl& operator = (const TypeImpl& rhs); @@ -320,31 +326,25 @@ public: bool operator == (const TypeImpl& rhs) { - return (m_clang_ast_type.get() == rhs.m_clang_ast_type.get()) && - (m_lldb_type.get() == rhs.m_lldb_type.get()); + return m_clang_ast_type == rhs.m_clang_ast_type && m_type_sp.get() == rhs.m_type_sp.get(); } bool operator != (const TypeImpl& rhs) { - return (m_clang_ast_type.get() != rhs.m_clang_ast_type.get()) || - (m_lldb_type.get() != rhs.m_lldb_type.get()); + return m_clang_ast_type != rhs.m_clang_ast_type || m_type_sp.get() != rhs.m_type_sp.get(); } - TypeImpl(const lldb_private::ClangASTType& type); - - TypeImpl(lldb::TypeSP type); - bool IsValid() { - return (m_lldb_type.get() != NULL) || (m_clang_ast_type.get() != NULL); + return m_type_sp.get() != NULL || m_clang_ast_type.IsValid(); } - lldb_private::ClangASTType* - GetClangASTType() + const lldb_private::ClangASTType & + GetClangASTType() const { - return m_clang_ast_type.get(); + return m_clang_ast_type; } clang::ASTContext* @@ -352,37 +352,43 @@ public: lldb::clang_type_t GetOpaqueQualType(); + +private: + ClangASTType m_clang_ast_type; + lldb::TypeSP m_type_sp; }; class TypeListImpl { public: TypeListImpl() : - m_content() {} + m_content() + { + } void - AppendType(TypeImpl& type) + Append (const lldb::TypeImplSP& type) { m_content.push_back(type); } - TypeImpl - GetTypeAtIndex(int index) + lldb::TypeImplSP + GetTypeAtIndex(size_t idx) { - if (index < 0 || index >= GetSize()) - return TypeImpl(); - - return m_content[index]; + lldb::TypeImplSP type_sp; + if (idx < GetSize()) + type_sp = m_content[idx]; + return type_sp; } - int + size_t GetSize() { return m_content.size(); } private: - std::vector<TypeImpl> m_content; + std::vector<lldb::TypeImplSP> m_content; }; diff --git a/include/lldb/lldb-forward-rtti.h b/include/lldb/lldb-forward-rtti.h index f154af4ea..b4eb8c6ee 100644 --- a/include/lldb/lldb-forward-rtti.h +++ b/include/lldb/lldb-forward-rtti.h @@ -74,6 +74,7 @@ namespace lldb { typedef SharedPtr<lldb_private::ThreadPlan>::Type ThreadPlanSP; typedef SharedPtr<lldb_private::ThreadPlanTracer>::Type ThreadPlanTracerSP; typedef SharedPtr<lldb_private::Type>::Type TypeSP; + typedef SharedPtr<lldb_private::TypeImpl>::Type TypeImplSP; typedef SharedPtr<lldb_private::FuncUnwinders>::Type FuncUnwindersSP; typedef SharedPtr<lldb_private::UserSettingsController>::Type UserSettingsControllerSP; typedef SharedPtr<lldb_private::UnwindPlan>::Type UnwindPlanSP; diff --git a/include/lldb/lldb-forward.h b/include/lldb/lldb-forward.h index b4025a622..d0d1c4120 100644 --- a/include/lldb/lldb-forward.h +++ b/include/lldb/lldb-forward.h @@ -163,8 +163,10 @@ class ThreadPlanTracer; class ThreadSpec; class TimeValue; class Type; +class TypeImpl; class TypeAndOrName; class TypeList; +class TypeListImpl; class UUID; class Unwind; class UnwindAssembly; diff --git a/lldb.xcodeproj/project.pbxproj b/lldb.xcodeproj/project.pbxproj index 394d6e85e..010397739 100644 --- a/lldb.xcodeproj/project.pbxproj +++ b/lldb.xcodeproj/project.pbxproj @@ -3420,10 +3420,10 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = dwarf; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 70; + DYLIB_CURRENT_VERSION = 71; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3472,11 +3472,11 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 70; + DYLIB_CURRENT_VERSION = 71; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3523,8 +3523,8 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 70; - DYLIB_CURRENT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; + DYLIB_CURRENT_VERSION = 71; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3562,9 +3562,9 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_CURRENT_VERSION = 70; + DYLIB_CURRENT_VERSION = 71; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3602,9 +3602,9 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_CURRENT_VERSION = 70; + DYLIB_CURRENT_VERSION = 71; EXECUTABLE_EXTENSION = a; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3672,7 +3672,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3703,11 +3703,11 @@ buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEAD_CODE_STRIPPING = YES; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 70; + DYLIB_CURRENT_VERSION = 71; EXPORTED_SYMBOLS_FILE = "resources/lldb-framework-exports"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3832,7 +3832,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = dwarf; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", @@ -3864,7 +3864,7 @@ isa = XCBuildConfiguration; buildSettings = { COPY_PHASE_STRIP = YES; - CURRENT_PROJECT_VERSION = 70; + CURRENT_PROJECT_VERSION = 71; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; FRAMEWORK_SEARCH_PATHS = ( "$(inherited)", diff --git a/resources/LLDB-Info.plist b/resources/LLDB-Info.plist index 029fa508d..83acf01ff 100644 --- a/resources/LLDB-Info.plist +++ b/resources/LLDB-Info.plist @@ -17,7 +17,7 @@ <key>CFBundleSignature</key> <string>????</string> <key>CFBundleVersion</key> - <string>70</string> + <string>71</string> <key>CFBundleName</key> <string>${EXECUTABLE_NAME}</string> </dict> diff --git a/scripts/Python/interface/SBType.i b/scripts/Python/interface/SBType.i index 03cfe4490..3bc4c9887 100644 --- a/scripts/Python/interface/SBType.i +++ b/scripts/Python/interface/SBType.i @@ -54,7 +54,7 @@ namespace lldb { SBTypeList(); void - AppendType(SBType type); + Append(const SBType& type); SBType GetTypeAtIndex(int index); diff --git a/scripts/Python/interface/SBValue.i b/scripts/Python/interface/SBValue.i index 24f966099..22186e1b8 100644 --- a/scripts/Python/interface/SBValue.i +++ b/scripts/Python/interface/SBValue.i @@ -82,14 +82,6 @@ public: size_t GetByteSize (); - %define DEPRECATED - "The method which takes an SBFrame is deprecated - SBValues know their own frames." - %enddef - - %feature("docstring", DEPRECATED) IsInScope; - bool - IsInScope (const lldb::SBFrame &frame); - bool IsInScope (); @@ -99,48 +91,30 @@ public: void SetFormat (lldb::Format format); - %feature("docstring", DEPRECATED) GetValue; - const char * - GetValue (const lldb::SBFrame &frame); - const char * GetValue (); + int64_t + GetValueAsSigned(int64_t fail_value=0); + + uint64_t + GetValueAsUnsigned(uint64_t fail_value=0); + ValueType GetValueType (); - %feature("docstring", DEPRECATED) GetValueDidChange; - bool - GetValueDidChange (const lldb::SBFrame &frame); - bool GetValueDidChange (); - %feature("docstring", DEPRECATED) GetSummary; - const char * - GetSummary (const lldb::SBFrame &frame); - const char * GetSummary (); - %feature("docstring", DEPRECATED) GetObjectDescription; - const char * - GetObjectDescription (const lldb::SBFrame &frame); - const char * GetObjectDescription (); - %feature("docstring", DEPRECATED) GetLocation; - const char * - GetLocation (const lldb::SBFrame &frame); - const char * GetLocation (); - %feature("docstring", DEPRECATED) SetValueFromCString; - bool - SetValueFromCString (const lldb::SBFrame &frame, const char *value_str); - bool SetValueFromCString (const char *value_str); diff --git a/source/API/SBFrame.cpp b/source/API/SBFrame.cpp index 3a0361e45..11ff15b41 100644 --- a/source/API/SBFrame.cpp +++ b/source/API/SBFrame.cpp @@ -768,8 +768,8 @@ SBFrame::EvaluateExpression (const char *expr, lldb::DynamicValueType fetch_dyna if (expr_log) expr_log->Printf("** [SBFrame::EvaluateExpression] Expression result is %s, summary %s **", - expr_result.GetValue(*this), - expr_result.GetSummary(*this)); + expr_result.GetValue(), + expr_result.GetSummary()); if (log) log->Printf ("SBFrame(%p)::EvaluateExpression (expr=\"%s\") => SBValue(%p)", m_opaque_sp.get(), diff --git a/source/API/SBModule.cpp b/source/API/SBModule.cpp index faeb5e9a5..21d137565 100644 --- a/source/API/SBModule.cpp +++ b/source/API/SBModule.cpp @@ -347,27 +347,24 @@ SBModule::FindGlobalVariables (SBTarget &target, const char *name, uint32_t max_ lldb::SBType SBModule::FindFirstType (const char* name_cstr) { - if (!IsValid()) - return lldb::SBType(); - - SymbolContext sc; - TypeList type_list; - uint32_t num_matches = 0; - ConstString name(name_cstr); - - num_matches = m_opaque_sp->FindTypes(sc, - name, - false, - 1, - type_list); - - if (num_matches) + SBType sb_type; + if (IsValid()) { - TypeSP type_sp (type_list.GetTypeAtIndex(0)); - return lldb::SBType(type_sp); + SymbolContext sc; + TypeList type_list; + uint32_t num_matches = 0; + ConstString name(name_cstr); + + num_matches = m_opaque_sp->FindTypes(sc, + name, + false, + 1, + type_list); + + if (num_matches) + sb_type = lldb::SBType(type_list.GetTypeAtIndex(0)); } - else - return lldb::SBType(); + return sb_type; } lldb::SBTypeList @@ -376,25 +373,25 @@ SBModule::FindTypes (const char* type) SBTypeList retval; - if (!IsValid()) - return retval; - - SymbolContext sc; - TypeList type_list; - uint32_t num_matches = 0; - ConstString name(type); - - num_matches = m_opaque_sp->FindTypes(sc, - name, - false, - UINT32_MAX, - type_list); - - for (size_t idx = 0; idx < num_matches; idx++) + if (IsValid()) { - TypeSP sp_at_idx = type_list.GetTypeAtIndex(idx); + SymbolContext sc; + TypeList type_list; + uint32_t num_matches = 0; + ConstString name(type); - retval.AppendType(SBType(sp_at_idx)); + num_matches = m_opaque_sp->FindTypes(sc, + name, + false, + UINT32_MAX, + type_list); + + for (size_t idx = 0; idx < num_matches; idx++) + { + TypeSP type_sp (type_list.GetTypeAtIndex(idx)); + if (type_sp) + retval.Append(SBType(type_sp)); + } } return retval; diff --git a/source/API/SBTarget.cpp b/source/API/SBTarget.cpp index 82da45a32..0367d65c9 100644 --- a/source/API/SBTarget.cpp +++ b/source/API/SBTarget.cpp @@ -918,9 +918,9 @@ SBTarget::FindTypes (const char* type) for (size_t idx = 0; idx < num_matches; idx++) { - TypeSP sp_at_idx = type_list.GetTypeAtIndex(idx); - - retval.AppendType(SBType(sp_at_idx)); + TypeSP type_sp (type_list.GetTypeAtIndex(idx)); + if (type_sp) + retval.Append(SBType(type_sp)); } } return retval; diff --git a/source/API/SBType.cpp b/source/API/SBType.cpp index b17dd8a14..b3ea2485c 100644 --- a/source/API/SBType.cpp +++ b/source/API/SBType.cpp @@ -14,60 +14,62 @@ #include "clang/AST/Type.h" #include "lldb/API/SBDefines.h" - #include "lldb/API/SBType.h" #include "lldb/API/SBStream.h" #include "lldb/Core/ConstString.h" #include "lldb/Core/Log.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/ClangASTType.h" +#include "lldb/Symbol/Type.h" using namespace lldb; using namespace lldb_private; using namespace clang; -SBType::SBType (lldb_private::ClangASTType type) : -m_opaque_ap(new TypeImpl(ClangASTType(type.GetASTContext(), - type.GetOpaqueQualType()))) +SBType::SBType() : + m_opaque_sp() { } -SBType::SBType (lldb::TypeSP type) : -m_opaque_ap(new TypeImpl(type)) -{} +SBType::SBType (const lldb_private::ClangASTType &type) : + m_opaque_sp(new TypeImpl(ClangASTType(type.GetASTContext(), + type.GetOpaqueQualType()))) +{ +} -SBType::SBType (const SBType &rhs) +SBType::SBType (const lldb::TypeSP &type_sp) : + m_opaque_sp(new TypeImpl(type_sp)) { - if (rhs.m_opaque_ap.get() != NULL) - { - m_opaque_ap = std::auto_ptr<TypeImpl>(new TypeImpl(ClangASTType(rhs.m_opaque_ap->GetASTContext(), - rhs.m_opaque_ap->GetOpaqueQualType()))); - } } -SBType::SBType (clang::ASTContext *ctx, clang_type_t ty) : -m_opaque_ap(new TypeImpl(ClangASTType(ctx, ty))) +SBType::SBType (const lldb::TypeImplSP &type_impl_sp) : + m_opaque_sp(type_impl_sp) { } + -SBType::SBType() : -m_opaque_ap(NULL) +SBType::SBType (const SBType &rhs) : + m_opaque_sp() { + if (this != &rhs) + { + m_opaque_sp = rhs.m_opaque_sp; + } } -SBType::SBType (TypeImpl impl) : -m_opaque_ap(&impl) -{} +//SBType::SBType (TypeImpl* impl) : +// m_opaque_ap(impl) +//{} +// bool SBType::operator == (const lldb::SBType &rhs) const { if (IsValid() == false) return !rhs.IsValid(); - return (rhs.m_opaque_ap->GetASTContext() == m_opaque_ap->GetASTContext()) - && - (rhs.m_opaque_ap->GetOpaqueQualType() == m_opaque_ap->GetOpaqueQualType()); + return (rhs.m_opaque_sp->GetASTContext() == m_opaque_sp->GetASTContext()) && + (rhs.m_opaque_sp->GetOpaqueQualType() == m_opaque_sp->GetOpaqueQualType()); } bool @@ -76,9 +78,8 @@ SBType::operator != (const lldb::SBType &rhs) const if (IsValid() == false) return rhs.IsValid(); - return (rhs.m_opaque_ap->GetASTContext() != m_opaque_ap->GetASTContext()) - || - (rhs.m_opaque_ap->GetOpaqueQualType() != m_opaque_ap->GetOpaqueQualType()); + return (rhs.m_opaque_sp->GetASTContext() != m_opaque_sp->GetASTContext()) || + (rhs.m_opaque_sp->GetOpaqueQualType() != m_opaque_sp->GetOpaqueQualType()); } @@ -87,11 +88,7 @@ SBType::operator = (const lldb::SBType &rhs) { if (*this != rhs) { - if (!rhs.IsValid()) - m_opaque_ap.reset(NULL); - else - m_opaque_ap = std::auto_ptr<TypeImpl>(new TypeImpl(ClangASTType(rhs.m_opaque_ap->GetASTContext(), - rhs.m_opaque_ap->GetOpaqueQualType()))); + m_opaque_sp = rhs.m_opaque_sp; } return *this; } @@ -102,9 +99,9 @@ SBType::~SBType () lldb_private::TypeImpl & SBType::ref () { - if (m_opaque_ap.get() == NULL) - m_opaque_ap.reset (new lldb_private::TypeImpl()); - return *m_opaque_ap; + if (m_opaque_sp.get() == NULL) + m_opaque_sp.reset (new lldb_private::TypeImpl()); + return *m_opaque_sp; } const lldb_private::TypeImpl & @@ -113,17 +110,17 @@ SBType::ref () const // "const SBAddress &addr" should already have checked "addr.IsValid()" // prior to calling this function. In case you didn't we will assert // and die to let you know. - assert (m_opaque_ap.get()); - return *m_opaque_ap; + assert (m_opaque_sp.get()); + return *m_opaque_sp; } bool SBType::IsValid() const { - if (m_opaque_ap.get() == NULL) + if (m_opaque_sp.get() == NULL) return false; - return m_opaque_ap->IsValid(); + return m_opaque_sp->IsValid(); } size_t @@ -132,7 +129,7 @@ SBType::GetByteSize() const if (!IsValid()) return 0; - return ClangASTType::GetTypeByteSize(m_opaque_ap->GetASTContext(), m_opaque_ap->GetOpaqueQualType()); + return ClangASTType::GetTypeByteSize(m_opaque_sp->GetASTContext(), m_opaque_sp->GetOpaqueQualType()); } @@ -142,7 +139,7 @@ SBType::IsPointerType() const if (!IsValid()) return false; - QualType qt = QualType::getFromOpaquePtr(m_opaque_ap->GetOpaqueQualType()); + QualType qt = QualType::getFromOpaquePtr(m_opaque_sp->GetOpaqueQualType()); const clang::Type* typePtr = qt.getTypePtrOrNull(); if (typePtr) @@ -156,7 +153,7 @@ SBType::IsReferenceType() const if (!IsValid()) return false; - QualType qt = QualType::getFromOpaquePtr(m_opaque_ap->GetOpaqueQualType()); + QualType qt = QualType::getFromOpaquePtr(m_opaque_sp->GetOpaqueQualType()); const clang::Type* typePtr = qt.getTypePtrOrNull(); if (typePtr) @@ -170,8 +167,8 @@ SBType::GetPointerType() const if (!IsValid()) return SBType(); - return SBType(m_opaque_ap->GetASTContext(), - ClangASTContext::CreatePointerType(m_opaque_ap->GetASTContext(), m_opaque_ap->GetOpaqueQualType())); + return SBType(ClangASTType(m_opaque_sp->GetASTContext(), + ClangASTContext::CreatePointerType(m_opaque_sp->GetASTContext(), m_opaque_sp->GetOpaqueQualType()))); } SBType @@ -180,11 +177,11 @@ SBType::GetPointeeType() const if (!IsValid()) return SBType(); - QualType qt = QualType::getFromOpaquePtr(m_opaque_ap->GetOpaqueQualType()); + QualType qt = QualType::getFromOpaquePtr(m_opaque_sp->GetOpaqueQualType()); const clang::Type* typePtr = qt.getTypePtrOrNull(); if (typePtr) - return SBType(m_opaque_ap->GetASTContext(),typePtr->getPointeeType().getAsOpaquePtr()); + return SBType(ClangASTType(m_opaque_sp->GetASTContext(),typePtr->getPointeeType().getAsOpaquePtr())); return SBType(); } @@ -194,8 +191,8 @@ SBType::GetReferenceType() const if (!IsValid()) return SBType(); - return SBType(m_opaque_ap->GetASTContext(), - ClangASTContext::CreateLValueReferenceType(m_opaque_ap->GetASTContext(), m_opaque_ap->GetOpaqueQualType())); + return SBType(ClangASTType(m_opaque_sp->GetASTContext(), + ClangASTContext::CreateLValueReferenceType(m_opaque_sp->GetASTContext(), m_opaque_sp->GetOpaqueQualType()))); } SBType @@ -204,9 +201,9 @@ SBType::GetDereferencedType() const if (!IsValid()) return SBType(); - QualType qt = QualType::getFromOpaquePtr(m_opaque_ap->GetOpaqueQualType()); + QualType qt = QualType::getFromOpaquePtr(m_opaque_sp->GetOpaqueQualType()); - return SBType(m_opaque_ap->GetASTContext(),qt.getNonReferenceType().getAsOpaquePtr()); + return SBType(ClangASTType(m_opaque_sp->GetASTContext(),qt.getNonReferenceType().getAsOpaquePtr())); } SBType @@ -221,89 +218,88 @@ SBType::GetBasicType(lldb::BasicType type) const switch (type) { case eBasicTypeChar: - base_type_qual = m_opaque_ap->GetASTContext()->CharTy; + base_type_qual = m_opaque_sp->GetASTContext()->CharTy; break; case eBasicTypeSignedChar: - base_type_qual = m_opaque_ap->GetASTContext()->SignedCharTy; + base_type_qual = m_opaque_sp->GetASTContext()->SignedCharTy; break; case eBasicTypeShort: - base_type_qual = m_opaque_ap->GetASTContext()->ShortTy; + base_type_qual = m_opaque_sp->GetASTContext()->ShortTy; break; case eBasicTypeUnsignedShort: - base_type_qual = m_opaque_ap->GetASTContext()->UnsignedShortTy; + base_type_qual = m_opaque_sp->GetASTContext()->UnsignedShortTy; break; case eBasicTypeInt: - base_type_qual = m_opaque_ap->GetASTContext()->IntTy; + base_type_qual = m_opaque_sp->GetASTContext()->IntTy; break; case eBasicTypeUnsignedInt: - base_type_qual = m_opaque_ap->GetASTContext()->UnsignedIntTy; + base_type_qual = m_opaque_sp->GetASTContext()->UnsignedIntTy; break; case eBasicTypeLong: - base_type_qual = m_opaque_ap->GetASTContext()->LongTy; + base_type_qual = m_opaque_sp->GetASTContext()->LongTy; break; case eBasicTypeUnsignedLong: - base_type_qual = m_opaque_ap->GetASTContext()->UnsignedLongTy; + base_type_qual = m_opaque_sp->GetASTContext()->UnsignedLongTy; break; case eBasicTypeBool: - base_type_qual = m_opaque_ap->GetASTContext()->BoolTy; + base_type_qual = m_opaque_sp->GetASTContext()->BoolTy; break; case eBasicTypeFloat: - base_type_qual = m_opaque_ap->GetASTContext()->FloatTy; + base_type_qual = m_opaque_sp->GetASTContext()->FloatTy; break; case eBasicTypeDouble: - base_type_qual = m_opaque_ap->GetASTContext()->DoubleTy; + base_type_qual = m_opaque_sp->GetASTContext()->DoubleTy; break; case eBasicTypeObjCID: - base_type_qual = m_opaque_ap->GetASTContext()->ObjCBuiltinIdTy; + base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinIdTy; break; case eBasicTypeVoid: - base_type_qual = m_opaque_ap->GetASTContext()->VoidTy; + base_type_qual = m_opaque_sp->GetASTContext()->VoidTy; break; case eBasicTypeWChar: - base_type_qual = m_opaque_ap->GetASTContext()->WCharTy; + base_type_qual = m_opaque_sp->GetASTContext()->WCharTy; break; case eBasicTypeChar16: - base_type_qual = m_opaque_ap->GetASTContext()->Char16Ty; + base_type_qual = m_opaque_sp->GetASTContext()->Char16Ty; break; case eBasicTypeChar32: - base_type_qual = m_opaque_ap->GetASTContext()->Char32Ty; + base_type_qual = m_opaque_sp->GetASTContext()->Char32Ty; break; case eBasicTypeLongLong: - base_type_qual = m_opaque_ap->GetASTContext()->LongLongTy; + base_type_qual = m_opaque_sp->GetASTContext()->LongLongTy; break; case eBasicTypeUnsignedLongLong: - base_type_qual = m_opaque_ap->GetASTContext()->UnsignedLongLongTy; + base_type_qual = m_opaque_sp->GetASTContext()->UnsignedLongLongTy; break; case eBasicTypeInt128: - base_type_qual = m_opaque_ap->GetASTContext()->Int128Ty; + base_type_qual = m_opaque_sp->GetASTContext()->Int128Ty; break; case eBasicTypeUnsignedInt128: - base_type_qual = m_opaque_ap->GetASTContext()->UnsignedInt128Ty; + base_type_qual = m_opaque_sp->GetASTContext()->UnsignedInt128Ty; break; case eBasicTypeLongDouble: - base_type_qual = m_opaque_ap->GetASTContext()->LongDoubleTy; + base_type_qual = m_opaque_sp->GetASTContext()->LongDoubleTy; break; case eBasicTypeFloatComplex: - base_type_qual = m_opaque_ap->GetASTContext()->FloatComplexTy; + base_type_qual = m_opaque_sp->GetASTContext()->FloatComplexTy; break; case eBasicTypeDoubleComplex: - base_type_qual = m_opaque_ap->GetASTContext()->DoubleComplexTy; + base_type_qual = m_opaque_sp->GetASTContext()->DoubleComplexTy; break; case eBasicTypeLongDoubleComplex: - base_type_qual = m_opaque_ap->GetASTContext()->LongDoubleComplexTy; + base_type_qual = m_opaque_sp->GetASTContext()->LongDoubleComplexTy; break; case eBasicTypeObjCClass: - base_type_qual = m_opaque_ap->GetASTContext()->ObjCBuiltinClassTy; + base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinClassTy; break; case eBasicTypeObjCSel: - base_type_qual = m_opaque_ap->GetASTContext()->ObjCBuiltinSelTy; + base_type_qual = m_opaque_sp->GetASTContext()->ObjCBuiltinSelTy; break; default: return SBType(); } - return SBType(m_opaque_ap->GetASTContext(), - base_type_qual.getAsOpaquePtr()); + return SBType(ClangASTType(m_opaque_sp->GetASTContext(), base_type_qual.getAsOpaquePtr())); } const char* @@ -312,38 +308,38 @@ SBType::GetName() if (!IsValid()) return ""; - return ClangASTType::GetConstTypeName(m_opaque_ap->GetOpaqueQualType()).GetCString(); + return ClangASTType::GetConstTypeName(m_opaque_sp->GetOpaqueQualType()).GetCString(); } SBTypeList::SBTypeList() : -m_opaque_ap(new TypeListImpl()) + m_opaque_ap(new TypeListImpl()) { } SBTypeList::SBTypeList(const SBTypeList& rhs) : -m_opaque_ap(new TypeListImpl()) + m_opaque_ap(new TypeListImpl()) { - for (int j = 0; j < rhs.GetSize(); j++) - AppendType(rhs.GetTypeAtIndex(j)); + for (uint32_t i = 0, rhs_size = rhs.GetSize(); i < rhs_size; i++) + Append(rhs.GetTypeAtIndex(i)); } SBTypeList& SBTypeList::operator = (const SBTypeList& rhs) { - if (m_opaque_ap.get() != rhs.m_opaque_ap.get()) + if (this != &rhs && m_opaque_ap.get() != rhs.m_opaque_ap.get()) { m_opaque_ap.reset(new TypeListImpl()); - for (int j = 0; j < rhs.GetSize(); j++) - AppendType(rhs.GetTypeAtIndex(j)); + for (uint32_t i = 0, rhs_size = rhs.GetSize(); i < rhs_size; i++) + Append(rhs.GetTypeAtIndex(i)); } return *this; } void -SBTypeList::AppendType(SBType type) +SBTypeList::Append (const SBType& type) { if (type.IsValid()) - m_opaque_ap->AppendType(*type.m_opaque_ap.get()); + m_opaque_ap->Append (type.m_opaque_sp); } SBType diff --git a/source/API/SBValue.cpp b/source/API/SBValue.cpp index 2973457f0..d874cc2fa 100644 --- a/source/API/SBValue.cpp +++ b/source/API/SBValue.cpp @@ -13,6 +13,7 @@ #include "lldb/Core/DataExtractor.h" #include "lldb/Core/Log.h" #include "lldb/Core/Module.h" +#include "lldb/Core/Scalar.h" #include "lldb/Core/Stream.h" #include "lldb/Core/StreamFile.h" #include "lldb/Core/Value.h" @@ -270,8 +271,7 @@ SBValue::GetType() if (m_opaque_sp->GetUpdatePoint().GetTargetSP()) { Mutex::Locker api_locker (m_opaque_sp->GetUpdatePoint().GetTargetSP()->GetAPIMutex()); - result = SBType(m_opaque_sp->GetClangAST(), - m_opaque_sp->GetClangType()); + result = SBType(ClangASTType (m_opaque_sp->GetClangAST(), m_opaque_sp->GetClangType())); } } LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); @@ -391,7 +391,7 @@ SBValue::CreateChildAtOffset (const char *name, uint32_t offset, const SBType& t { if (type.IsValid()) { - result = SBValue(m_opaque_sp->GetSyntheticChildAtOffset(offset, *type.m_opaque_ap->GetClangASTType(), true)); + result = SBValue(m_opaque_sp->GetSyntheticChildAtOffset(offset, type.m_opaque_sp->GetClangASTType(), true)); result.m_opaque_sp->SetName(ConstString(name)); } } @@ -449,8 +449,8 @@ SBValue::CreateValueFromAddress(const char* name, lldb::addr_t address, const SB lldb::DataBufferSP buffer(new lldb_private::DataBufferHeap(&address,sizeof(lldb::addr_t))); ValueObjectSP result_valobj_sp(ValueObjectConstResult::Create(m_opaque_sp->GetUpdatePoint().GetExecutionContextScope(), - real_type.m_opaque_ap->GetASTContext(), - real_type.m_opaque_ap->GetOpaqueQualType(), + real_type.m_opaque_sp->GetASTContext(), + real_type.m_opaque_sp->GetOpaqueQualType(), ConstString(name), buffer, lldb::endian::InlHostByteOrder(), @@ -618,6 +618,38 @@ SBValue::GetValueForExpressionPath(const char* expr_path) return sb_value; } +int64_t +SBValue::GetValueAsSigned(int64_t fail_value) +{ + if (m_opaque_sp) + { + if (m_opaque_sp->GetUpdatePoint().GetTargetSP()) + { + Mutex::Locker api_locker (m_opaque_sp->GetUpdatePoint().GetTargetSP()->GetAPIMutex()); + Scalar scalar; + if (m_opaque_sp->ResolveValue (scalar)) + return scalar.GetRawBits64(fail_value); + } + } + return fail_value; +} + +uint64_t +SBValue::GetValueAsUnsigned(uint64_t fail_value) +{ + if (m_opaque_sp) + { + if (m_opaque_sp->GetUpdatePoint().GetTargetSP()) + { + Mutex::Locker api_locker (m_opaque_sp->GetUpdatePoint().GetTargetSP()->GetAPIMutex()); + Scalar scalar; + if (m_opaque_sp->ResolveValue (scalar)) + return scalar.GetRawBits64(fail_value); + } + } + return fail_value; +} + uint32_t SBValue::GetNumChildren () { diff --git a/source/Symbol/ClangASTType.cpp b/source/Symbol/ClangASTType.cpp index 6f57347b2..167269452 100644 --- a/source/Symbol/ClangASTType.cpp +++ b/source/Symbol/ClangASTType.cpp @@ -1606,3 +1606,17 @@ ClangASTType::RemoveFastQualifiers (lldb::clang_type_t clang_type) qual_type.getQualifiers().removeFastQualifiers(); return qual_type.getAsOpaquePtr(); } + + +bool +lldb_private::operator == (const lldb_private::ClangASTType &lhs, const lldb_private::ClangASTType &rhs) +{ + return lhs.GetASTContext() == rhs.GetASTContext() && lhs.GetOpaqueQualType() == rhs.GetOpaqueQualType(); +} + + +bool +lldb_private::operator != (const lldb_private::ClangASTType &lhs, const lldb_private::ClangASTType &rhs) +{ + return lhs.GetASTContext() != rhs.GetASTContext() || lhs.GetOpaqueQualType() != rhs.GetOpaqueQualType(); +} diff --git a/source/Symbol/Type.cpp b/source/Symbol/Type.cpp index 1717118a5..67f2e8026 100644 --- a/source/Symbol/Type.cpp +++ b/source/Symbol/Type.cpp @@ -731,25 +731,24 @@ TypeAndOrName::IsEmpty() return true; } -TypeImpl::TypeImpl(const lldb_private::ClangASTType& type) : -m_clang_ast_type(new ClangASTType(type.GetASTContext(), - type.GetOpaqueQualType())), -m_lldb_type(lldb::TypeSP()) +TypeImpl::TypeImpl(const lldb_private::ClangASTType& clang_ast_type) : + m_clang_ast_type(clang_ast_type.GetASTContext(), clang_ast_type.GetOpaqueQualType()), + m_type_sp() {} -TypeImpl::TypeImpl(lldb::TypeSP type) : -m_clang_ast_type(new ClangASTType(type->GetClangAST(), - type->GetClangFullType())), -m_lldb_type(type) -{} +TypeImpl::TypeImpl(const lldb::TypeSP& type) : + m_clang_ast_type(type->GetClangAST(), type->GetClangFullType()), + m_type_sp(type) +{ +} TypeImpl& TypeImpl::operator = (const TypeImpl& rhs) { if (*this != rhs) { - m_clang_ast_type = std::auto_ptr<ClangASTType>(rhs.m_clang_ast_type.get()); - m_lldb_type = lldb::TypeSP(rhs.m_lldb_type); + m_clang_ast_type = rhs.m_clang_ast_type; + m_type_sp = rhs.m_type_sp; } return *this; } @@ -760,7 +759,7 @@ TypeImpl::GetASTContext() if (!IsValid()) return NULL; - return m_clang_ast_type->GetASTContext(); + return m_clang_ast_type.GetASTContext(); } lldb::clang_type_t @@ -769,5 +768,5 @@ TypeImpl::GetOpaqueQualType() if (!IsValid()) return NULL; - return m_clang_ast_type->GetOpaqueQualType(); + return m_clang_ast_type.GetOpaqueQualType(); } diff --git a/test/expression_command/test/TestExprs.py b/test/expression_command/test/TestExprs.py index 69498f1f8..fe60b3e97 100644 --- a/test/expression_command/test/TestExprs.py +++ b/test/expression_command/test/TestExprs.py @@ -134,29 +134,29 @@ class BasicExprCommandsTestCase(TestBase): frame = thread.GetFrameAtIndex(0) val = frame.EvaluateExpression("2.234") - self.expect(val.GetValue(frame), "2.345 evaluated correctly", exe=False, + self.expect(val.GetValue(), "2.345 evaluated correctly", exe=False, startstr = "2.234") self.expect(val.GetTypeName(), "2.345 evaluated correctly", exe=False, startstr = "double") self.DebugSBValue(val) val = frame.EvaluateExpression("argc") - self.expect(val.GetValue(frame), "Argc evaluated correctly", exe=False, + self.expect(val.GetValue(), "Argc evaluated correctly", exe=False, startstr = "4") self.DebugSBValue(val) val = frame.EvaluateExpression("*argv[1]") - self.expect(val.GetValue(frame), "Argv[1] evaluated correctly", exe=False, + self.expect(val.GetValue(), "Argv[1] evaluated correctly", exe=False, startstr = "'X'") self.DebugSBValue(val) val = frame.EvaluateExpression("*argv[2]") - self.expect(val.GetValue(frame), "Argv[2] evaluated correctly", exe=False, + self.expect(val.GetValue(), "Argv[2] evaluated correctly", exe=False, startstr = "'Y'") self.DebugSBValue(val) val = frame.EvaluateExpression("*argv[3]") - self.expect(val.GetValue(frame), "Argv[3] evaluated correctly", exe=False, + self.expect(val.GetValue(), "Argv[3] evaluated correctly", exe=False, startstr = "'Z'") self.DebugSBValue(val) diff --git a/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py b/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py index b92231978..75653fae8 100644 --- a/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py +++ b/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py @@ -149,7 +149,7 @@ class BreakpointConditionsTestCase(TestBase): frame0 = thread.GetFrameAtIndex(0) var = frame0.FindValue('val', lldb.eValueTypeVariableArgument) self.assertTrue(frame0.GetLineEntry().GetLine() == self.line1 and - var.GetValue(frame0) == '3') + var.GetValue() == '3') # The hit count for the breakpoint should be 3. self.assertTrue(breakpoint.GetHitCount() == 3) diff --git a/test/functionalities/conditional_break/TestConditionalBreak.py b/test/functionalities/conditional_break/TestConditionalBreak.py index 51b5c2206..a19ff3c97 100644 --- a/test/functionalities/conditional_break/TestConditionalBreak.py +++ b/test/functionalities/conditional_break/TestConditionalBreak.py @@ -90,7 +90,7 @@ class ConditionalBreakTestCase(TestBase): # And the local variable 'val' should have a value of (int) 3. val = frame1.FindVariable("val") self.assertTrue(val.GetTypeName() == "int", "'val' has int type") - self.assertTrue(val.GetValue(frame1) == "3", "'val' has a value of 3") + self.assertTrue(val.GetValue() == "3", "'val' has a value of 3") break process.Continue() diff --git a/test/lang/c/array_types/TestArrayTypes.py b/test/lang/c/array_types/TestArrayTypes.py index f43b87c9f..7aca609d8 100644 --- a/test/lang/c/array_types/TestArrayTypes.py +++ b/test/lang/c/array_types/TestArrayTypes.py @@ -161,7 +161,7 @@ class ArrayTypesTestCase(TestBase): child3 = variable.GetChildAtIndex(3) self.DebugSBValue(child3) - self.assertTrue(child3.GetSummary(frame) == '"Guten Tag"', + self.assertTrue(child3.GetSummary() == '"Guten Tag"', 'strings[3] == "Guten Tag"') # Lookup the "char_16" char array variable. @@ -171,7 +171,7 @@ class ArrayTypesTestCase(TestBase): "Variable 'char_16' should have 16 children") # Lookup the "ushort_matrix" ushort[] array variable. - # Notice the pattern of int(child0_2.GetValue(frame), 0). We pass a + # Notice the pattern of int(child0_2.GetValue(), 0). We pass a # base of 0 so that the proper radix is determined based on the contents # of the string. Same applies to long(). variable = frame.FindVariable("ushort_matrix") @@ -184,7 +184,7 @@ class ArrayTypesTestCase(TestBase): "Variable 'ushort_matrix[0]' should have 3 children") child0_2 = child0.GetChildAtIndex(2) self.DebugSBValue(child0_2) - self.assertTrue(int(child0_2.GetValue(frame), 0) == 3, + self.assertTrue(int(child0_2.GetValue(), 0) == 3, "ushort_matrix[0][2] == 3") # Lookup the "long_6" char array variable. @@ -194,7 +194,7 @@ class ArrayTypesTestCase(TestBase): "Variable 'long_6' should have 6 children") child5 = variable.GetChildAtIndex(5) self.DebugSBValue(child5) - self.assertTrue(long(child5.GetValue(frame), 0) == 6, + self.assertTrue(long(child5.GetValue(), 0) == 6, "long_6[5] == 6") # Last, check that "long_6" has a value type of eValueTypeVariableLocal diff --git a/test/lang/c/bitfields/TestBitfields.py b/test/lang/c/bitfields/TestBitfields.py index 72b5ed2c3..34fe7420a 100644 --- a/test/lang/c/bitfields/TestBitfields.py +++ b/test/lang/c/bitfields/TestBitfields.py @@ -116,31 +116,31 @@ class BitfieldsTestCase(TestBase): bits.GetByteSize() == 4, "(Bits)bits with byte size of 4 and 8 children") - # Notice the pattern of int(b1.GetValue(frame), 0). We pass a base of 0 + # Notice the pattern of int(b1.GetValue(), 0). We pass a base of 0 # so that the proper radix is determined based on the contents of the # string. b1 = bits.GetChildAtIndex(0) self.DebugSBValue(b1) self.assertTrue(b1.GetName() == "b1" and b1.GetTypeName() == "uint32_t:1" and - b1.IsInScope(frame) and - int(b1.GetValue(frame), 0) == 1, + b1.IsInScope() and + int(b1.GetValue(), 0) == 1, 'bits.b1 has type uint32_t:1, is in scope, and == 1') b7 = bits.GetChildAtIndex(6) self.DebugSBValue(b7) self.assertTrue(b7.GetName() == "b7" and b7.GetTypeName() == "uint32_t:7" and - b7.IsInScope(frame) and - int(b7.GetValue(frame), 0) == 127, + b7.IsInScope() and + int(b7.GetValue(), 0) == 127, 'bits.b7 has type uint32_t:7, is in scope, and == 127') four = bits.GetChildAtIndex(7) self.DebugSBValue(four) self.assertTrue(four.GetName() == "four" and four.GetTypeName() == "uint32_t:4" and - four.IsInScope(frame) and - int(four.GetValue(frame), 0) == 15, + four.IsInScope() and + int(four.GetValue(), 0) == 15, 'bits.four has type uint32_t:4, is in scope, and == 15') # Now kill the process, and we are done. diff --git a/test/lang/cpp/class_static/TestStaticVariables.py b/test/lang/cpp/class_static/TestStaticVariables.py index a7297d759..51545344a 100644 --- a/test/lang/cpp/class_static/TestStaticVariables.py +++ b/test/lang/cpp/class_static/TestStaticVariables.py @@ -116,7 +116,7 @@ class StaticVariableTestCase(TestBase): child1_x = child1.GetChildAtIndex(0) self.DebugSBValue(child1_x) self.assertTrue(child1_x.GetTypeName() == 'int' and - child1_x.GetValue(frame) == '11') + child1_x.GetValue() == '11') # SBFrame.FindValue() should also work. val = frame.FindValue("A::g_points", lldb.eValueTypeVariableGlobal) diff --git a/test/lang/objc/foundation/TestObjCMethods.py b/test/lang/objc/foundation/TestObjCMethods.py index 1461c3b85..a5d497c14 100644 --- a/test/lang/objc/foundation/TestObjCMethods.py +++ b/test/lang/objc/foundation/TestObjCMethods.py @@ -240,9 +240,9 @@ class FoundationTestCase(TestBase): my_str_var = my_var.GetChildMemberWithName("str") self.assertTrue(my_str_var, "Found a str ivar in my") - str_value = int(str_var.GetValue(cur_frame), 0) + str_value = int(str_var.GetValue(), 0) - my_str_value = int(my_str_var.GetValue(cur_frame), 0) + my_str_value = int(my_str_var.GetValue(), 0) self.assertTrue(str_value == my_str_value, "Got the correct value for my->str") diff --git a/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py b/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py index 066e9e4f8..930865832 100644 --- a/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py +++ b/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py @@ -58,14 +58,14 @@ class TestObjCIvarOffsets(TestBase): mine_backed_int = mine.GetChildMemberWithName ("_backed_int") self.assertTrue(mine_backed_int, "Found mine->backed_int local variable.") - backed_value = int (mine_backed_int.GetValue (frame), 0) + backed_value = int (mine_backed_int.GetValue (), 0) self.assertTrue (backed_value == 1111) # Test the value object value for DerivedClass->_derived_backed_int mine_derived_backed_int = mine.GetChildMemberWithName ("_derived_backed_int") self.assertTrue(mine_derived_backed_int, "Found mine->derived_backed_int local variable.") - derived_backed_value = int (mine_derived_backed_int.GetValue (frame), 0) + derived_backed_value = int (mine_derived_backed_int.GetValue (), 0) self.assertTrue (derived_backed_value == 3333) if __name__ == '__main__': diff --git a/test/lang/objc/objc-stepping/TestObjCStepping.py b/test/lang/objc/objc-stepping/TestObjCStepping.py index 9db97908e..67482e525 100644 --- a/test/lang/objc/objc-stepping/TestObjCStepping.py +++ b/test/lang/objc/objc-stepping/TestObjCStepping.py @@ -84,7 +84,7 @@ class TestObjCStepping(TestBase): self.assertTrue(mySource, "Found mySource local variable.") mySource_isa = mySource.GetChildMemberWithName ("isa") self.assertTrue(mySource_isa, "Found mySource->isa local variable.") - mySource_isa.GetValue (thread.GetFrameAtIndex(0)) + mySource_isa.GetValue () # Lets delete mySource so we can check that after stepping a child variable # with no parent persists and is useful. @@ -125,8 +125,8 @@ class TestObjCStepping(TestBase): line_number = frame.GetLineEntry().GetLine() self.assertTrue (line_number == self.line3, "Continued to third breakpoint in main, our object should now be swizzled.") - mySource_isa.GetValue (frame) - did_change = mySource_isa.GetValueDidChange (frame) + mySource_isa.GetValue () + did_change = mySource_isa.GetValueDidChange () self.assertTrue (did_change, "The isa did indeed change, swizzled!") diff --git a/test/lldbutil.py b/test/lldbutil.py index 8fde6079e..a48f3a341 100644 --- a/test/lldbutil.py +++ b/test/lldbutil.py @@ -447,7 +447,7 @@ def get_args_as_string(frame, showFuncName=True): for var in vars: args.append("(%s)%s=%s" % (var.GetTypeName(), var.GetName(), - var.GetValue(frame))) + var.GetValue())) if frame.GetFunction(): name = frame.GetFunction().GetName() elif frame.GetSymbol(): @@ -472,7 +472,7 @@ def print_registers(frame, string_buffer = False): #print >> output, value print >> output, "%s (number of children = %d):" % (value.GetName(), value.GetNumChildren()) for child in value: - print >> output, "Name: %s, Value: %s" % (child.GetName(), child.GetValue(frame)) + print >> output, "Name: %s, Value: %s" % (child.GetName(), child.GetValue()) if string_buffer: return output.getvalue() diff --git a/test/python_api/frame/TestFrames.py b/test/python_api/frame/TestFrames.py index e9b1ed199..5872e63f2 100644 --- a/test/python_api/frame/TestFrames.py +++ b/test/python_api/frame/TestFrames.py @@ -77,7 +77,7 @@ class FrameAPITestCase(TestBase): for val in valList: argList.append("(%s)%s=%s" % (val.GetTypeName(), val.GetName(), - val.GetValue(frame))) + val.GetValue())) print >> session, "%s(%s)" % (name, ", ".join(argList)) # Also check the generic pc & stack pointer. We can't test their absolute values, @@ -85,10 +85,10 @@ class FrameAPITestCase(TestBase): gpr_reg_set = lldbutil.get_GPRs(frame) pc_value = gpr_reg_set.GetChildMemberWithName("pc") self.assertTrue (pc_value, "We should have a valid PC.") - self.assertTrue (int(pc_value.GetValue(frame), 0) == frame.GetPC(), "PC gotten as a value should equal frame's GetPC") + self.assertTrue (int(pc_value.GetValue(), 0) == frame.GetPC(), "PC gotten as a value should equal frame's GetPC") sp_value = gpr_reg_set.GetChildMemberWithName("sp") self.assertTrue (sp_value, "We should have a valid Stack Pointer.") - self.assertTrue (int(sp_value.GetValue(frame), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP") + self.assertTrue (int(sp_value.GetValue(), 0) == frame.GetSP(), "SP gotten as a value should equal frame's GetSP") print >> session, "---" process.Continue() diff --git a/test/python_api/lldbutil/iter/TestRegistersIterator.py b/test/python_api/lldbutil/iter/TestRegistersIterator.py index a869d5bcc..069243b85 100644 --- a/test/python_api/lldbutil/iter/TestRegistersIterator.py +++ b/test/python_api/lldbutil/iter/TestRegistersIterator.py @@ -54,7 +54,7 @@ class RegistersIteratorTestCase(TestBase): for reg in REGs: self.assertTrue(reg) if self.TraceOn(): - print "%s => %s" % (reg.GetName(), reg.GetValue(frame)) + print "%s => %s" % (reg.GetName(), reg.GetValue()) REGs = lldbutil.get_FPRs(frame) num = len(REGs) @@ -63,7 +63,7 @@ class RegistersIteratorTestCase(TestBase): for reg in REGs: self.assertTrue(reg) if self.TraceOn(): - print "%s => %s" % (reg.GetName(), reg.GetValue(frame)) + print "%s => %s" % (reg.GetName(), reg.GetValue()) REGs = lldbutil.get_ESRs(frame) num = len(REGs) @@ -72,7 +72,7 @@ class RegistersIteratorTestCase(TestBase): for reg in REGs: self.assertTrue(reg) if self.TraceOn(): - print "%s => %s" % (reg.GetName(), reg.GetValue(frame)) + print "%s => %s" % (reg.GetName(), reg.GetValue()) # And these should also work. for kind in ["General Purpose Registers", diff --git a/test/python_api/process/TestProcessAPI.py b/test/python_api/process/TestProcessAPI.py index a423bfeb4..2d68d8503 100644 --- a/test/python_api/process/TestProcessAPI.py +++ b/test/python_api/process/TestProcessAPI.py @@ -86,11 +86,11 @@ class ProcessAPITestCase(TestBase): self.DebugSBValue(val) # If the variable does not have a load address, there's no sense continuing. - if not val.GetLocation(frame).startswith("0x"): + if not val.GetLocation().startswith("0x"): return # OK, let's get the hex location of the variable. - location = int(val.GetLocation(frame), 16) + location = int(val.GetLocation(), 16) # Due to the typemap magic (see lldb.swig), we pass in 1 to ReadMemory and # expect to get a Python string as the result object! @@ -128,11 +128,11 @@ class ProcessAPITestCase(TestBase): self.DebugSBValue(val) # If the variable does not have a load address, there's no sense continuing. - if not val.GetLocation(frame).startswith("0x"): + if not val.GetLocation().startswith("0x"): return # OK, let's get the hex location of the variable. - location = int(val.GetLocation(frame), 16) + location = int(val.GetLocation(), 16) # The program logic makes the 'my_char' variable to have memory content as 'x'. # But we want to use the WriteMemory() API to assign 'a' to the variable. @@ -179,11 +179,11 @@ class ProcessAPITestCase(TestBase): self.DebugSBValue(val) # If the variable does not have a load address, there's no sense continuing. - if not val.GetLocation(frame).startswith("0x"): + if not val.GetLocation().startswith("0x"): return # OK, let's get the hex location of the variable. - location = int(val.GetLocation(frame), 16) + location = int(val.GetLocation(), 16) # Note that the canonical from of the bytearray is little endian. from lldbutil import int_to_bytearray, bytearray_to_int @@ -212,14 +212,14 @@ class ProcessAPITestCase(TestBase): self.fail("SBProcess.WriteMemory() failed") # Make sure that the val we got originally updates itself to notice the change: - self.expect(val.GetValue(frame), + self.expect(val.GetValue(), "SBProcess.ReadMemory() successfully writes (int)256 to the memory location for 'my_int'", exe=False, startstr = '256') # And for grins, get the SBValue for the global variable 'my_int' again, to make sure that also tracks the new value: val = frame.FindValue("my_int", lldb.eValueTypeVariableGlobal) - self.expect(val.GetValue(frame), + self.expect(val.GetValue(), "SBProcess.ReadMemory() successfully writes (int)256 to the memory location for 'my_int'", exe=False, startstr = '256') |