Make sure to only match Vec<std::array> types.

This commit is contained in:
King_DuckZ 2017-07-23 14:18:03 +01:00
parent f4715ec87f
commit b7616a4fcf

View file

@ -19,8 +19,8 @@ import gdb.printing
#This pretty-printer has been written for vectorwrapper + std::array. #This pretty-printer has been written for vectorwrapper + std::array.
#You will have to customize it if your wrapped type is different. #You will have to customize it if your wrapped type is different.
class VectorWrapperPrinter(object): class VectorWrapperStdArrPrinter(object):
"Print values in a VectorWrapper" "Print values in a VectorWrapper<std::array>"
class _iterator(object): class _iterator(object):
def __init__(self, start, size): def __init__(self, start, size):
@ -63,7 +63,7 @@ class VectorWrapperPrinter(object):
def build_pretty_printer(): def build_pretty_printer():
pp = gdb.printing.RegexpCollectionPrettyPrinter(__name__) pp = gdb.printing.RegexpCollectionPrettyPrinter(__name__)
#add your namespace before 'vwr' if you're using a custom one #add your namespace before 'vwr' if you're using a custom one
pp.add_printer('vwr', '^vwr::Vec<.+$', VectorWrapperPrinter) pp.add_printer('vwr', '^vwr::Vec<std::array.+$', VectorWrapperStdArrPrinter)
return pp return pp
gdb.printing.register_pretty_printer( gdb.printing.register_pretty_printer(