This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: Fix some _GLIBCXX_DEBUG pretty printer errors
- From: Jonathan Wakely <jwakely dot gcc at gmail dot com>
- To: François Dumont <frs dot dumont at gmail dot com>
- Cc: "libstdc++ at gcc dot gnu dot org" <libstdc++ at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 6 Mar 2018 21:21:20 +0000
- Subject: Re: Fix some _GLIBCXX_DEBUG pretty printer errors
- Authentication-results: sourceware.org; auth=none
- References: <62558510-8551-9275-d4dd-94acbd8914e0@gmail.com>
On 5 February 2018 at 06:49, François Dumont wrote:
> Hi
>
> Here is a patch to fix some pretty printer check errors when running
> those tests with _GLIBCXX_DEBUG.
>
> I introduced a special rendered for the std::forward_list iterator which
> is similar to the one used for the std::list and so used inheritance, I hope
> it is not a problem for Python 2/3 compatibility.
>
> I prefer to just rely on normal iterator rendered when we detect that
> iterator hasn't been initialized so that normal or debug modes give the same
> result.
>
> Ok to commit ?
>
> François
>
>
>@@ -575,10 +586,12 @@ class StdDebugIteratorPrinter:
> # and return the wrapped iterator value.
> def to_string (self):
> base_type = gdb.lookup_type('__gnu_debug::_Safe_iterator_base')
>+ itype = self.val.type.template_argument(0)
> safe_seq = self.val.cast(base_type)['_M_sequence']
>- if not safe_seq or self.val['_M_version'] != safe_seq['_M_version']:
>+ if not safe_seq:
>+ return str(self.val.cast(itype))
So what's the effect of this change when we get a value-initialized
debug iterator? It prints the wrapped (value-initialized) non-debug
iterator instead?