This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix some _GLIBCXX_DEBUG pretty printer errors
On 7 March 2018 at 17:39, François Dumont wrote:
> On 06/03/2018 22:21, Jonathan Wakely wrote:
>>
>>
>>> @@ -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?
>>
> Yes, for instance this test in smiple11.cc:
>
>
> std::deque<int>::iterator deqiter0;
> // { dg-final { note-test deqiter0 {non-dereferenceable iterator for
> std::deque} } }
>
> Was failing when running 'make check-debug
> RUNTESTFLAGS=prettyprinters.exp' because it was displaying 'invalid
> iterator' rather than non-dereferenceable. Now it is succeeded.
OK, thanks for confirming.
This is OK for trunk, thanks. If anybody complains about the missing
printers for the __norm types we can add them back again.