mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-07 22:03:42 -06:00
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:
parent
a6ee81f5b8
commit
4f74a39655
1 changed files with 28 additions and 0 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue