* [v3 PATCH] Adjust optional's pretty printer for LWG 2900.
@ 2017-03-29 12:02 Ville Voutilainen
2017-03-29 13:00 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Ville Voutilainen @ 2017-03-29 12:02 UTC (permalink / raw)
To: libstdc++, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
Tested on Linux-x64.
2017-03-29 Ville Voutilainen <ville.voutilainen@gmail.com>
Adjust optional's pretty printer for LWG 2900.
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter::__init__):
Look at the nested payload in case of non-experimental optional.
[-- Attachment #2: opt-pp.diff --]
[-- Type: text/plain, Size: 843 bytes --]
diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py
index 14025dd..a67b27a 100644
--- a/libstdc++-v3/python/libstdcxx/v6/printers.py
+++ b/libstdc++-v3/python/libstdcxx/v6/printers.py
@@ -1023,6 +1023,8 @@ class StdExpOptionalPrinter(SingleObjContainerPrinter):
valtype = self._recognize (val.type.template_argument(0))
self.typename = re.sub('^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3<%s>' % valtype, typename, 1)
self.typename = strip_versioned_namespace(self.typename)
+ if not self.typename.startswith('std::experimental'):
+ val = val['_M_payload']
self.val = val
contained_value = val['_M_payload'] if self.val['_M_engaged'] else None
visualizer = gdb.default_visualizer (val['_M_payload'])
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [v3 PATCH] Adjust optional's pretty printer for LWG 2900.
2017-03-29 12:02 [v3 PATCH] Adjust optional's pretty printer for LWG 2900 Ville Voutilainen
@ 2017-03-29 13:00 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2017-03-29 13:00 UTC (permalink / raw)
To: Ville Voutilainen; +Cc: libstdc++, gcc-patches
On 29/03/17 14:51 +0300, Ville Voutilainen wrote:
>Tested on Linux-x64.
>
>2017-03-29 Ville Voutilainen <ville.voutilainen@gmail.com>
>
> Adjust optional's pretty printer for LWG 2900.
> * python/libstdcxx/v6/printers.py (StdExpOptionalPrinter::__init__):
> Look at the nested payload in case of non-experimental optional.
OK.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-29 12:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-29 12:02 [v3 PATCH] Adjust optional's pretty printer for LWG 2900 Ville Voutilainen
2017-03-29 13:00 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).