Re: [PATCH] PR59170 make pretty printers check for singular iterators

2016-12-16 Thread Jan Kratochvil
On Fri, 16 Dec 2016 14:17:32 +0100, Jonathan Wakely wrote: > On 16/12/16 14:06 +0100, Jan Kratochvil wrote: > > (gdb) p bb.c.d > > $4 = (D &) @0x601028: {e = 0x601060 } > > Wat? > > bb.c.d is not a valid expression. > > B::c is a pointer, it should be bb.c->d > > Is it GDB policy to mak

Re: [PATCH] PR59170 make pretty printers check for singular iterators

2016-12-16 Thread Jonathan Wakely
On 16/12/16 14:06 +0100, Jan Kratochvil wrote: On Fri, 16 Dec 2016 13:33:52 +0100, Jonathan Wakely wrote: We don't do auto-deref for std::shared_ptr or std::unique_ptr, even though we know the object they point to definitely is live and safe to access, and that's because those types have pointer

Re: [PATCH] PR59170 make pretty printers check for singular iterators

2016-12-16 Thread Jan Kratochvil
On Fri, 16 Dec 2016 13:33:52 +0100, Jonathan Wakely wrote: > We don't do auto-deref for std::shared_ptr or std::unique_ptr, even > though we know the object they point to definitely is live and safe to > access, and that's because those types have pointer semantics not > reference semantics. This

Re: [PATCH] PR59170 make pretty printers check for singular iterators

2016-12-16 Thread Jonathan Wakely
On 16/12/16 08:51 +0100, Jan Kratochvil wrote: On Fri, 16 Dec 2016 02:07:07 +0100, Jonathan Wakely wrote: On 15/12/16 22:19 +0100, Jan Kratochvil wrote: > Just with the GDB 'compile' project (libcc1) which is planned to be used for > all GDB expressions evalation the Xmethods will no longer work

Re: [PATCH] PR59170 make pretty printers check for singular iterators

2016-12-15 Thread Jan Kratochvil
On Fri, 16 Dec 2016 02:07:07 +0100, Jonathan Wakely wrote: > On 15/12/16 22:19 +0100, Jan Kratochvil wrote: > > Just with the GDB 'compile' project (libcc1) which is planned to be used for > > all GDB expressions evalation the Xmethods will no longer work. > > But then *it can just get compiled, s

Re: [PATCH] PR59170 make pretty printers check for singular iterators

2016-12-15 Thread Jonathan Wakely
On 15/12/16 22:19 +0100, Jan Kratochvil wrote: On Thu, 15 Dec 2016 15:18:17 +0100, Jonathan Wakely wrote: I'm going to add Xmethods for all our iterator types so that it will always be possible to do "print *iter", so if GDB supports Xmethods then we don't need to register the iterator printers.

Re: [PATCH] PR59170 make pretty printers check for singular iterators

2016-12-15 Thread Jan Kratochvil
On Thu, 15 Dec 2016 15:18:17 +0100, Jonathan Wakely wrote: > I'm going to add Xmethods for all our iterator types so that it will > always be possible to do "print *iter", so if GDB supports Xmethods > then we don't need to register the iterator printers. Just with the GDB 'compile' project (libcc

[PATCH] PR59170 make pretty printers check for singular iterators

2016-12-15 Thread Jonathan Wakely
This is another partial fix for PR 59170, this time adding checks for normal mode iterators that are default-constructed, so we don't try to dereference null pointers. We still auto-dereference past-the-end iterators, and iterators that have been invalidated by container mutation. The former can