public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Lancelot SIX <lancelot.six@amd.com>, gdb-patches@sourceware.org
Cc: lsix@lancelotsix.com, simark@simark.ca
Subject: Re: [PATCH v5] gdb: add a symbol* argument to get_return_value
Date: Thu, 3 Feb 2022 14:26:02 -0500	[thread overview]
Message-ID: <05b64605-7491-cdac-7ad8-ce3d7c1c245a@polymtl.ca> (raw)
In-Reply-To: <20220203182821.20793-1-lancelot.six@amd.com>

> diff --git a/gdb/python/py-finishbreakpoint.c b/gdb/python/py-finishbreakpoint.c
> index 03bd4934506..2298c179ba8 100644
> --- a/gdb/python/py-finishbreakpoint.c
> +++ b/gdb/python/py-finishbreakpoint.c
> @@ -40,13 +40,15 @@ struct finish_breakpoint_object
>  {
>    /* gdb.Breakpoint base class.  */
>    gdbpy_breakpoint_object py_bp;
> -  /* gdb.Type object of the value return by the breakpointed function.
> -     May be NULL if no debug information was available or return type
> -     was VOID.  */
> -  PyObject *return_type;
> -  /* gdb.Value object of the function finished by this breakpoint.  Will be
> -     NULL if return_type is NULL.  */
> +
> +  /* gdb.Symbol object of the function finished by this breakpoint.  */
> +  PyObject *func_symbol;
> +
> +  /* gdb.Value object of the function finished by this breakpoint.
> +
> +     nullptr if no debug information was available or return type was VOID.  */
>    PyObject *function_value;

Actually I would mention the "nullptr if no debug..." part in
func_symbol's documentation as well, since in the code we do check
whether func_symbol is nullptr.

LGTM with that fixed.

And I have a question I didn't bring up before, because I don't want to
increase the scope of this patch, but I am asking just for the sake of
discussing.  Do you know why we wrapped return_type, and now
func_symbol, in Python objects?  Any reason why we don't save the struct
type / struct symbol pointer directly?  To protect against the
underlying object disappearing while the FinishBreakpoint exists, maybe?

Simon

  reply	other threads:[~2022-02-03 19:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-02 18:41 [PATCH v3 0/2] Make GDB respect the DW_CC_nocall attribute Lancelot SIX
2022-02-02 18:41 ` [PATCH v3 1/2] gdb: add a symbol* argument to get_return_value Lancelot SIX
2022-02-02 21:01   ` Simon Marchi
2022-02-02 21:59     ` [PATCH v4] " Lancelot SIX
2022-02-03  1:03       ` Simon Marchi
2022-02-03 11:10         ` Six, Lancelot
2022-02-03 12:35           ` Simon Marchi
2022-02-03 15:46         ` Lancelot SIX
2022-02-03 18:28         ` [PATCH v5] " Lancelot SIX
2022-02-03 19:26           ` Simon Marchi [this message]
2022-02-03 22:34             ` Six, Lancelot
2022-02-02 18:41 ` [PATCH v3 2/2] gdb: Respect the DW_CC_nocall attribute Lancelot SIX
2022-02-08 14:27   ` Simon Marchi
2022-02-15 10:53     ` Lancelot SIX

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=05b64605-7491-cdac-7ad8-ce3d7c1c245a@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=lancelot.six@amd.com \
    --cc=lsix@lancelotsix.com \
    --cc=simark@simark.ca \
    /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).