From: "Six, Lancelot" <Lancelot.Six@amd.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "lsix@lancelotsix.com" <lsix@lancelotsix.com>,
"simark@simark.ca" <simark@simark.ca>
Subject: RE: [PATCH v5] gdb: add a symbol* argument to get_return_value
Date: Thu, 3 Feb 2022 22:34:21 +0000 [thread overview]
Message-ID: <PH0PR12MB5452040EC97D208BB01B8A4C83289@PH0PR12MB5452.namprd12.prod.outlook.com> (raw)
In-Reply-To: <05b64605-7491-cdac-7ad8-ce3d7c1c245a@polymtl.ca>
[AMD Official Use Only]
> > + /* 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?
I guess it is out of consistency (but am really unsure). The return_value field is exposed as part of the python API (see bpfinishpy_get_returnvalue[1]), exposing the other fields is just a matter of adding the get function. I also did ask this myself but since all fields of finish_breakpoint_object were not exposed I thought not exposing the symbol either was OK. Having a quick look at the log, it seems that this did not change for quite some time (~10 years) so I am not sure we will get a definitive answer.
Lancelot
[1] https://www.sourceware.org/git/?p=binutils-gdb.git;a=blob;f=gdb/python/py-finishbreakpoint.c;h=03bd49345060fa48dec07298af3e4b4d50d775fa;hb=refs/heads/master#l63
>
> Simon
>
next prev parent reply other threads:[~2022-02-03 22:34 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
2022-02-03 22:34 ` Six, Lancelot [this message]
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=PH0PR12MB5452040EC97D208BB01B8A4C83289@PH0PR12MB5452.namprd12.prod.outlook.com \
--to=lancelot.six@amd.com \
--cc=gdb-patches@sourceware.org \
--cc=lsix@lancelotsix.com \
--cc=simark@simark.ca \
--cc=simon.marchi@polymtl.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).