diff options
author | Luis Machado <luis.machado@arm.com> | 2023-02-02 14:00:58 +0000 |
---|---|---|
committer | Luis Machado <luis.machado@arm.com> | 2023-10-04 16:23:40 +0100 |
commit | 5add3fce49f1c36a47651238fb0b0592a04d645e (patch) | |
tree | eb55b452d8f25b5f809fbf75aa60c5d6555952e3 /gdb/tramp-frame.c | |
parent | f62b3d21ec1f8c62905c55b76543d49666e2f717 (diff) | |
download | gdb-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/tramp-frame.c')
-rw-r--r-- | gdb/tramp-frame.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/gdb/tramp-frame.c b/gdb/tramp-frame.c index c69ee6e..94e42e9 100644 --- a/gdb/tramp-frame.c +++ b/gdb/tramp-frame.c @@ -170,5 +170,6 @@ tramp_frame_prepend_unwinder (struct gdbarch *gdbarch, unwinder->stop_reason = default_frame_unwind_stop_reason; unwinder->this_id = tramp_frame_this_id; unwinder->prev_register = tramp_frame_prev_register; + unwinder->prev_arch = tramp_frame->prev_arch; frame_unwind_prepend_unwinder (gdbarch, unwinder); } |