diff options
author | Enrico Granata <granata.enrico@gmail.com> | 2011-08-04 01:41:02 +0000 |
---|---|---|
committer | Enrico Granata <granata.enrico@gmail.com> | 2011-08-04 01:41:02 +0000 |
commit | 6fd87d5d33c677badffcab70b60e8dcc169de07e (patch) | |
tree | cbfbcdc89fc62be7c2d37d5e33883d9704ab8e08 /lldb/test/functionalities/data-formatter/data-formatter-objc/CFString.py | |
parent | b224db72b02a17981bec61c71c02566b542f9667 (diff) | |
download | bcm5719-llvm-6fd87d5d33c677badffcab70b60e8dcc169de07e.tar.gz bcm5719-llvm-6fd87d5d33c677badffcab70b60e8dcc169de07e.zip |
APIs to GetValueAsSigned/Unsigned() in SBValue now also accept an SBError parameter to give more info about any problem
The synthetic children providers now use the new (safer) APIs to get the values of objects
As a side effect, fixed an issue in ValueObject where ResolveValue() was not always updating the value before reading it
llvm-svn: 136861
Diffstat (limited to 'lldb/test/functionalities/data-formatter/data-formatter-objc/CFString.py')
-rw-r--r-- | lldb/test/functionalities/data-formatter/data-formatter-objc/CFString.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lldb/test/functionalities/data-formatter/data-formatter-objc/CFString.py b/lldb/test/functionalities/data-formatter/data-formatter-objc/CFString.py index 7d3a43ae98e..ed1bd314346 100644 --- a/lldb/test/functionalities/data-formatter/data-formatter-objc/CFString.py +++ b/lldb/test/functionalities/data-formatter/data-formatter-objc/CFString.py @@ -45,7 +45,7 @@ class CFStringSynthProvider: # for 32bit targets, use safe ObjC code return self.handle_unicode_string_safe() offset = 12 - pointer = int(self.valobj.GetValue(), 0) + offset + pointer = self.valobj.GetValueAsUnsigned(0) + offset pystr = self.read_unicode(pointer) return self.valobj.CreateValueFromExpression("content", "(char*)\"" + pystr.encode('utf-8') + "\"") @@ -60,7 +60,7 @@ class CFStringSynthProvider: def handle_unicode_string(self): # step 1: find offset if self.inline: - pointer = int(self.valobj.GetValue(), 0) + self.size_of_cfruntime_base(); + pointer = self.valobj.GetValueAsUnsigned(0) + self.size_of_cfruntime_base(); if self.explicit == False: # untested, use the safe code path return self.handle_unicode_string_safe(); @@ -76,11 +76,11 @@ class CFStringSynthProvider: # for an inline string) pointer = pointer + 8; else: - pointer = int(self.valobj.GetValue(), 0) + self.size_of_cfruntime_base(); + pointer = self.valobj.GetValueAsUnsigned(0) + self.size_of_cfruntime_base(); # read 8 bytes here and make an address out of them vopointer = self.valobj.CreateChildAtOffset("dummy", pointer,self.valobj.GetType().GetBasicType(lldb.eBasicTypeChar).GetPointerType()); - pointer = int(vopointer.GetValue(), 0) + pointer = vopointer.GetValueAsUnsigned(0) # step 2: read Unicode data at pointer pystr = self.read_unicode(pointer) # step 3: return it |