mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-09-07 10:34:54 -06:00
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:
parent
ad02b6c1f7
commit
50e303cb44
1 changed files with 40 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue