public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Six, Lancelot" <Lancelot.Six@amd.com>
To: Simon Marchi <simon.marchi@polymtl.ca>,
	"simark@simark.ca" <simark@simark.ca>
Cc: "lsix@lancelotsix.com" <lsix@lancelotsix.com>,
	"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: RE: [PATCH v4] gdb: add a symbol* argument to get_return_value
Date: Thu, 3 Feb 2022 11:10:15 +0000	[thread overview]
Message-ID: <PH0PR12MB5452F9D481C6B69FDF2D689283289@PH0PR12MB5452.namprd12.prod.outlook.com> (raw)
In-Reply-To: <cef7b867-4474-3499-3684-4de4a07dd7bd@polymtl.ca>

[AMD Official Use Only]

> Hi Lancelot,
>
> Every time I look I keep finding nits, sorry :(

No worry.

> I have the feeling that value_type is redundant with func_symbol, since the return value type initially comes from the symbol.  So I think we could remove value_type.  In fact, it might have been redundant already, since from `struct value *function`, you should also be able to get the function type.  But there may be edge cases I don't know about.

To be honest, I did have a similar impression about the function parameter.  Once you have the function symbol, you should be able to get a value containing the function address, so this parameter is probably also redundant.  The reason I did not make this change is because the function's address is obtained with a call to:

    struct value *function = read_var_value (func_symbol, NULL, frame);

Moving this call within get_return_value might mean we use a different FRAME argument (get_current_frame ()).  I do not expect it to change anything, but because I am not 100% sure, I did not change that.

> Do you think this change below (that builds on top of your patch) would work?  Tests gdb.*/*finish*.exp pass here.

I'll probably try to remove both the value* and type* arguments and see if I have any regression (unless anyone is aware on some edge cases where this can be problematic).

WDYT?

Thanks,
Lancelot.

  reply	other threads:[~2022-02-03 11:10 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 [this message]
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
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=PH0PR12MB5452F9D481C6B69FDF2D689283289@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).