Fix PR30369 regression on aarch64/arm (PR30506)
authorTom de Vries <tdevries@suse.de>
Tue, 16 May 2023 16:00:51 +0000 (17:00 +0100)
committerLuis Machado <luis.machado@arm.com>
Wed, 7 Jun 2023 11:01:12 +0000 (12:01 +0100)
commit22f2cf64f178fa3c85508d08fe10dd4e98af4751
treefcc76f49c4e1176fc3695aa2e079e257c129d797
parentd033023bc4ce9e61fe47172ee451cce2b96cdc98
Fix PR30369 regression on aarch64/arm (PR30506)

The gdb.dwarf2/dw2-prologue-end-2.exp test was failing for both AArch64 and
Arm.

As Tom pointed out here (https://inbox.sourceware.org/gdb-patches/6663707c-4297-c2f2-a0bd-f3e84fc62aad@suse.de/),
there are issues with both the prologue skipper for AArch64 and Arm and an
incorrect assumption by the testcase.

This patch fixes both of AArch64's and Arm's prologue skippers to not skip past
the end of a function.  It also incorporates a fix to the testcase so it
doesn't assume the prologue skipper will stop at the first instruction of the
functions/labels.

Regression-tested on aarch64-linux/arm-linux Ubuntu 20.04/22.04 and
x86_64-linux Ubuntu 20.04.

Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30506

Co-Authored-By: Tom de Vries <tdevries@suse.de>
Co-Authored-By: Luis Machado <luis.machado@arm.com>
gdb/aarch64-tdep.c
gdb/arm-tdep.c
gdb/testsuite/gdb.dwarf2/dw2-prologue-end-2.exp