Skip to content

Commit

Permalink
Fixed: gdb python printer for wxArrayString class
Browse files Browse the repository at this point in the history
  • Loading branch information
eranif committed Mar 17, 2016
1 parent 662297c commit 9053430
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Runtime/gdb_printers/wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ def to_string(self):
def display_hint (self):
return 'wxString'

class wxArrayFooPrinter:
"For wxArrayString, wxArrayInt, wxArrayDouble etc"

class wxArrayString:
class _iterator:
def __init__ (self, items, item_count):
self.items = items
Expand All @@ -51,7 +49,7 @@ def next(self):
raise StopIteration
try:
# Try the wx >=2.9 way first
elt = self.items[count]['m_impl']
elt = '"' + self.items[count]['_M_dataplus']['_M_p'].string() + '"'
except Exception:
# The wx2.8 way
elt = self.items[count]
Expand All @@ -69,8 +67,7 @@ def children(self):

def to_string(self):
# Ideal would be to return e.g. "wxArrayInt", but how to find the type?
return "wxArray<T>"

return "wxArrayString"

def display_hint(self):
return 'array'
Expand Down Expand Up @@ -148,7 +145,7 @@ def lookup_function (val):

def build_dictionary ():
pretty_printers_dict[re.compile('^wxString$')] = lambda val: wxStringPrinter(val)
pretty_printers_dict[re.compile('^wxArray.+$')] = lambda val: wxArrayFooPrinter(val)
pretty_printers_dict[re.compile('wxArrayString')] = lambda val: wxArrayString(val)
if platform.system() != 'Windows':
pretty_printers_dict[re.compile('^wxFileName$')] = lambda val: wxFileNamePrinter(val)
pretty_printers_dict[re.compile('^wxPoint$')] = lambda val: wxPointPrinter(val)
Expand Down

0 comments on commit 9053430

Please sign in to comment.