예제 #1
0
    def __init__(self, gdbval):
        WrappedPointer.__init__(self, gdbval)

        # Cache some values:
        # This is the high-water mark: at this point and beyond, the bytes of
        # memory are untouched since malloc:
        self.pool_address = self.field('pool_address')
예제 #2
0
파일: cpython.py 프로젝트: doctau/gdb-heap
    def __init__(self, gdbval):
        WrappedPointer.__init__(self, gdbval)

        # Cache some values:
        # This is the high-water mark: at this point and beyond, the bytes of
        # memory are untouched since malloc:
        self.pool_address = self.field('pool_address')
예제 #3
0
    def __init__(self, gdbval, arenaobj):
        WrappedPointer.__init__(self, gdbval)

        assert (isinstance(arenaobj, ArenaObject))
        self.arenaobj = arenaobj

        # obmalloc.c sets up arenaobj->pool_address to the first pool
        # address, aligning it to POOL_SIZE_MASK:
        self.initial_pool_addr = self.as_address()
        self.num_pools = ARENA_SIZE // POOL_SIZE
        self.excess = self.initial_pool_addr & POOL_SIZE_MASK
        if self.excess != 0:
            self.num_pools -= 1
            self.initial_pool_addr += POOL_SIZE - self.excess
예제 #4
0
파일: cpython.py 프로젝트: doctau/gdb-heap
    def __init__(self, gdbval, arenaobj):
        WrappedPointer.__init__(self, gdbval)

        assert(isinstance(arenaobj, ArenaObject))
        self.arenaobj = arenaobj

        # obmalloc.c sets up arenaobj->pool_address to the first pool
        # address, aligning it to POOL_SIZE_MASK:
        self.initial_pool_addr = self.as_address()
        self.num_pools = ARENA_SIZE / POOL_SIZE
        self.excess = self.initial_pool_addr & POOL_SIZE_MASK
        if self.excess != 0:
            self.num_pools -= 1
            self.initial_pool_addr += POOL_SIZE - self.excess
예제 #5
0
파일: gobject.py 프로젝트: fwugist/gdb-heap
class GTypeInstancePtr(WrappedPointer):
    @classmethod
    def from_gtypeinstance_ptr(cls, addr, typenode):
        typename = cls.get_type_name(typenode)
        if typename:
            cls = cls.get_class_for_typename(typename)
            return cls(addr, typenode, typename)

    @classmethod
    def get_class_for_typename(cls, typename):
        '''Get the GTypeInstance subclass for the given type name'''
        if typename in typemap:
            return typemap[typename]
        return GTypeInstancePtr

    def __init__(self, addr, typenode, typename):
        # Try to cast the ptr to the named type:
        addr = gdb.Value(addr)
        try:
            if is_typename_castable(typename):
                # This requires, say, gtk2-debuginfo:
                ptr_type = caching_lookup_type(typename).pointer()
                addr = addr.cast(ptr_type)
                #print typename, addr.dereference()
                #if typename == 'GdkPixbuf':
                #    print 'GOT PIXELS', addr['pixels']
        except RuntimeError, e:
            pass
            #print addr, e

        WrappedPointer.__init__(self, addr)
        self.typenode = typenode
        self.typename = typename
        """
예제 #6
0
    def __init__(self, addr, typenode, typename):
        # Try to cast the ptr to the named type:
        addr = gdb.Value(addr)
        try:
            if is_typename_castable(typename):
                # This requires, say, gtk2-debuginfo:
                ptr_type = caching_lookup_type(typename).pointer()
                addr = addr.cast(ptr_type)
                #print typename, addr.dereference()
                #if typename == 'GdkPixbuf':
                #    print 'GOT PIXELS', addr['pixels']
        except RuntimeError as e:
            pass
            #print addr, e

        WrappedPointer.__init__(self, addr)
        self.typenode = typenode
        self.typename = typename
        """
예제 #7
0
파일: gobject.py 프로젝트: alexmgr/gdb-heap
    def __init__(self, addr, typenode, typename):
        # Try to cast the ptr to the named type:
        addr = gdb.Value(addr)
        try:
            if is_typename_castable(typename):
                # This requires, say, gtk2-debuginfo:
                ptr_type = caching_lookup_type(typename).pointer()
                addr = addr.cast(ptr_type)
                #print typename, addr.dereference()
                #if typename == 'GdkPixbuf':
                #    print 'GOT PIXELS', addr['pixels']
        except RuntimeError as e:
            pass
            #print addr, e

        WrappedPointer.__init__(self, addr)
        self.typenode = typenode
        self.typename = typename
        """