public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Fix bug in aarch64-linux GDB when inferior changes SVE vector length
@ 2022-08-05  0:46 Thiago Jung Bauermann
  2022-08-05  0:46 ` [PATCH v2 1/2] gdb/aarch64: Fix thread's gdbarch when SVE vector length changes Thiago Jung Bauermann
  2022-08-05  0:46 ` [PATCH v2 2/2] gdb/testsuite: Add test for AArch64 Scalable Vector Extension Thiago Jung Bauermann
  0 siblings, 2 replies; 11+ messages in thread
From: Thiago Jung Bauermann @ 2022-08-05  0:46 UTC (permalink / raw)
  To: gdb-patches

Hello,

This version addresses Luis' review comments on v1. Built with
“--enable-targets=all” and regression tested on aarch64-linux native on
Ubuntu 20.04.

Changes since v1:

- Patch “gdb/aarch64: Fix thread's gdbarch when SVE vector length changes”
  - Use aarch64_read_description () (which caches descriptions) to get the
    new target description.
  - Simplify aarch64_features_from_target_desc () a little bit by using the
    existing aarch64_get_tdesc_vq (). In v1, the former duplicated the
    latter's logic.
  - Remove from aarch64_gdbarch_init () code which tries to read vq from
    struct gdbarch_info.id. It was dead code in v1. This also allows
    simplifying the if block a bit further down for the case where tdesc
    doesn't have registers.
  - Remove the id member of struct gdbarch_info, since this patch removes
    its only user.

- Patch “gdb/testsuite: Add test for AArch64 Scalable Vector Extension”
  - Remove mention of QEMU's copyright statement.
  - Use the GNU Coding Style in the C file.
  - Be more specific about what the test does in the Tcl file.
  - Use skip_aarch64_sve_tests to exit early if SVE isn't supported.
  - Use “info all-registers” rather than “info registers” to check whether
    all registers are there after the vector length changes. This makes the
    test take ~15s rather than ~4s. I assume this isn't a problem.
  - Test that the new vector length is reflected in the $vg register.
  - Test that the new vector length is reflected in the size of the $z[0-31]
    registers.
  - Loop the same number of iterations that the inferior is supposed to
    loop.
  - Add small comment documenting the count_newlines procedure.

Original cover letter below:

While working on gdbserver support for the case where the inferior changes
the SVE vector length, I noticed this problem in the GDB native handling of
the same scenario.

Here's a fix and a testcase which fails without the fix, and passes with it.

Regression tested on aarch64-linux native on Ubuntu 20.04.

Thiago Jung Bauermann (2):
  gdb/aarch64: Fix thread's gdbarch when SVE vector length changes
  gdb/testsuite: Add test for AArch64 Scalable Vector Extension

 gdb/aarch64-linux-nat.c                |  11 ++-
 gdb/aarch64-tdep.c                     |  41 +++++-----
 gdb/aarch64-tdep.h                     |   2 +
 gdb/gdbarch.h                          |  13 +---
 gdb/testsuite/gdb.arch/aarch64-sve.c   |  64 ++++++++++++++++
 gdb/testsuite/gdb.arch/aarch64-sve.exp | 101 +++++++++++++++++++++++++
 gdb/testsuite/lib/gdb.exp              |   6 ++
 gdb/testsuite/lib/mi-support.exp       |   4 -
 8 files changed, 207 insertions(+), 35 deletions(-)
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-sve.c
 create mode 100644 gdb/testsuite/gdb.arch/aarch64-sve.exp


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2022-08-18 14:08 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-05  0:46 [PATCH v2 0/2] Fix bug in aarch64-linux GDB when inferior changes SVE vector length Thiago Jung Bauermann
2022-08-05  0:46 ` [PATCH v2 1/2] gdb/aarch64: Fix thread's gdbarch when SVE vector length changes Thiago Jung Bauermann
2022-08-05 17:26   ` Luis Machado
2022-08-05  0:46 ` [PATCH v2 2/2] gdb/testsuite: Add test for AArch64 Scalable Vector Extension Thiago Jung Bauermann
2022-08-05 17:23   ` Luis Machado
2022-08-05 21:57     ` Thiago Jung Bauermann
2022-08-17 20:46       ` Thiago Jung Bauermann
2022-08-18  8:56         ` Luis Machado
2022-08-18 11:37           ` Thiago Jung Bauermann
2022-08-18 13:47             ` Luis Machado
2022-08-18 14:08               ` Thiago Jung Bauermann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).