public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: Torbjorn SVENSSON <torbjorn.svensson@foss.st.com>,
	gdb-patches@sourceware.org
Cc: tom@tromey.com, brobecker@adacore.com
Subject: Re: [PATCH v3] gdb/arm: Handle lazy FPU register stacking
Date: Fri, 30 Sep 2022 16:52:49 +0100	[thread overview]
Message-ID: <301788c6-6391-f9d3-8e70-06fbea21f413@palves.net> (raw)
In-Reply-To: <0aa66097-a196-6ca8-e47f-45fae4482cfa@foss.st.com>

On 2022-09-30 4:26 p.m., Torbjorn SVENSSON wrote:
> Hi,
> 
> On 2022-09-30 17:13, Pedro Alves wrote:

>> Is there really no self-contained way to tell that a frame is a "following frame
>> after lazy stack has been enabled" ?  E.g., can we look at the address in
>> FPCAR and decide based on it, compared to the current frame address, or something
>> like that?
> 
> As the function is Cortex-M specific, I suppose it would be fine to assume that the stack always grows downwards. With this assumption, I suppose we could compare the value in FPCAR with the value of $sp of the frame to be unwinded after the current frame.
> - If the value is lower, then I think it's safe to assume that the stacked content should be used.
> - If the value is greater, then I think it's safe to assume that it's up to LSPACT, LSPEN and ASPEN to define if it's going to be register or stacked content that should be used.
> 
> Does this sound reasonable?
> 

It does to me.

I suppose the scheme could break if it's possible to have something
like sigaltstack, or coroutines, i.e., some frames after lazy FPU has been enabled are
actually running with a different stack.  Not sure, maybe you'd never see lazy FPU
stacking be enabled across the cpu/thread switching stacks?

> I'll try to find some time later today or in the weekend to give it a try.
> 

Thanks.

      reply	other threads:[~2022-09-30 15:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-27 19:09 Torbjörn SVENSSON
2022-09-27 20:08 ` Thiago Jung Bauermann
2022-09-27 20:27   ` Torbjorn SVENSSON
2022-09-30  2:55     ` Thiago Jung Bauermann
2022-09-30 13:20       ` Luis Machado
2022-09-30 15:13 ` Pedro Alves
2022-09-30 15:26   ` Torbjorn SVENSSON
2022-09-30 15:52     ` Pedro Alves [this message]

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=301788c6-6391-f9d3-8e70-06fbea21f413@palves.net \
    --to=pedro@palves.net \
    --cc=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    --cc=torbjorn.svensson@foss.st.com \
    /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).