1 # Pretty-printers for libstc++.
3 # Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 3 of the License, or
8 # (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 class StdPointerPrinter:
23 "Print a smart pointer of some kind"
25 def __init__ (self, typename, val):
26 self.typename = typename
30 if self.val['_M_refcount']['_M_pi'] == 0:
31 return '%s (empty) %s' % (self.typename, self.val['_M_ptr'])
32 return '%s (count %d) %s' % (self.typename,
33 self.val['_M_refcount']['_M_pi']['_M_use_count'],
36 class UniquePointerPrinter:
39 def __init__ (self, val):
43 return self.val['_M_t']
49 def __init__(self, nodetype, head):
50 self.nodetype = nodetype
51 self.base = head['_M_next']
52 self.head = head.address
59 if self.base == self.head:
61 elt = self.base.cast(self.nodetype).dereference()
62 self.base = elt['_M_next']
64 self.count = self.count + 1
65 return ('[%d]' % count, elt['_M_data'])
67 def __init__(self, typename, val):
68 self.typename = typename
72 itype = self.val.type.template_argument(0)
73 # If the inferior program is compiled with -D_GLIBCXX_DEBUG
74 # some of the internal implementation details change.
75 if self.typename == "std::list":
76 nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
77 elif self.typename == "std::__debug::list":
78 nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
80 raise ValueError, "Cannot cast list node for list printer."
81 return self._iterator(nodetype, self.val['_M_impl']['_M_node'])
84 if self.val['_M_impl']['_M_node'].address == self.val['_M_impl']['_M_node']['_M_next']:
85 return 'empty %s' % (self.typename)
86 return '%s' % (self.typename)
88 class StdListIteratorPrinter:
89 "Print std::list::iterator"
91 def __init__(self, typename, val):
93 self.typename = typename
96 itype = self.val.type.template_argument(0)
97 # If the inferior program is compiled with -D_GLIBCXX_DEBUG
98 # some of the internal implementation details change.
99 if self.typename == "std::_List_iterator" or self.typename == "std::_List_const_iterator":
100 nodetype = gdb.lookup_type('std::_List_node<%s>' % itype).pointer()
101 elif self.typename == "std::__norm::_List_iterator" or self.typename == "std::__norm::_List_const_iterator":
102 nodetype = gdb.lookup_type('std::__norm::_List_node<%s>' % itype).pointer()
104 raise ValueError, "Cannot cast list node for list iterator printer."
105 return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
107 class StdSlistPrinter:
108 "Print a __gnu_cxx::slist"
111 def __init__(self, nodetype, head):
112 self.nodetype = nodetype
113 self.base = head['_M_head']['_M_next']
122 elt = self.base.cast(self.nodetype).dereference()
123 self.base = elt['_M_next']
125 self.count = self.count + 1
126 return ('[%d]' % count, elt['_M_data'])
128 def __init__(self, val):
132 itype = self.val.type.template_argument(0)
133 nodetype = gdb.lookup_type('__gnu_cxx::_Slist_node<%s>' % itype).pointer()
134 return self._iterator(nodetype, self.val)
137 if self.val['_M_head']['_M_next'] == 0:
138 return 'empty __gnu_cxx::slist'
139 return '__gnu_cxx::slist'
141 class StdSlistIteratorPrinter:
142 "Print __gnu_cxx::slist::iterator"
144 def __init__(self, val):
148 itype = self.val.type.template_argument(0)
149 nodetype = gdb.lookup_type('__gnu_cxx::_Slist_node<%s>' % itype).pointer()
150 return self.val['_M_node'].cast(nodetype).dereference()['_M_data']
152 class StdVectorPrinter:
153 "Print a std::vector"
156 def __init__ (self, start, finish, bitvec):
159 self.item = start['_M_p']
160 self.so = start['_M_offset']
161 self.finish = finish['_M_p']
162 self.fo = finish['_M_offset']
163 itype = self.item.dereference().type
164 self.isize = 8 * itype.sizeof
175 self.count = self.count + 1
177 if self.item == self.finish and self.so >= self.fo:
179 elt = self.item.dereference()
180 obit = 1 if elt & (1 << self.so) else 0
181 self.so = self.so + 1
182 if self.so >= self.isize:
183 self.item = self.item + 1
185 return ('[%d]' % count, obit)
187 if self.item == self.finish:
189 elt = self.item.dereference()
190 self.item = self.item + 1
191 return ('[%d]' % count, elt)
193 def __init__(self, typename, val):
194 self.typename = typename
196 self.is_bool = val.type.template_argument(0).code == gdb.TYPE_CODE_BOOL
199 return self._iterator(self.val['_M_impl']['_M_start'],
200 self.val['_M_impl']['_M_finish'],
204 start = self.val['_M_impl']['_M_start']
205 finish = self.val['_M_impl']['_M_finish']
206 end = self.val['_M_impl']['_M_end_of_storage']
208 start = self.val['_M_impl']['_M_start']['_M_p']
209 so = self.val['_M_impl']['_M_start']['_M_offset']
210 finish = self.val['_M_impl']['_M_finish']['_M_p']
211 fo = self.val['_M_impl']['_M_finish']['_M_offset']
212 itype = start.dereference().type
213 bl = 8 * itype.sizeof
214 length = (bl - so) + bl * ((finish - start) - 1) + fo
215 capacity = bl * (end - start)
216 return ('%s<bool> of length %d, capacity %d'
217 % (self.typename, int (length), int (capacity)))
219 return ('%s of length %d, capacity %d'
220 % (self.typename, int (finish - start), int (end - start)))
222 def display_hint(self):
225 class StdVectorIteratorPrinter:
226 "Print std::vector::iterator"
228 def __init__(self, val):
232 return self.val['_M_current'].dereference()
234 class StdTuplePrinter:
238 def __init__ (self, head):
241 # Set the base class as the initial head of the
243 nodes = self.head.type.fields ()
245 raise ValueError, "Top of tuple tree does not consist of a single node."
247 # Set the actual head to the first pair.
248 self.head = self.head.cast (nodes[0].type)
255 nodes = self.head.type.fields ()
256 # Check for further recursions in the inheritance tree.
259 # Check that this iteration has an expected structure.
261 raise ValueError, "Cannot parse more than 2 nodes in a tuple tree."
263 # - Left node is the next recursion parent.
264 # - Right node is the actual class contained in the tuple.
266 # Process right node.
267 impl = self.head.cast (nodes[1].type)
269 # Process left node and set it as head.
270 self.head = self.head.cast (nodes[0].type)
271 self.count = self.count + 1
273 # Finally, check the implementation. If it is
274 # wrapped in _M_head_impl return that, otherwise return
276 fields = impl.type.fields ()
277 if len (fields) < 1 or fields[0].name != "_M_head_impl":
278 return ('[%d]' % self.count, impl)
280 return ('[%d]' % self.count, impl['_M_head_impl'])
282 def __init__ (self, typename, val):
283 self.typename = typename
287 return self._iterator (self.val)
289 def to_string (self):
290 return '%s containing' % (self.typename)
292 class StdStackOrQueuePrinter:
293 "Print a std::stack or std::queue"
295 def __init__ (self, typename, val):
296 self.typename = typename
297 self.visualizer = gdb.default_visualizer(val['c'])
300 return self.visualizer.children()
302 def to_string (self):
303 return '%s wrapping: %s' % (self.typename,
304 self.visualizer.to_string())
306 def display_hint (self):
307 if hasattr (self.visualizer, 'display_hint'):
308 return self.visualizer.display_hint ()
311 class RbtreeIterator:
312 def __init__(self, rbtree):
313 self.size = rbtree['_M_t']['_M_impl']['_M_node_count']
314 self.node = rbtree['_M_t']['_M_impl']['_M_header']['_M_left']
321 return int (self.size)
324 if self.count == self.size:
327 self.count = self.count + 1
328 if self.count < self.size:
329 # Compute the next node.
331 if node.dereference()['_M_right']:
332 node = node.dereference()['_M_right']
333 while node.dereference()['_M_left']:
334 node = node.dereference()['_M_left']
336 parent = node.dereference()['_M_parent']
337 while node == parent.dereference()['_M_right']:
339 parent = parent.dereference()['_M_parent']
340 if node.dereference()['_M_right'] != parent:
345 # This is a pretty printer for std::_Rb_tree_iterator (which is
346 # std::map::iterator), and has nothing to do with the RbtreeIterator
348 class StdRbtreeIteratorPrinter:
349 "Print std::map::iterator"
351 def __init__ (self, val):
354 def to_string (self):
355 valuetype = self.val.type.template_argument(0)
356 nodetype = gdb.lookup_type('std::_Rb_tree_node < %s >' % valuetype)
357 nodetype = nodetype.pointer()
358 return self.val.cast(nodetype).dereference()['_M_value_field']
360 class StdDebugIteratorPrinter:
361 "Print a debug enabled version of an iterator"
363 def __init__ (self, val):
366 # Just strip away the encapsulating __gnu_debug::_Safe_iterator
367 # and return the wrapped iterator value.
368 def to_string (self):
369 itype = self.val.type.template_argument(0)
370 return self.val['_M_current'].cast(itype)
373 "Print a std::map or std::multimap"
375 # Turn an RbtreeIterator into a pretty-print iterator.
377 def __init__(self, rbiter, type):
386 if self.count % 2 == 0:
387 n = self.rbiter.next()
388 n = n.cast(self.type).dereference()['_M_value_field']
392 item = self.pair['second']
393 result = ('[%d]' % self.count, item)
394 self.count = self.count + 1
397 def __init__ (self, typename, val):
398 self.typename = typename
401 def to_string (self):
402 return '%s with %d elements' % (self.typename,
403 len (RbtreeIterator (self.val)))
406 keytype = self.val.type.template_argument(0).const()
407 valuetype = self.val.type.template_argument(1)
408 nodetype = gdb.lookup_type('std::_Rb_tree_node< std::pair< %s, %s > >' % (keytype, valuetype))
409 nodetype = nodetype.pointer()
410 return self._iter (RbtreeIterator (self.val), nodetype)
412 def display_hint (self):
416 "Print a std::set or std::multiset"
418 # Turn an RbtreeIterator into a pretty-print iterator.
420 def __init__(self, rbiter, type):
429 item = self.rbiter.next()
430 item = item.cast(self.type).dereference()['_M_value_field']
431 # FIXME: this is weird ... what to do?
432 # Maybe a 'set' display hint?
433 result = ('[%d]' % self.count, item)
434 self.count = self.count + 1
437 def __init__ (self, typename, val):
438 self.typename = typename
441 def to_string (self):
442 return '%s with %d elements' % (self.typename,
443 len (RbtreeIterator (self.val)))
446 keytype = self.val.type.template_argument(0)
447 nodetype = gdb.lookup_type('std::_Rb_tree_node< %s >' % keytype).pointer()
448 return self._iter (RbtreeIterator (self.val), nodetype)
450 class StdBitsetPrinter:
451 "Print a std::bitset"
453 def __init__(self, typename, val):
454 self.typename = typename
457 def to_string (self):
458 # If template_argument handled values, we could print the
459 # size. Or we could use a regexp on the type.
460 return '%s' % (self.typename)
463 words = self.val['_M_w']
466 # The _M_w member can be either an unsigned long, or an
467 # array. This depends on the template specialization used.
468 # If it is a single long, convert to a single element list.
469 if wtype.code == gdb.TYPE_CODE_ARRAY:
470 tsize = wtype.target ().sizeof
475 nwords = wtype.sizeof / tsize
483 # Another spot where we could use 'set'?
484 result.append(('[%d]' % (byte * tsize * 8 + bit), 1))
490 class StdDequePrinter:
494 def __init__(self, node, start, end, last, buffer_size):
499 self.buffer_size = buffer_size
506 if self.p == self.last:
509 result = ('[%d]' % self.count, self.p.dereference())
510 self.count = self.count + 1
512 # Advance the 'cur' pointer.
514 if self.p == self.end:
515 # If we got to the end of this bucket, move to the
517 self.node = self.node + 1
518 self.p = self.node[0]
519 self.end = self.p + self.buffer_size
523 def __init__(self, typename, val):
524 self.typename = typename
526 self.elttype = val.type.template_argument(0)
527 size = self.elttype.sizeof
529 self.buffer_size = int (512 / size)
534 start = self.val['_M_impl']['_M_start']
535 end = self.val['_M_impl']['_M_finish']
537 delta_n = end['_M_node'] - start['_M_node'] - 1
538 delta_s = start['_M_last'] - start['_M_cur']
539 delta_e = end['_M_cur'] - end['_M_first']
541 size = self.buffer_size * delta_n + delta_s + delta_e
543 return '%s with %d elements' % (self.typename, long (size))
546 start = self.val['_M_impl']['_M_start']
547 end = self.val['_M_impl']['_M_finish']
548 return self._iter(start['_M_node'], start['_M_cur'], start['_M_last'],
549 end['_M_cur'], self.buffer_size)
551 def display_hint (self):
554 class StdDequeIteratorPrinter:
555 "Print std::deque::iterator"
557 def __init__(self, val):
561 return self.val['_M_cur'].dereference()
563 class StdStringPrinter:
564 "Print a std::basic_string of some kind"
566 def __init__(self, val):
570 # Make sure &string works, too.
572 if type.code == gdb.TYPE_CODE_REF:
573 type = type.target ()
575 # Calculate the length of the string so that to_string returns
576 # the string according to length, not according to first null
578 ptr = self.val ['_M_dataplus']['_M_p']
579 realtype = type.unqualified ().strip_typedefs ()
580 reptype = gdb.lookup_type (str (realtype) + '::_Rep').pointer ()
581 header = ptr.cast(reptype) - 1
582 len = header.dereference ()['_M_length']
583 if hasattr(ptr, "lazy_string"):
584 return ptr.lazy_string (length = len)
585 return ptr.string (length = len)
587 def display_hint (self):
590 class Tr1HashtableIterator:
591 def __init__ (self, hash):
593 self.n_buckets = hash['_M_element_count']
594 if self.n_buckets == 0:
597 self.bucket = hash['_M_buckets']
598 self.node = self.bucket[0]
605 # If we advanced off the end of the chain, move to the next
607 while self.node == 0:
608 self.bucket = self.bucket + 1
609 self.node = self.bucket[0]
611 # If we advanced off the end of the bucket array, then
613 if self.count == self.n_buckets:
616 self.count = self.count + 1
621 result = self.node.dereference()['_M_v']
622 self.node = self.node.dereference()['_M_next']
626 class Tr1UnorderedSetPrinter:
627 "Print a tr1::unordered_set"
629 def __init__ (self, typename, val):
630 self.typename = typename
633 def to_string (self):
634 return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
637 def format_count (i):
641 counter = itertools.imap (self.format_count, itertools.count())
642 return itertools.izip (counter, Tr1HashtableIterator (self.val))
644 class Tr1UnorderedMapPrinter:
645 "Print a tr1::unordered_map"
647 def __init__ (self, typename, val):
648 self.typename = typename
651 def to_string (self):
652 return '%s with %d elements' % (self.typename, self.val['_M_element_count'])
661 def format_one (elt):
662 return (elt['first'], elt['second'])
665 def format_count (i):
669 counter = itertools.imap (self.format_count, itertools.count())
670 # Map over the hash table and flatten the result.
671 data = self.flatten (itertools.imap (self.format_one, Tr1HashtableIterator (self.val)))
672 # Zip the two iterators together.
673 return itertools.izip (counter, data)
675 def display_hint (self):
678 def register_libstdcxx_printers (obj):
679 "Register libstdc++ pretty-printers with objfile Obj."
684 obj.pretty_printers.append (lookup_function)
686 def lookup_function (val):
687 "Look-up and return a pretty-printer that can print val."
692 # If it points to a reference, get the reference.
693 if type.code == gdb.TYPE_CODE_REF:
694 type = type.target ()
696 # Get the unqualified type, stripped of typedefs.
697 type = type.unqualified ().strip_typedefs ()
704 # Iterate over local dictionary of types to determine
705 # if a printer is registered for that type. Return an
706 # instantiation of the printer if found.
707 for function in pretty_printers_dict:
708 if function.search (typename):
709 return pretty_printers_dict[function] (val)
711 # Cannot find a pretty printer. Return None.
714 def build_libstdcxx_dictionary ():
715 # libstdc++ objects requiring pretty-printing.
717 # http://gcc.gnu.org/onlinedocs/libstdc++/latest-doxygen/a01847.html
718 pretty_printers_dict[re.compile('^std::basic_string<.*>$')] = lambda val: StdStringPrinter(val)
719 pretty_printers_dict[re.compile('^std::bitset<.*>$')] = lambda val: StdBitsetPrinter("std::bitset", val)
720 pretty_printers_dict[re.compile('^std::deque<.*>$')] = lambda val: StdDequePrinter("std::deque", val)
721 pretty_printers_dict[re.compile('^std::list<.*>$')] = lambda val: StdListPrinter("std::list", val)
722 pretty_printers_dict[re.compile('^std::map<.*>$')] = lambda val: StdMapPrinter("std::map", val)
723 pretty_printers_dict[re.compile('^std::multimap<.*>$')] = lambda val: StdMapPrinter("std::multimap", val)
724 pretty_printers_dict[re.compile('^std::multiset<.*>$')] = lambda val: StdSetPrinter("std::multiset", val)
725 pretty_printers_dict[re.compile('^std::priority_queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::priority_queue", val)
726 pretty_printers_dict[re.compile('^std::queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::queue", val)
727 pretty_printers_dict[re.compile('^std::tuple<.*>$')] = lambda val: StdTuplePrinter("std::tuple", val)
728 pretty_printers_dict[re.compile('^std::set<.*>$')] = lambda val: StdSetPrinter("std::set", val)
729 pretty_printers_dict[re.compile('^std::stack<.*>$')] = lambda val: StdStackOrQueuePrinter("std::stack", val)
730 pretty_printers_dict[re.compile('^std::unique_ptr<.*>$')] = UniquePointerPrinter
731 pretty_printers_dict[re.compile('^std::vector<.*>$')] = lambda val: StdVectorPrinter("std::vector", val)
734 # Printer registrations for classes compiled with -D_GLIBCXX_DEBUG.
735 pretty_printers_dict[re.compile('^std::__debug::bitset<.*>$')] = lambda val: StdBitsetPrinter("std::__debug::bitset", val)
736 pretty_printers_dict[re.compile('^std::__debug::deque<.*>$')] = lambda val: StdDequePrinter("std::__debug::deque", val)
737 pretty_printers_dict[re.compile('^std::__debug::list<.*>$')] = lambda val: StdListPrinter("std::__debug::list", val)
738 pretty_printers_dict[re.compile('^std::__debug::map<.*>$')] = lambda val: StdMapPrinter("std::__debug::map", val)
739 pretty_printers_dict[re.compile('^std::__debug::multimap<.*>$')] = lambda val: StdMapPrinter("std::__debug::multimap", val)
740 pretty_printers_dict[re.compile('^std::__debug::multiset<.*>$')] = lambda val: StdSetPrinter("std::__debug::multiset", val)
741 pretty_printers_dict[re.compile('^std::__debug::priority_queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::__debug::priority_queue", val)
742 pretty_printers_dict[re.compile('^std::__debug::queue<.*>$')] = lambda val: StdStackOrQueuePrinter("std::__debug::queue", val)
743 pretty_printers_dict[re.compile('^std::__debug::set<.*>$')] = lambda val: StdSetPrinter("std::__debug::set", val)
744 pretty_printers_dict[re.compile('^std::__debug::stack<.*>$')] = lambda val: StdStackOrQueuePrinter("std::__debug::stack", val)
745 pretty_printers_dict[re.compile('^std::__debug::unique_ptr<.*>$')] = UniquePointerPrinter
746 pretty_printers_dict[re.compile('^std::__debug::vector<.*>$')] = lambda val: StdVectorPrinter("std::__debug::vector", val)
748 # These are the TR1 and C++0x printers.
749 # For array - the default GDB pretty-printer seems reasonable.
750 pretty_printers_dict[re.compile('^std::shared_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::shared_ptr', val)
751 pretty_printers_dict[re.compile('^std::weak_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::weak_ptr', val)
752 pretty_printers_dict[re.compile('^std::unordered_map<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::unordered_map', val)
753 pretty_printers_dict[re.compile('^std::unordered_set<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::unordered_set', val)
754 pretty_printers_dict[re.compile('^std::unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::unordered_multimap', val)
755 pretty_printers_dict[re.compile('^std::unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::unordered_multiset', val)
757 pretty_printers_dict[re.compile('^std::tr1::shared_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::tr1::shared_ptr', val)
758 pretty_printers_dict[re.compile('^std::tr1::weak_ptr<.*>$')] = lambda val: StdPointerPrinter ('std::tr1::weak_ptr', val)
759 pretty_printers_dict[re.compile('^std::tr1::unordered_map<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::tr1::unordered_map', val)
760 pretty_printers_dict[re.compile('^std::tr1::unordered_set<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::tr1::unordered_set', val)
761 pretty_printers_dict[re.compile('^std::tr1::unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::tr1::unordered_multimap', val)
762 pretty_printers_dict[re.compile('^std::tr1::unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::tr1::unordered_multiset', val)
764 # These are the C++0x printer registrations for -D_GLIBCXX_DEBUG cases.
765 # The tr1 namespace printers do not seem to have any debug
766 # equivalents, so do no register them.
767 pretty_printers_dict[re.compile('^std::__debug::unordered_map<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::__debug::unordered_map', val)
768 pretty_printers_dict[re.compile('^std::__debug::unordered_set<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::__debug::unordered_set', val)
769 pretty_printers_dict[re.compile('^std::__debug::unordered_multimap<.*>$')] = lambda val: Tr1UnorderedMapPrinter ('std::__debug::unordered_multimap', val)
770 pretty_printers_dict[re.compile('^std::__debug::unordered_multiset<.*>$')] = lambda val: Tr1UnorderedSetPrinter ('std::__debug:unordered_multiset', val)
774 pretty_printers_dict[re.compile('^__gnu_cxx::slist<.*>$')] = StdSlistPrinter
777 # These shouldn't be necessary, if GDB "print *i" worked.
778 # But it often doesn't, so here they are.
779 pretty_printers_dict[re.compile('^std::_List_iterator<.*>$')] = lambda val: StdListIteratorPrinter("std::_List_iterator",val)
780 pretty_printers_dict[re.compile('^std::_List_const_iterator<.*>$')] = lambda val: StdListIteratorPrinter("std::_List_const_iterator",val)
781 pretty_printers_dict[re.compile('^std::_Rb_tree_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
782 pretty_printers_dict[re.compile('^std::_Rb_tree_const_iterator<.*>$')] = lambda val: StdRbtreeIteratorPrinter(val)
783 pretty_printers_dict[re.compile('^std::_Deque_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
784 pretty_printers_dict[re.compile('^std::_Deque_const_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
785 pretty_printers_dict[re.compile('^__gnu_cxx::__normal_iterator<.*>$')] = lambda val: StdVectorIteratorPrinter(val)
786 pretty_printers_dict[re.compile('^__gnu_cxx::_Slist_iterator<.*>$')] = lambda val: StdSlistIteratorPrinter(val)
788 # Debug (compiled with -D_GLIBCXX_DEBUG) printer registrations.
789 # The Rb_tree debug iterator when unwrapped from the encapsulating __gnu_debug::_Safe_iterator
790 # does not have the __norm namespace. Just use the existing printer registration for that.
791 pretty_printers_dict[re.compile('^__gnu_debug::_Safe_iterator<.*>$')] = lambda val: StdDebugIteratorPrinter(val)
792 pretty_printers_dict[re.compile('^std::__norm::_List_iterator<.*>$')] = lambda val: StdListIteratorPrinter ("std::__norm::_List_iterator",val)
793 pretty_printers_dict[re.compile('^std::__norm::_List_const_iterator<.*>$')] = lambda val: StdListIteratorPrinter ("std::__norm::_List_const_iterator",val)
794 pretty_printers_dict[re.compile('^std::__norm::_Deque_const_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
795 pretty_printers_dict[re.compile('^std::__norm::_Deque_iterator<.*>$')] = lambda val: StdDequeIteratorPrinter(val)
797 pretty_printers_dict = {}
799 build_libstdcxx_dictionary ()