public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: "Six, Lancelot" <Lancelot.Six@amd.com>,
	"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 07:35:44 -0500	[thread overview]
Message-ID: <34fdb9a1-3c9c-c558-cbc5-5ac39a28185d@polymtl.ca> (raw)
In-Reply-To: <PH0PR12MB5452F9D481C6B69FDF2D689283289@PH0PR12MB5452.namprd12.prod.outlook.com>



On 2022-02-03 06:10, Six, Lancelot wrote:
> [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?

I wouldn't get rid of the `value *` argument, as you said this is
obtained using read_var_value and the current frame.  So if we don't
pass the `value *`, we would need to pass the frame, there's no point in
doing that change.

I'm just talking about removing the `type *` argument, which in both
callers of get_return_value, is obtained using:

  TYPE_TARGET_TYPE (SYMBOL_TYPE (function));

where `function` is the struct symbol that we also pass to
get_return_value.

Simon

  reply	other threads:[~2022-02-03 12:36 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 [this message]
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=34fdb9a1-3c9c-c558-cbc5-5ac39a28185d@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=Lancelot.Six@amd.com \
    --cc=gdb-patches@sourceware.org \
    --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).