RFA: PATCH to add pp command to gdbinit.in

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

RFA: PATCH to add pp command to gdbinit.in

Jason Merrill
Since pvt was removed, it's bugged me that to pretty-print a vec I
needed to write out "call debug($)".  So this patch adds a generic
command "pp" to print anything handled by a debug overload.

OK for trunk?

pp.diff (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: RFA: PATCH to add pp command to gdbinit.in

Eric Gallager
On 12/6/18, Jason Merrill <[hidden email]> wrote:
> Since pvt was removed, it's bugged me that to pretty-print a vec I
> needed to write out "call debug($)".  So this patch adds a generic
> command "pp" to print anything handled by a debug overload.
>
> OK for trunk?
>

Why does it also change pbb to do the same thing as the new pp command
you're adding?
Reply | Threaded
Open this post in threaded view
|

Re: RFA: PATCH to add pp command to gdbinit.in

Jason Merrill
On Sun, Dec 9, 2018, 7:42 PM Eric Gallager <[hidden email] wrote:

> On 12/6/18, Jason Merrill <[hidden email]> wrote:
> > Since pvt was removed, it's bugged me that to pretty-print a vec I
> > needed to write out "call debug($)".  So this patch adds a generic
> > command "pp" to print anything handled by a debug overload.
> >
> > OK for trunk?
> >
>
> Why does it also change pbb to do the same thing as the new pp command
> you're adding?
>

I assumed that some people were used to using pbb for basic_blocks. But on
reflection, the command before my patch didn't work at all, so it's
unlikely anyone was relying on it, so it's probably better to remove it.

Jason

>
Reply | Threaded
Open this post in threaded view
|

Re: RFA: PATCH to add pp command to gdbinit.in

Jeff Law
In reply to this post by Jason Merrill
On 12/6/18 1:59 PM, Jason Merrill wrote:
> Since pvt was removed, it's bugged me that to pretty-print a vec I
> needed to write out "call debug($)".  So this patch adds a generic
> command "pp" to print anything handled by a debug overload.
>
> OK for trunk?
>
Seems quite reasonable.  I didn't even know we had a debug method for vecs.

I wonder if we should standardize this stuff so that every significant
datastructure has a debug method.

jeff

Reply | Threaded
Open this post in threaded view
|

Re: RFA: PATCH to add pp command to gdbinit.in

Marek Polacek-3
On Thu, Dec 13, 2018 at 10:15:07AM -0700, Jeff Law wrote:
> On 12/6/18 1:59 PM, Jason Merrill wrote:
> > Since pvt was removed, it's bugged me that to pretty-print a vec I
> > needed to write out "call debug($)".  So this patch adds a generic
> > command "pp" to print anything handled by a debug overload.
> >
> > OK for trunk?
> >
> Seems quite reasonable.  I didn't even know we had a debug method for vecs.

Yeah, I think go ahead.  Speaking of which, in the C++ FE, I used to could do
this:

(gdb) call debug(parser)

but that now prints some crap like [128], and so I have to type

(gdb) call cp_debug_parser(stderr,parser)

which bothers me very very much.  Anyone know what's up with that?  It used to
work.

Marek
Reply | Threaded
Open this post in threaded view
|

Re: RFA: PATCH to add pp command to gdbinit.in

Jason Merrill
On Thu, Dec 13, 2018 at 12:26 PM Marek Polacek <[hidden email]> wrote:
> On Thu, Dec 13, 2018 at 10:15:07AM -0700, Jeff Law wrote:
> > On 12/6/18 1:59 PM, Jason Merrill wrote:
> > > Since pvt was removed, it's bugged me that to pretty-print a vec I
> > > needed to write out "call debug($)".  So this patch adds a generic
> > > command "pp" to print anything handled by a debug overload.
> > >
> > > OK for trunk?
> > >
> > Seems quite reasonable.  I didn't even know we had a debug method for vecs.

> > I wonder if we should standardize this stuff so that every significant
> > datastructure has a debug method.

Yes, I thought that was the idea.

> Yeah, I think go ahead.  Speaking of which, in the C++ FE, I used to could do
> this:
>
> (gdb) call debug(parser)
>
> but that now prints some crap like [128], and so I have to type
>
> (gdb) call cp_debug_parser(stderr,parser)
>
> which bothers me very very much.  Anyone know what's up with that?  It used to
> work.

Hmm, it works for me.

Jason
Reply | Threaded
Open this post in threaded view
|

Re: RFA: PATCH to add pp command to gdbinit.in

Marek Polacek-3
On Thu, Dec 13, 2018 at 12:48:37PM -0500, Jason Merrill wrote:

> On Thu, Dec 13, 2018 at 12:26 PM Marek Polacek <[hidden email]> wrote:
> > On Thu, Dec 13, 2018 at 10:15:07AM -0700, Jeff Law wrote:
> > > On 12/6/18 1:59 PM, Jason Merrill wrote:
> > > > Since pvt was removed, it's bugged me that to pretty-print a vec I
> > > > needed to write out "call debug($)".  So this patch adds a generic
> > > > command "pp" to print anything handled by a debug overload.
> > > >
> > > > OK for trunk?
> > > >
> > > Seems quite reasonable.  I didn't even know we had a debug method for vecs.
>
> > > I wonder if we should standardize this stuff so that every significant
> > > datastructure has a debug method.
>
> Yes, I thought that was the idea.
>
> > Yeah, I think go ahead.  Speaking of which, in the C++ FE, I used to could do
> > this:
> >
> > (gdb) call debug(parser)
> >
> > but that now prints some crap like [128], and so I have to type
> >
> > (gdb) call cp_debug_parser(stderr,parser)
> >
> > which bothers me very very much.  Anyone know what's up with that?  It used to
> > work.
>
> Hmm, it works for me.

Aha -- I had to
(gdb) set overload-resolution on
which I had had set to off for some other reasons.

Marek