ide/Debuggers/Gdb_MI2 : added support for decoding Index and VectorMap

git-svn-id: svn://ultimatepp.org/upp/trunk@4541 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
micio 2012-02-04 19:03:01 +00:00
parent a6ee81f5b8
commit 4f74a39655

View file

@ -136,6 +136,26 @@ class UppArrayPrinter(object):
def display_hint(self):
return 'array'
# Upp::VectorMap printer
class UppVectorMapPrinter(object):
"Print an Upp::VectorMap"
def __init__(self, typename, val):
self.typename = typename
self.val = val
def children(self):
return [('keys', self.val['key']), ('values', self.val['value'])].__iter__()
def to_string(self):
count = self.val['key']['key']['items']
alloc = self.val['key']['key']['alloc']
return ('%s count %d alloc %d'
% (self.typename, count, alloc))
def display_hint(self):
return 'array'
# Upp::Value printer
class UppValuePrinter(object):
@ -196,6 +216,10 @@ def UppLookupFunction(val):
if lookup_tag == None:
return None
regex = re.compile("^Upp::VectorMap<.*>$")
if regex.match(lookup_tag):
return UppVectorMapPrinter(lookup_tag, val)
regex = re.compile("^Upp::Vector<.*>$")
if regex.match(lookup_tag):
return UppVectorPrinter(lookup_tag, val)
@ -204,6 +228,10 @@ def UppLookupFunction(val):
if regex.match(lookup_tag):
return UppArrayPrinter(lookup_tag, val)
regex = re.compile("^Upp::Index<.*>$")
if regex.match(lookup_tag):
return UppVectorPrinter(lookup_tag, val['key'])
return None
#check if Upp value inspecting support is enabled