public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Burgess <aburgess@redhat.com>
To: gdb-patches@sourceware.org
Cc: Andrew Burgess <aburgess@redhat.com>
Subject: [PATCHv3 0/2] Add __repr__() implementation to a few Python types
Date: Fri, 19 May 2023 22:27:56 +0100	[thread overview]
Message-ID: <cover.1684529933.git.aburgess@redhat.com> (raw)
In-Reply-To: <20230518033357.77174-1-dark.ryu.550@gmail.com>

Matheus,

Thanks for moving this forward.

I took a look through, and I think this looks great.  I noticed a few
whitespace issues with the patch, so I fixed all of them.  But during
testing I ended up making a few more changes, so I figured I'd just
post what I ended up with.

The biggest change you'll see is a whole extra patch.  It turns out
that the way you were using mdict_size wasn't correct -- mdict_size
doesn't always return the number of symbols!  As a result the symbol
list for block_func (in the py-block.exp test) would end up printed
without comma's between the symbols.  Anyway, the new first patch
fixes this.

While we're in py-block.c, I changed the output format.  Rather than
displaying the symbols one per line, they are now listed all on one
line.  The multi-line format looks great if all you are displaying is
the one object's repr, but if the repr is printed as part of a larger
string then I think the multi-line layout doesn't look as good.  Now
we're only printing a few symbols I figure we can afford to go with a
one line layout.

On the testing side I've tightened the patterns in py-block.exp, and
extended the test to check the ouptut in block_func -- this exposes
the mdict_size issue.

I've added some tests for gdb.BreakpointLocation, which were missing.

And I've made the patterns in py-breakpoint.exp more precise, and
added some additional tests to catch more cases.

Would be great to hear your thoughts on the updates,

Thanks,
Andrew

---

Andrew Burgess (1):
  gdb: have mdict_size always return a symbol count

Matheus Branco Borella via Gdb-patches (1):
  gdb: add __repr__() implementation to a few Python types

 gdb/dictionary.c                             | 13 +++-
 gdb/dictionary.h                             |  3 +-
 gdb/python/py-arch.c                         | 17 ++++-
 gdb/python/py-block.c                        | 37 ++++++++++-
 gdb/python/py-breakpoint.c                   | 67 ++++++++++++++++++-
 gdb/python/py-symbol.c                       | 15 ++++-
 gdb/python/py-type.c                         | 30 ++++++++-
 gdb/symmisc.c                                |  2 +-
 gdb/testsuite/gdb.python/py-arch.exp         |  6 ++
 gdb/testsuite/gdb.python/py-block.c          | 31 +++++++++
 gdb/testsuite/gdb.python/py-block.exp        | 38 ++++++++++-
 gdb/testsuite/gdb.python/py-bp-locations.exp | 32 +++++++++
 gdb/testsuite/gdb.python/py-breakpoint.exp   | 69 +++++++++++++++++---
 gdb/testsuite/gdb.python/py-symbol.exp       |  2 +
 gdb/testsuite/gdb.python/py-type.exp         |  4 ++
 15 files changed, 343 insertions(+), 23 deletions(-)


base-commit: e84060b489746d031ed1ec9e7b6b39fdf4b6cfe3
-- 
2.25.4


  reply	other threads:[~2023-05-19 21:28 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3Cc9d2dc49-45c7-d6b9-c567-4ec78dd870a0>
2023-01-11  0:35 ` [PATCH] " Matheus Branco Borella
2023-01-18 17:05   ` Bruno Larsen
2023-01-18 18:02   ` Andrew Burgess
2023-01-19  8:23     ` Bruno Larsen
2023-01-20  1:43     ` Matheus Branco Borella
2023-01-20 16:45       ` Andrew Burgess
2023-01-24 14:45       ` Andrew Burgess
2023-05-18  3:33         ` Matheus Branco Borella
2023-05-19 21:27           ` Andrew Burgess [this message]
2023-05-19 21:27             ` [PATCHv3 1/2] gdb: have mdict_size always return a symbol count Andrew Burgess
2023-05-19 21:27             ` [PATCHv3 2/2] gdb: add __repr__() implementation to a few Python types Andrew Burgess
2023-06-07 17:05             ` [PATCHv3 0/2] Add " Matheus Branco Borella
2023-06-08 18:46               ` Andrew Burgess
2023-06-09 12:33               ` Andrew Burgess
2023-07-04 11:09                 ` Andrew Burgess

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=cover.1684529933.git.aburgess@redhat.com \
    --to=aburgess@redhat.com \
    --cc=gdb-patches@sourceware.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).