ATLAS Offline Software
Loading...
Searching...
No Matches
python.pointerprint.VPointerPrinter Class Reference
Collaboration diagram for python.pointerprint.VPointerPrinter:

Public Member Functions

 __init__ (self, val)
 vtstring1 (self, vt)
 vtstring (self)
 to_string (self)

Public Attributes

int val = val

Detailed Description

Definition at line 12 of file pointerprint.py.

Constructor & Destructor Documentation

◆ __init__()

python.pointerprint.VPointerPrinter.__init__ ( self,
val )

Definition at line 13 of file pointerprint.py.

13 def __init__ (self, val):
14 self.val = val
15
16

Member Function Documentation

◆ to_string()

python.pointerprint.VPointerPrinter.to_string ( self)

Definition at line 55 of file pointerprint.py.

55 def to_string (self):
56 return "(%s) 0x%x%s" % (self.val.type, int(self.val), self.vtstring())
57
58
59#_vpointer_types = ['IAddressProvider',
60# 'pool::IPersistencySvc']
61#_vpointer_dict = dict([('class ' + v,1) for v in _vpointer_types])
static std::string to_string(const std::vector< T > &v)

◆ vtstring()

python.pointerprint.VPointerPrinter.vtstring ( self)

Definition at line 43 of file pointerprint.py.

43 def vtstring (self):
44 if self.val == 0: return ''
45 vpptype = gdb.lookup_type('void').pointer().pointer()
46 vt = self.val.cast(vpptype).dereference()
47 out = self.vtstring1 (vt)
48 if not out:
49 # FIXME: Cache somehow to prevent many calls to findlib.
50 findlib (int(vt), True)
51 out = self.vtstring1 (vt)
52 return out
53
54

◆ vtstring1()

python.pointerprint.VPointerPrinter.vtstring1 ( self,
vt )

Definition at line 17 of file pointerprint.py.

17 def vtstring1 (self, vt):
18 olddem = gdb.parameter('print asm-demangle')
19 out = ''
20 try:
21 try:
22 gdb.execute ('set print asm-demangle on')
23 out = gdb.execute ('x/x 0x%x' % int(vt), to_string = True)
24 except: # noqa: E722 B001
25 # Suppress errors
26 pass
27 finally:
28 if not olddem:
29 gdb.execute ('set print asm-demangle off')
30 i = out.find ('<vtable for ')
31 if i >= 0:
32 i += 12
33 j = out.rfind ('>')
34 if j >= 0:
35 jj = out.rfind ('+', i, j)
36 if jj >= 0:
37 j = jj
38 return '<' + out[i:j] + '>'
39
40 return ''
41
42

Member Data Documentation

◆ val

python.pointerprint.VPointerPrinter.val = val

Definition at line 14 of file pointerprint.py.


The documentation for this class was generated from the following file: