Re: Remote query for structure layout

Tim Newsome <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <CAGDihenjc+2P2we4i5+Zm8Fkzmj-FvHrpHN6HHzvQGZWgehERg@mail.gmail.com>
On Tue, Mar 30, 2021 at 8:27 PM David Blaikie <[email protected]> wrote:

> (guess a side question: How's this different from other systems? I
> don't know how other/more common systems handle registers during
> signals)


Other systems have this same problem.
https://sourceforge.net/p/openocd/code/ci/master/tree/src/rtos/FreeRTOS.c
around line 440 has some heuristics.
For ARM, it assumes there are FPU registers on the stack "if (cpacr &
0x00F00000)".
For Cortex-M, it checks whether there are FPU registers on the stack by
reading something else off the stack.

The problem is worse on RISC-V because the architecture is intended to be
extensible. E.g. for pulpino additional registers are saved on the stack,
defined in
https://github.com/FreeRTOS/FreeRTOS-Kernel/blob/95433d02848af0d274648ae4cdd846f6eff76dde/portable/GCC/RISC-V/chip_specific_extensions/Pulpino_Vega_RV32M1RM/freertos_risc_v_chip_specific_extensions.h#L76

Tim
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.