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>,
	Bruno Larsen <blarsen@redhat.com>,
	 "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: "lsix@lancelotsix.com" <lsix@lancelotsix.com>
Subject: RE: [PATCH v2 2/2] gdb: Respect the DW_CC_nocall attribute
Date: Mon, 31 Jan 2022 14:34:33 +0000	[thread overview]
Message-ID: <PH0PR12MB54529BE01C11DFCD5A6E550F83259@PH0PR12MB5452.namprd12.prod.outlook.com> (raw)
In-Reply-To: <310c1cc5-29c7-bfe5-0421-850df50dd8bf@polymtl.ca>

[AMD Official Use Only]

> Some more comments.
>
> Git gave me this warning when applying, maybe something to fix:
> 
> Applying: gdb: Respect the DW_CC_nocall attribute
> .git/rebase-apply/patch:148: new blank line at EOF.
> +
> warning: 1 line adds whitespace errors.

Thanks for pointing this out, I'll look into it before V3.

>>> +      if (funaddr != 0)
>>> +    fname = get_function_name (funaddr, buf, sizeof (buf));
>>> +
>>> +      if (fname != nullptr)
>
> My understand is that fname will be nullptr if funaddr is 0.  Can you explain when funaddr is 0, and what that means?  Just trying to understand how we can get there.

Yes.

I do not think this is possible, but I am not sure I can guaranty it (0 is still a value return value of value_address).   Anyway, given your next comment, if I can get a symbol* down to this point this question will not have to be addressed, and it will simplify things.

>
> My other comments about this would be:
>
> - One caller of this command, finish_command_fsm::should_stop, starts
>    from a struct symbol.  Getting the name from that is easy, you can
>   simply call 'print_name' on it (as shown by your change in
>   return_command).
> - The other caller of get_return_value is bpfinishpy_pre_stop_hook.
>   bpfinishpy_pre_stop_hook does not have access to a struct symbol
>   directly, but maybe it could, if we saved the symbol used to set
>   finish_breakpoint_object::function_value, bpfinishpy_init.
>
> So if we can always have access to the symbol somehow, maybe we can avoid using get_function_name in get_return_value.

This was my first approach as well.  However, I did this to avoid diving into changing the python stuff to make the symbol available to bpfinishpy_pre_stop_hook.  I'll look a bit more at what it takes to have the symbol passed down to this point.  This might very well be easier (and avoid having to rely on the first patch).

>>> +    warning (_("The function '%s' does not follow the target calling "
>
> I think that when naming the thing, you should omit the "The" in front.
> For example, you'd say "President Biden", or "The president", but not "The president Biden".  Maybe I'm wrong, I'm not a native english speaker.

I am no native English speaker, so I do not know what the proper wording is either 😉 I'll update this.

Thanks for the comment,
Lancelot.

> Simon

  reply	other threads:[~2022-01-31 14:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 14:29 [PATCH v2 0/2] Make GDB respect " Lancelot SIX
2022-01-28 14:29 ` [PATCH v2 1/2] gdb: Move most of get_function_name (COREADDR) in symtab.h Lancelot SIX
2022-01-31 13:17   ` Bruno Larsen
2022-01-28 14:29 ` [PATCH v2 2/2] gdb: Respect the DW_CC_nocall attribute Lancelot SIX
2022-01-31 13:19   ` Bruno Larsen
2022-01-31 14:05     ` Simon Marchi
2022-01-31 14:34       ` Six, Lancelot [this message]
2022-01-31 14:36         ` Simon Marchi
2022-01-31 14:19     ` Six, Lancelot

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=PH0PR12MB54529BE01C11DFCD5A6E550F83259@PH0PR12MB5452.namprd12.prod.outlook.com \
    --to=lancelot.six@amd.com \
    --cc=blarsen@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=lsix@lancelotsix.com \
    --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).