[Lldb-commits] [lldb] r136829 - in /lldb/trunk: include/lldb/ include/lldb/API/ include/lldb/Symbol/ lldb.xcodeproj/ resources/ scripts/Python/interface/ source/API/ source/Symbol/ test/ test/expression_command/test/ test/functionalities/breakpoint/breakpoint_conditions/ test/functionalities/conditional_break/ test/lang/c/array_types/ test/lang/c/bitfields/ test/lang/cpp/class_static/ test/lang/objc/foundation/ test/lang/objc/objc-ivar-offsets/ test/lang/objc/objc-stepping/ test/python_api/frame/ test/python_api/lldbut...
Greg Clayton
gclayton at apple.com
Wed Aug 3 15:57:10 PDT 2011
Author: gclayton
Date: Wed Aug 3 17:57:10 2011
New Revision: 136829
URL: http://llvm.org/viewvc/llvm-project?rev=136829&view=rev
Log:
Cleaned up the SBType.h file to not include internal headers and reorganized
the SBType implementation classes.
Fixed LLDB core and the test suite to not use deprecated SBValue APIs.
Added a few new APIs to SBValue:
int64_t
SBValue::GetValueAsSigned(int64_t fail_value=0);
uint64_t
SBValue::GetValueAsUnsigned(uint64_t fail_value=0)
Modified:
lldb/trunk/include/lldb/API/SBBreakpoint.h
lldb/trunk/include/lldb/API/SBType.h
lldb/trunk/include/lldb/API/SBValue.h
lldb/trunk/include/lldb/Symbol/ClangASTType.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/include/lldb/lldb-forward-rtti.h
lldb/trunk/include/lldb/lldb-forward.h
lldb/trunk/lldb.xcodeproj/project.pbxproj
lldb/trunk/resources/LLDB-Info.plist
lldb/trunk/scripts/Python/interface/SBType.i
lldb/trunk/scripts/Python/interface/SBValue.i
lldb/trunk/source/API/SBFrame.cpp
lldb/trunk/source/API/SBModule.cpp
lldb/trunk/source/API/SBTarget.cpp
lldb/trunk/source/API/SBType.cpp
lldb/trunk/source/API/SBValue.cpp
lldb/trunk/source/Symbol/ClangASTType.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/test/expression_command/test/TestExprs.py
lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py
lldb/trunk/test/lang/c/array_types/TestArrayTypes.py
lldb/trunk/test/lang/c/bitfields/TestBitfields.py
lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py
lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py
lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py
lldb/trunk/test/lldbutil.py
lldb/trunk/test/python_api/frame/TestFrames.py
lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py
lldb/trunk/test/python_api/process/TestProcessAPI.py
Modified: lldb/trunk/include/lldb/API/SBBreakpoint.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBBreakpoint.h?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBBreakpoint.h (original)
+++ lldb/trunk/include/lldb/API/SBBreakpoint.h Wed Aug 3 17:57:10 2011
@@ -11,7 +11,6 @@
#define LLDB_SBBreakpoint_h_
#include "lldb/API/SBDefines.h"
-#include <stdio.h>
namespace lldb {
Modified: lldb/trunk/include/lldb/API/SBType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBType.h?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBType.h (original)
+++ lldb/trunk/include/lldb/API/SBType.h Wed Aug 3 17:57:10 2011
@@ -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 @@
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 @@
operator = (const SBTypeList& rhs);
void
- AppendType(SBType type);
+ Append (const SBType& type);
SBType
GetTypeAtIndex(int index) const;
Modified: lldb/trunk/include/lldb/API/SBValue.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/API/SBValue.h?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/include/lldb/API/SBValue.h (original)
+++ lldb/trunk/include/lldb/API/SBValue.h Wed Aug 3 17:57:10 2011
@@ -71,6 +71,12 @@
const char *
GetValue ();
+ int64_t
+ GetValueAsSigned(int64_t fail_value=0);
+
+ uint64_t
+ GetValueAsUnsigned(uint64_t fail_value=0);
+
ValueType
GetValueType ();
Modified: lldb/trunk/include/lldb/Symbol/ClangASTType.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/ClangASTType.h?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/ClangASTType.h (original)
+++ lldb/trunk/include/lldb/Symbol/ClangASTType.h Wed Aug 3 17:57:10 2011
@@ -31,8 +31,8 @@
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 @@
return *this;
}
+ bool
+ IsValid () const
+ {
+ return m_type != NULL && m_ast != NULL;
+ }
+
lldb::clang_type_t
GetOpaqueQualType() const
{
@@ -288,6 +294,9 @@
clang::ASTContext *m_ast;
};
+bool operator == (const ClangASTType &lhs, const ClangASTType &rhs);
+bool operator != (const ClangASTType &lhs, const ClangASTType &rhs);
+
} // namespace lldb_private
Modified: lldb/trunk/include/lldb/Symbol/Type.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Symbol/Type.h?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Symbol/Type.h (original)
+++ lldb/trunk/include/lldb/Symbol/Type.h Wed Aug 3 17:57:10 2011
@@ -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 @@
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 @@
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 @@
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 @@
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;
};
Modified: lldb/trunk/include/lldb/lldb-forward-rtti.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward-rtti.h?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward-rtti.h (original)
+++ lldb/trunk/include/lldb/lldb-forward-rtti.h Wed Aug 3 17:57:10 2011
@@ -74,6 +74,7 @@
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;
Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Wed Aug 3 17:57:10 2011
@@ -163,8 +163,10 @@
class ThreadSpec;
class TimeValue;
class Type;
+class TypeImpl;
class TypeAndOrName;
class TypeList;
+class TypeListImpl;
class UUID;
class Unwind;
class UnwindAssembly;
Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Wed Aug 3 17:57:10 2011
@@ -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)",
Modified: lldb/trunk/resources/LLDB-Info.plist
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/resources/LLDB-Info.plist?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/resources/LLDB-Info.plist (original)
+++ lldb/trunk/resources/LLDB-Info.plist Wed Aug 3 17:57:10 2011
@@ -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>
Modified: lldb/trunk/scripts/Python/interface/SBType.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBType.i?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBType.i (original)
+++ lldb/trunk/scripts/Python/interface/SBType.i Wed Aug 3 17:57:10 2011
@@ -54,7 +54,7 @@
SBTypeList();
void
- AppendType(SBType type);
+ Append(const SBType& type);
SBType
GetTypeAtIndex(int index);
Modified: lldb/trunk/scripts/Python/interface/SBValue.i
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/scripts/Python/interface/SBValue.i?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/scripts/Python/interface/SBValue.i (original)
+++ lldb/trunk/scripts/Python/interface/SBValue.i Wed Aug 3 17:57:10 2011
@@ -82,14 +82,6 @@
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 @@
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);
Modified: lldb/trunk/source/API/SBFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBFrame.cpp?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/source/API/SBFrame.cpp (original)
+++ lldb/trunk/source/API/SBFrame.cpp Wed Aug 3 17:57:10 2011
@@ -768,8 +768,8 @@
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(),
Modified: lldb/trunk/source/API/SBModule.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBModule.cpp?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/source/API/SBModule.cpp (original)
+++ lldb/trunk/source/API/SBModule.cpp Wed Aug 3 17:57:10 2011
@@ -347,27 +347,24 @@
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 @@
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;
Modified: lldb/trunk/source/API/SBTarget.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBTarget.cpp?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/source/API/SBTarget.cpp (original)
+++ lldb/trunk/source/API/SBTarget.cpp Wed Aug 3 17:57:10 2011
@@ -918,9 +918,9 @@
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;
Modified: lldb/trunk/source/API/SBType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBType.cpp?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/source/API/SBType.cpp (original)
+++ lldb/trunk/source/API/SBType.cpp Wed Aug 3 17:57:10 2011
@@ -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 @@
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 @@
{
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 @@
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 @@
// "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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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
Modified: lldb/trunk/source/API/SBValue.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SBValue.cpp?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/source/API/SBValue.cpp (original)
+++ lldb/trunk/source/API/SBValue.cpp Wed Aug 3 17:57:10 2011
@@ -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 @@
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 @@
{
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 @@
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 @@
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 ()
{
Modified: lldb/trunk/source/Symbol/ClangASTType.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangASTType.cpp?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangASTType.cpp (original)
+++ lldb/trunk/source/Symbol/ClangASTType.cpp Wed Aug 3 17:57:10 2011
@@ -1606,3 +1606,17 @@
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();
+}
Modified: lldb/trunk/source/Symbol/Type.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/Type.cpp?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/Type.cpp (original)
+++ lldb/trunk/source/Symbol/Type.cpp Wed Aug 3 17:57:10 2011
@@ -731,25 +731,24 @@
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 @@
if (!IsValid())
return NULL;
- return m_clang_ast_type->GetASTContext();
+ return m_clang_ast_type.GetASTContext();
}
lldb::clang_type_t
@@ -769,5 +768,5 @@
if (!IsValid())
return NULL;
- return m_clang_ast_type->GetOpaqueQualType();
+ return m_clang_ast_type.GetOpaqueQualType();
}
Modified: lldb/trunk/test/expression_command/test/TestExprs.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/expression_command/test/TestExprs.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/expression_command/test/TestExprs.py (original)
+++ lldb/trunk/test/expression_command/test/TestExprs.py Wed Aug 3 17:57:10 2011
@@ -134,29 +134,29 @@
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)
Modified: lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py (original)
+++ lldb/trunk/test/functionalities/breakpoint/breakpoint_conditions/TestBreakpointConditions.py Wed Aug 3 17:57:10 2011
@@ -149,7 +149,7 @@
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)
Modified: lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py (original)
+++ lldb/trunk/test/functionalities/conditional_break/TestConditionalBreak.py Wed Aug 3 17:57:10 2011
@@ -90,7 +90,7 @@
# 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()
Modified: lldb/trunk/test/lang/c/array_types/TestArrayTypes.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/array_types/TestArrayTypes.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/array_types/TestArrayTypes.py (original)
+++ lldb/trunk/test/lang/c/array_types/TestArrayTypes.py Wed Aug 3 17:57:10 2011
@@ -161,7 +161,7 @@
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 @@
"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 @@
"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 @@
"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
Modified: lldb/trunk/test/lang/c/bitfields/TestBitfields.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/c/bitfields/TestBitfields.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/lang/c/bitfields/TestBitfields.py (original)
+++ lldb/trunk/test/lang/c/bitfields/TestBitfields.py Wed Aug 3 17:57:10 2011
@@ -116,31 +116,31 @@
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.
Modified: lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py (original)
+++ lldb/trunk/test/lang/cpp/class_static/TestStaticVariables.py Wed Aug 3 17:57:10 2011
@@ -116,7 +116,7 @@
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)
Modified: lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py (original)
+++ lldb/trunk/test/lang/objc/foundation/TestObjCMethods.py Wed Aug 3 17:57:10 2011
@@ -240,9 +240,9 @@
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")
Modified: lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py (original)
+++ lldb/trunk/test/lang/objc/objc-ivar-offsets/TestObjCIvarOffsets.py Wed Aug 3 17:57:10 2011
@@ -58,14 +58,14 @@
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__':
Modified: lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py (original)
+++ lldb/trunk/test/lang/objc/objc-stepping/TestObjCStepping.py Wed Aug 3 17:57:10 2011
@@ -84,7 +84,7 @@
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 @@
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!")
Modified: lldb/trunk/test/lldbutil.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/lldbutil.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/lldbutil.py (original)
+++ lldb/trunk/test/lldbutil.py Wed Aug 3 17:57:10 2011
@@ -447,7 +447,7 @@
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 @@
#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()
Modified: lldb/trunk/test/python_api/frame/TestFrames.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/frame/TestFrames.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/python_api/frame/TestFrames.py (original)
+++ lldb/trunk/test/python_api/frame/TestFrames.py Wed Aug 3 17:57:10 2011
@@ -77,7 +77,7 @@
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 @@
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()
Modified: lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py (original)
+++ lldb/trunk/test/python_api/lldbutil/iter/TestRegistersIterator.py Wed Aug 3 17:57:10 2011
@@ -54,7 +54,7 @@
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 @@
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 @@
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",
Modified: lldb/trunk/test/python_api/process/TestProcessAPI.py
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/test/python_api/process/TestProcessAPI.py?rev=136829&r1=136828&r2=136829&view=diff
==============================================================================
--- lldb/trunk/test/python_api/process/TestProcessAPI.py (original)
+++ lldb/trunk/test/python_api/process/TestProcessAPI.py Wed Aug 3 17:57:10 2011
@@ -86,11 +86,11 @@
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 @@
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 @@
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 @@
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')
More information about the lldb-commits
mailing list