ide/Debuggers/Gdb_MI2 : fixed printing of pointer and references to strings and values

git-svn-id: svn://ultimatepp.org/upp/trunk@4593 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
micio 2012-02-13 23:54:57 +00:00
parent ad02b6c1f7
commit 50e303cb44

View file

@ -195,6 +195,19 @@ class UppValuePrinter(object):
else:
return "<unsupported value type '" + str(typeId) + "'>"
# Upp::Value* printer
class UppValuePtrPrinter(object):
"Print an Upp::Value *"
def __init__(self, val):
self.val = val
def to_string(self):
return '@' + str(self.val.address) + ': ' + UppValuePrinter(self.val.dereference()).to_string()
def display_hint(self):
return 'String'
# Upp::One<> printer
class UppOnePrinter(object):
@ -210,12 +223,39 @@ def UppLookupFunction(val):
if typeStr == 'Upp::String *':
return UppStringPtrPrinter(val)
if typeStr == 'const Upp::String *':
return UppStringPtrPrinter(val)
if typeStr == 'Upp::String &':
return UppStringPtrPrinter(val.address)
if typeStr == 'const Upp::String &':
return UppStringPtrPrinter(val.address)
if typeStr == 'Upp::String':
return UppStringPrinter(val)
if typeStr == 'const Upp::String':
return UppStringPrinter(val)
if typeStr == 'Upp::Value *' and Upp_Value_Inspectors:
return UppValuePtrPrinter(val)
if typeStr == 'const Upp::Value *' and Upp_Value_Inspectors:
return UppValuePtrPrinter(val)
if typeStr == 'Upp::Value &' and Upp_Value_Inspectors:
return UppValuePtrPrinter(val.address)
if typeStr == 'const Upp::Value &' and Upp_Value_Inspectors:
return UppValuePtrPrinter(val.address)
if typeStr == 'Upp::Value' and Upp_Value_Inspectors:
return UppValuePrinter(val)
if typeStr == 'const Upp::Value' and Upp_Value_Inspectors:
return UppValuePrinter(val)
lookup_tag = val.type.tag
if lookup_tag == None:
return None