Package lldb :: Class SBType
[hide private]
[frames] | no frames]

Class SBType

source code



    Represents a data type in lldb.  The FindFirstType() method of SBTarget/SBModule
    returns a SBType.

    SBType supports the eq/ne operator. For example,

    main.cpp:

    class Task {
    public:
        int id;
        Task *next;
        Task(int i, Task *n):
            id(i),
            next(n)
        {}
    };

    int main (int argc, char const *argv[])
    {
        Task *task_head = new Task(-1, NULL);
        Task *task1 = new Task(1, NULL);
        Task *task2 = new Task(2, NULL);
        Task *task3 = new Task(3, NULL); // Orphaned.
        Task *task4 = new Task(4, NULL);
        Task *task5 = new Task(5, NULL);

        task_head->next = task1;
        task1->next = task2;
        task2->next = task4;
        task4->next = task5;

        int total = 0;
        Task *t = task_head;
        while (t != NULL) {
            if (t->id >= 0)
                ++total;
            t = t->next;
        }
        printf('We have a total number of %d tasks
', total);

        // This corresponds to an empty task list.
        Task *empty_task_head = new Task(-1, NULL);

        return 0; // Break at this line
    }

    find_type.py:

            # Get the type 'Task'.
            task_type = target.FindFirstType('Task')
            self.assertTrue(task_type)

            # Get the variable 'task_head'.
            frame0.FindVariable('task_head')
            task_head_type = task_head.GetType()
            self.assertTrue(task_head_type.IsPointerType())

            # task_head_type is 'Task *'.
            task_pointer_type = task_type.GetPointerType()
            self.assertTrue(task_head_type == task_pointer_type)

            # Get the child mmember 'id' from 'task_head'.
            id = task_head.GetChildMemberWithName('id')
            id_type = id.GetType()

            # SBType.GetBasicType() takes an enum 'BasicType' (lldb-enumerations.h).
            int_type = id_type.GetBasicType(lldb.eBasicTypeInt)
            # id_type and int_type should be the same type!
            self.assertTrue(id_type == int_type)

    ...
    

Instance Methods [hide private]
 
__repr__(self) source code
 
__init__(self, *args)
__init__(lldb::SBType self) -> SBType __init__(lldb::SBType self, SBType rhs) -> SBType
source code
 
IsValid(self)
IsValid(SBType self) -> bool
source code
 
__nonzero__(self) source code
 
__bool__(self) source code
 
GetByteSize(self)
GetByteSize(SBType self) -> uint64_t
source code
 
IsPointerType(self)
IsPointerType(SBType self) -> bool
source code
 
IsReferenceType(self)
IsReferenceType(SBType self) -> bool
source code
 
IsFunctionType(self)
IsFunctionType(SBType self) -> bool
source code
 
IsPolymorphicClass(self)
IsPolymorphicClass(SBType self) -> bool
source code
 
IsArrayType(self)
IsArrayType(SBType self) -> bool
source code
 
IsVectorType(self)
IsVectorType(SBType self) -> bool
source code
 
IsTypedefType(self)
IsTypedefType(SBType self) -> bool
source code
 
IsAnonymousType(self)
IsAnonymousType(SBType self) -> bool
source code
 
GetPointerType(self)
GetPointerType(SBType self) -> SBType
source code
 
GetPointeeType(self)
GetPointeeType(SBType self) -> SBType
source code
 
GetReferenceType(self)
GetReferenceType(SBType self) -> SBType
source code
 
GetTypedefedType(self)
GetTypedefedType(SBType self) -> SBType
source code
 
GetDereferencedType(self)
GetDereferencedType(SBType self) -> SBType
source code
 
GetUnqualifiedType(self)
GetUnqualifiedType(SBType self) -> SBType
source code
 
GetCanonicalType(self)
GetCanonicalType(SBType self) -> SBType
source code
 
GetArrayElementType(self)
GetArrayElementType(SBType self) -> SBType
source code
 
GetArrayType(self, *args)
GetArrayType(SBType self, uint64_t size) -> SBType
source code
 
GetVectorElementType(self)
GetVectorElementType(SBType self) -> SBType
source code
 
GetBasicType(self, *args)
GetBasicType(SBType self) -> lldb::BasicType GetBasicType(SBType self, lldb::BasicType type) -> SBType
source code
 
GetNumberOfFields(self)
GetNumberOfFields(SBType self) -> uint32_t
source code
 
GetNumberOfDirectBaseClasses(self)
GetNumberOfDirectBaseClasses(SBType self) -> uint32_t
source code
 
GetNumberOfVirtualBaseClasses(self)
GetNumberOfVirtualBaseClasses(SBType self) -> uint32_t
source code
 
GetFieldAtIndex(self, *args)
GetFieldAtIndex(SBType self, uint32_t idx) -> SBTypeMember
source code
 
GetDirectBaseClassAtIndex(self, *args)
GetDirectBaseClassAtIndex(SBType self, uint32_t idx) -> SBTypeMember
source code
 
GetVirtualBaseClassAtIndex(self, *args)
GetVirtualBaseClassAtIndex(SBType self, uint32_t idx) -> SBTypeMember
source code
 
GetEnumMembers(self)
GetEnumMembers(SBType self) -> SBTypeEnumMemberList
source code
 
GetName(self)
GetName(SBType self) -> char const *
source code
 
GetDisplayTypeName(self)
GetDisplayTypeName(SBType self) -> char const *
source code
 
GetTypeClass(self)
GetTypeClass(SBType self) -> lldb::TypeClass
source code
 
GetNumberOfTemplateArguments(self)
GetNumberOfTemplateArguments(SBType self) -> uint32_t
source code
 
GetTemplateArgumentType(self, *args)
GetTemplateArgumentType(SBType self, uint32_t idx) -> SBType
source code
 
GetTemplateArgumentKind(self, *args)
GetTemplateArgumentKind(SBType self, uint32_t idx) -> lldb::TemplateArgumentKind
source code
 
GetFunctionReturnType(self)
GetFunctionReturnType(SBType self) -> SBType
source code
 
GetFunctionArgumentTypes(self)
GetFunctionArgumentTypes(SBType self) -> SBTypeList
source code
 
GetNumberOfMemberFunctions(self)
GetNumberOfMemberFunctions(SBType self) -> uint32_t
source code
 
GetMemberFunctionAtIndex(self, *args)
GetMemberFunctionAtIndex(SBType self, uint32_t idx) -> SBTypeMemberFunction
source code
 
IsTypeComplete(self)
IsTypeComplete(SBType self) -> bool
source code
 
GetTypeFlags(self)
GetTypeFlags(SBType self) -> uint32_t
source code
 
__eq__(self, *args)
__eq__(SBType self, SBType rhs) -> bool
source code
 
__ne__(self, *args)
__ne__(SBType self, SBType rhs) -> bool
source code
 
template_arg_array(self) source code
 
get_bases_array(self)
An accessor function that returns a list() that contains all direct base classes in a lldb.SBType object.
source code
 
get_vbases_array(self)
An accessor function that returns a list() that contains all fields in a lldb.SBType object.
source code
 
get_fields_array(self)
An accessor function that returns a list() that contains all fields in a lldb.SBType object.
source code
 
get_members_array(self)
An accessor function that returns a list() that contains all members (base classes and fields) in a lldb.SBType object in ascending bit offset order.
source code
 
get_enum_members_array(self)
An accessor function that returns a list() that contains all enum members in an lldb.SBType object.
source code
 
__str__(self)
__str__(SBType self) -> PyObject *
source code
Class Variables [hide private]
  __swig_setmethods__ = {}
  __setattr__ = lambda self, name, value:
  __swig_getmethods__ = {}
  __getattr__ = lambda self, name:
  __swig_destroy__ = _lldb.delete_SBType
  __del__ = lambda self: