aboutsummaryrefslogtreecommitdiff
path: root/gdb/arch-utils.c
diff options
context:
space:
mode:
authorLuis Machado <luis.machado@arm.com>2023-02-02 14:00:58 +0000
committerLuis Machado <luis.machado@arm.com>2023-10-04 16:23:40 +0100
commit5add3fce49f1c36a47651238fb0b0592a04d645e (patch)
treeeb55b452d8f25b5f809fbf75aa60c5d6555952e3 /gdb/arch-utils.c
parentf62b3d21ec1f8c62905c55b76543d49666e2f717 (diff)
downloadgdb-5add3fce49f1c36a47651238fb0b0592a04d645e.zip
gdb-5add3fce49f1c36a47651238fb0b0592a04d645e.tar.gz
gdb-5add3fce49f1c36a47651238fb0b0592a04d645e.tar.bz2
sme: Fixup sigframe gdbarch when vg/svg changes
With SME, where you have two different vector lengths (vl and svl), it may be the case that the current frame has a set of vector lengths (A) but the signal context has a distinct set of vector lengths (B). In this case, we may run into a situation where GDB attempts to use a gdbarch created for set A, but it is really dealing with a frame that was using set B. This is problematic, specially with SME, because now we have a different number of pseudo-registers and types that gets cached on creation of each gdbarch variation. For AArch64 we really need to be able to use the correct gdbarch for each frame, and I noticed the signal frame (tramp-frame) doesn't have a settable prev_arch field. So it ends up using the default frame_unwind_arch function and eventually calling get_frame_arch (next_frame). That means the previous frame will always have the same gdbarch as the current frame. This patch first refactors the AArch64/Linux signal context code, simplifying it and making it reusable for our purposes of calculating the previous frame's gdbarch. I introduced a struct that holds information that we have found in the signal context, and with which we can make various decisions. Finally, a small change to tramp-frame.c and tramp-frame.h to expose a prev_arch hook that the architecture can set. With this new field, AArch64/Linux can implement a hook that looks at the signal context and infers the gdbarch for the previous frame. Regression-tested on aarch64-linux Ubuntu 22.04/20.04. Approved-By: Simon Marchi <simon.marchi@efficios.com> Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Diffstat (limited to 'gdb/arch-utils.c')
0 files changed, 0 insertions, 0 deletions