public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Lawrence Crowl <crowl@googlers.com>
Cc: gcc-patches List <gcc-patches@gcc.gnu.org>
Subject: Re: [patch] Unified debug dump function names.
Date: Tue, 26 Mar 2013 09:25:00 -0000	[thread overview]
Message-ID: <CAFiYyc2=Fe9JJ3Wog3XG4B5gPUO9_n6qP_L6wd-FZuDm4hpQxQ@mail.gmail.com> (raw)
In-Reply-To: <CAGqM8fYMya8O3=QEWkFp2+YHt7xUcx=C9kwSwgpoL-XmjyzDgQ@mail.gmail.com>

On Mon, Mar 25, 2013 at 6:19 PM, Lawrence Crowl <crowl@googlers.com> wrote:
> On 3/25/13, Richard Biener <richard.guenther@gmail.com> wrote:
>> You add a not used new interface.  What for?
>
> So that people can use it.
>
>> For use from gdb only?
>
> No, for use from both gdb and internally.  It is often that folks add
> dumps in various places while developing/debugging.  These functions
> support that effort without having to hunt down the name.

But having both interfaces is bad.  As you are unconditionally "dumping"
to stderr using debug () is correct.  Sorry that I don't follow each and every
proposal - nobody follows up my proposals either.

The dump_ namespace is claimed by dumping to dumpfiles and diagnostics.

>> In which case it should be debug (), not dump ().
>
> I will use whatever name you wish, but I would have preferred that
> we addressed naming issues when we published the plan, not after
> I've done the implementation.  What name do you wish?

debug ().

And I'd like you to remove the alternate debug_ interface that is obsoleted
by the overloads.

Btw, the overloading will provide extra headache to one of the most used
ways to the debug_ routines:

(gdb) call debug_tree (fndecl)
 <function_decl 0x7ffff6e1b900 foo
    type <function_type 0x7ffff6d28c78
        type <integer_type 0x7ffff6d175e8 int public SI
            size <integer_cst 0x7ffff6d1a0c0 constant 32>
            unit size <integer_cst 0x7ffff6d1a0e0 constant 4>
            align 32 symtab 0 alias set -1 canonical type
0x7ffff6d175e8 precision 32 min <integer_cst 0x7ffff6d1a060
-2147483648> max <integer_cst 0x7ffff6d1a080 2147483647>
...
(gdb) call debug_tree (0x7ffff6d175e8)
Cannot resolve function debug_tree to any overloaded instance
(gdb) call debug_tree<tab><tab>
debug_tree(tree_node*)
debug_tree_chain(tree_node*)
debug_tree_chain(tree_node*)::__FUNCTION__
debug_tree_ssa()
debug_tree_ssa_stats()
<aha! (ok, I know this one is 'tree')>
(gdb) call debug_tree ((tree_node*)0x7ffff6d175e8)
 <integer_type 0x7ffff6d175e8 int public SI
    size <integer_cst 0x7ffff6d1a0c0 type <integer_type 0x7ffff6d170a8
bitsizetype> constant 32>
    unit size <integer_cst 0x7ffff6d1a0e0 type <integer_type
0x7ffff6d17000 sizetype> constant 4>
    align 32 symtab 0 alias set -1 canonical type 0x7ffff6d175e8
precision 32 min <integer_cst 0x7ffff6d1a060 -2147483648> max
<integer_cst 0x7ffff6d1a080 2147483647>
    pointer_to_this <pointer_type 0x7ffff6d1f2a0>>

but with debug () having overloads to each and every thing we'd ever want to
debug the list of possible types I have to cast that literal address I
cut&pasted
will be endless.

Any suggestion on how to improve this situation?  Yes, it's already
bad as with typing debug_tree I know it's a tree I am interested in and

(gdb) call debug_<tab><tab>
... endless list of functions and overloads ...

is probably as useless as

(gdb) call debug<tab><tab>

is after your patch.

Thanks,
Richard.

> --
> Lawrence Crowl

  reply	other threads:[~2013-03-26  9:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-23 22:31 Lawrence Crowl
2013-03-25  9:25 ` Richard Biener
2013-03-25 17:20   ` Lawrence Crowl
2013-03-26  9:25     ` Richard Biener [this message]
2013-03-26 18:20       ` Lawrence Crowl
2013-03-26 23:50         ` Lawrence Crowl
2013-03-27  9:26           ` Richard Biener
2013-03-27 16:15             ` Lawrence Crowl
2013-03-28  9:25               ` Richard Biener
2013-03-29  5:54                 ` Lawrence Crowl
2013-03-25 13:45 ` Tom Tromey
2013-03-25 17:25   ` Lawrence Crowl
2013-03-25 17:59     ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAFiYyc2=Fe9JJ3Wog3XG4B5gPUO9_n6qP_L6wd-FZuDm4hpQxQ@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=crowl@googlers.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).