aboutsummaryrefslogtreecommitdiff
path: root/gdb/aarch64-ravenscar-thread.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-05-04 13:08:11 -0600
committerTom Tromey <tromey@adacore.com>2022-06-14 09:08:29 -0600
commit965b71a7f739a747c6b427a96b1fa9dd26e38956 (patch)
treef4d7ba498e13bf6d548cda4a151fbbdd2b09eeee /gdb/aarch64-ravenscar-thread.c
parente73434e38f55e21cc33457ce3b218fa7b4592fec (diff)
downloadgdb-965b71a7f739a747c6b427a96b1fa9dd26e38956.zip
gdb-965b71a7f739a747c6b427a96b1fa9dd26e38956.tar.gz
gdb-965b71a7f739a747c6b427a96b1fa9dd26e38956.tar.bz2
Implement lazy FPU initialization for ravenscar
Some ravenscar runtimes implement lazy FPU handling. On these runtimes, the FPU is only initialized when a task tries to use it. Furthermore, the FP registers aren't automatically saved on a task switch -- instead, the save is deferred until the new task tries to use the FPU. Furthermore, each task's context area has a flag indicating whether the FPU has been initialized for this task. This patch teaches GDB to understand this implementation. When fetching or storing registers, GDB now checks to see whether the live FP registers should be used. If not, the task's saved FP registers will be used if the task has caused FPU initialization. Currently only AArch64 uses this code. bb-runtimes implements this for ARM as well, but GDB doesn't yet have an arm-ravenscar-thread.c.
Diffstat (limited to 'gdb/aarch64-ravenscar-thread.c')
-rw-r--r--gdb/aarch64-ravenscar-thread.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/aarch64-ravenscar-thread.c b/gdb/aarch64-ravenscar-thread.c
index 045d022..eb7bda8 100644
--- a/gdb/aarch64-ravenscar-thread.c
+++ b/gdb/aarch64-ravenscar-thread.c
@@ -61,10 +61,17 @@ static const int aarch64_context_offsets[] =
112, 116,
};
+#define V_INIT_OFFSET 640
+
/* The ravenscar_arch_ops vector for most Aarch64 targets. */
static struct ravenscar_arch_ops aarch64_ravenscar_ops
- (aarch64_context_offsets);
+ (aarch64_context_offsets,
+ -1, -1,
+ V_INIT_OFFSET,
+ /* The FPU context buffer starts with the FPSR register. */
+ aarch64_context_offsets[AARCH64_FPSR_REGNUM],
+ AARCH64_V0_REGNUM, AARCH64_FPCR_REGNUM);
/* Register aarch64_ravenscar_ops in GDBARCH. */