public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Doug Evans <xdje42@gmail.com>
To: Siva Chandra <sivachandra@google.com>
Cc: gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Debug Methods in GDB Python
Date: Mon, 16 Dec 2013 17:56:00 -0000	[thread overview]
Message-ID: <CAP9bCMT0M9ZM+hiF9A0jKb125F+9a9b84+hp9mNkj7ek-a0T-w@mail.gmail.com> (raw)
In-Reply-To: <CAGyQ6gycVe2-32djRDfYBWjGQ2LLwqzzR1q0iFBoW+zG5vttvg@mail.gmail.com>

On Fri, Dec 13, 2013 at 11:24 AM, Siva Chandra <sivachandra@google.com> wrote:
>> On Fri, Dec 6, 2013 at 3:24 PM, Siva Chandra <sivachandra@google.com> wrote:
>> I have removed DEFAULT_DEBUG_METHOD_GROUP from the code in my latest
>> patch. However, there is one reference to it in the brief (really
>> brief!) doc change I have in the patch [1]. About grouping in
>> libstdc++, is it not doing a grouping within what is facilitated by
>> the pretty printing API?
>
> dje > Not sure I understand the question.
>
> libstdc++ pretty printers use the pretty printing API provided by GDB
> Python. So, if we are to compare debug methods API to something,
> shouldn't we be comparing with the pretty printing API? About the
> matching API provided by the debug methods API in my patch, there
> isn't anything specific at all. The users can match class name and
> method name in whatever manner they please. If they like the libstdc++
> pretty printers way, then they can do it that way.

Ah.

Note that the grouping in the pretty-printer API is because one
pretty-printer can pretty-print several objects, and the functionality
is split into two steps: the lookup object returns a separate object
which is then later used to do the printing, and the lookup can record
in the returned pretty-printer-worker object whatever state it wants.
In dm-v6 AFAICT lookup and functionality exist in the same object so
that's not possible (e.g., the DebugMethod.match method returns
True/False instead of, e.g., a debug-method-worker object).

We could, I think(!), go with debug-methods as in v6, sans method
groups, and later extend it if a more formal grouping is needed.
I wonder, though, about the match method returning True/False vs the
pretty-printer way of the lookup object returning an object that then
does the printing.
[In the debug method case the lookup method might want to return a
list if the method is overloaded.]
Unless there's a compelling reason to be different, I like
"Consistency Is Good", so that's what I'm shooting for.
[But if there is a compelling reason to be different, I'm not opposed
to being different here.]

  reply	other threads:[~2013-12-16 17:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-22 22:41 Siva Chandra
2013-11-26  3:22 ` Siva Chandra
2013-12-06  6:31   ` Doug Evans
2013-12-06 23:24     ` Siva Chandra
2013-12-12  5:26       ` Doug Evans
2013-12-13 19:25         ` Siva Chandra
2013-12-16 17:56           ` Doug Evans [this message]
2013-12-16 22:43             ` Siva Chandra
2014-01-01 12:23             ` Siva Chandra
2014-01-03 18:52               ` Doug Evans
2014-01-08  0:49                 ` Siva Chandra
2014-01-09 19:01                   ` Doug Evans

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=CAP9bCMT0M9ZM+hiF9A0jKb125F+9a9b84+hp9mNkj7ek-a0T-w@mail.gmail.com \
    --to=xdje42@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=sivachandra@google.com \
    /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).