diff --git a/QtFormatters.py b/QtFormatters.py index ee57d0a..d457ae6 100644 --- a/QtFormatters.py +++ b/QtFormatters.py @@ -14,7 +14,10 @@ def make_string_from_pointer_with_offset(F,OFFS, L): V = G[X] if V == 0: continue - strval += unichr(V) + try: + strval += chr(V) + except NameError: + strval += unichr(V) except Exception as e: pass strval = strval + '"' @@ -101,8 +104,7 @@ def get_child_at_index(self,index): voidSize = pD.GetChildMemberWithName('array').GetType().GetByteSize() return self.valobj.GetChildMemberWithName('p').GetChildMemberWithName('d').GetChildMemberWithName('array').CreateChildAtOffset('[' + str(index) + ']', pBegin + index * voidSize, type) except: - print "boned getchild" - return None + return None class QPointer_SyntheticProvider: def __init__(self, valobj, internal_dict): @@ -133,5 +135,4 @@ def get_child_at_index(self,index): type = self.valobj.GetType().GetTemplateArgumentType(0) return self.valobj.GetChildMemberWithName('wp').GetChildMemberWithName('value').CreateChildAtOffset('value', 0, type) except: - print "boned getchild" - return None \ No newline at end of file + return None diff --git a/README.md b/README.md index b3af37d..f5fd66c 100644 --- a/README.md +++ b/README.md @@ -12,9 +12,9 @@ I tested QString and QList only, hoping that the rest of the scripts will be com # Installation # -Clone this repo somewhere, e.g. ~/qtlldb. Then add the following lines to your ~/.lldbinit (create one if does not exist): +Clone this repo somewhere, e.g. ~/.qtlldb. Then add the following lines to your ~/.lldbinit (create one if does not exist): ``` -command script import ~/qtlldb/QtFormatters.py -command source ~/qtlldb/QtFormatters.lldb -``` \ No newline at end of file +command script import ~/.qtlldb/QtFormatters.py +command source ~/.qtlldb/QtFormatters.lldb +```