From: Doug Evans <dje@google.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH/RFA] Introduce new $_isvoid() convenience function
Date: Thu, 12 Sep 2013 23:59:00 -0000 [thread overview]
Message-ID: <CADPb22Q-66NK8u3DLTSG0K7QSYNaxVa0SRBQoBCXoLy7OHvZ9w@mail.gmail.com> (raw)
In-Reply-To: <m3a9jh6bs0.fsf@redhat.com>
On Thu, Sep 12, 2013 at 1:11 PM, Sergio Durigan Junior
<sergiodj@redhat.com> wrote:
> gdb/
> 2013-09-12 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * NEWS: Mention new convenience function $_isvoid.
> * value.c (isvoid_internal_fn): New function.
> (_initialize_values): Add new convenience function $_isvoid.
>
> gdb/doc/
> 2013-09-12 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * gdb.texinfo (Convenience Functions): Mention new convenience
> function $_isvoid.
>
> gdb/testsuite/
> 2013-09-12 Sergio Durigan Junior <sergiodj@redhat.com>
>
> * gdb.base/gdbvars.exp (test_convenience_functions): New
> function. Call it.
Hi. Thanks for persevering!
While I often follow "it's easier to relax restrictions than impose
them after the fact",
in this case I wonder if there's any reason to restrict $_isvoid() to
convenience variables.
Thoughts?
For "void foo(){}", is there any real difference to:
(gdb) set $foo = foo()
(gdb) p $_isvoid($foo)
(gdb) p $_isvoid(foo())
[Haven't tried it, but I'm guessing removing the internalva4 check in
your patch would make that work.]
Also, you've put a fair bit of time into this, and I'm happy with
what you've got. And thanks!
The high order bit here for me is being able to script $_exitcode + $exitsignal.
If we're going with checking for a void value, one could just leave it
to be handled in Python.
OTOH, this patch is really simple, and IMO it is *nice* to be able to
do this from just a plain gdb script,
so I'm advocating accepting this patch (modulo maybe handling any void
value, not just conv vars).
btw, I noticed that if I run a program to exit, and then rerun to
main, $_exitcode has the last exit code - I would have expected it to
get reset to void upon rerun. After all, if I stop at main the first
time through, $_exitcode is void.
[I'll file a bug, no need to address this in your patch series.]
next prev parent reply other threads:[~2013-09-12 23:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-12 20:11 Sergio Durigan Junior
2013-09-12 23:59 ` Doug Evans [this message]
2013-09-13 6:42 ` Sergio Durigan Junior
2013-09-13 7:30 ` Eli Zaretskii
2013-09-13 17:45 ` Sergio Durigan Junior
2013-09-13 19:33 ` Eli Zaretskii
2013-09-13 19:41 ` Sergio Durigan Junior
2013-09-13 19:47 ` Eli Zaretskii
2013-09-13 21:17 ` Sergio Durigan Junior
2013-09-14 7:00 ` Eli Zaretskii
2013-09-16 17:19 ` Sergio Durigan Junior
2013-09-16 17:23 ` Doug Evans
2013-09-16 17:47 ` Sergio Durigan Junior
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=CADPb22Q-66NK8u3DLTSG0K7QSYNaxVa0SRBQoBCXoLy7OHvZ9w@mail.gmail.com \
--to=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=sergiodj@redhat.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