Skip to content

Commit 3709c99

Browse files
committed
fix: add python3 compat
1 parent d0b61db commit 3709c99

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

QtFormatters.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,10 @@ def make_string_from_pointer_with_offset(F,OFFS, L):
1414
V = G[X]
1515
if V == 0:
1616
continue
17-
strval += unichr(V)
17+
try:
18+
strval += chr(V)
19+
except NameError:
20+
strval += unichr(V)
1821
except Exception as e:
1922
pass
2023
strval = strval + '"'
@@ -101,8 +104,7 @@ def get_child_at_index(self,index):
101104
voidSize = pD.GetChildMemberWithName('array').GetType().GetByteSize()
102105
return self.valobj.GetChildMemberWithName('p').GetChildMemberWithName('d').GetChildMemberWithName('array').CreateChildAtOffset('[' + str(index) + ']', pBegin + index * voidSize, type)
103106
except:
104-
print "boned getchild"
105-
return None
107+
return None
106108

107109
class QPointer_SyntheticProvider:
108110
def __init__(self, valobj, internal_dict):
@@ -133,5 +135,4 @@ def get_child_at_index(self,index):
133135
type = self.valobj.GetType().GetTemplateArgumentType(0)
134136
return self.valobj.GetChildMemberWithName('wp').GetChildMemberWithName('value').CreateChildAtOffset('value', 0, type)
135137
except:
136-
print "boned getchild"
137-
return None
138+
return None

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ I tested QString and QList only, hoping that the rest of the scripts will be com
1212

1313
# Installation #
1414

15-
Clone this repo somewhere, e.g. ~/qtlldb. Then add the following lines to your ~/.lldbinit (create one if does not exist):
15+
Clone this repo somewhere, e.g. ~/.qtlldb. Then add the following lines to your ~/.lldbinit (create one if does not exist):
1616

1717
```
18-
command script import ~/qtlldb/QtFormatters.py
19-
command source ~/qtlldb/QtFormatters.lldb
20-
```
18+
command script import ~/.qtlldb/QtFormatters.py
19+
command source ~/.qtlldb/QtFormatters.lldb
20+
```

0 commit comments

Comments
 (0)