[PATCHv5,0/3] Returning osabi from gdbserer in more cases

Message ID cover.1730059608.git.aburgess@redhat.com
Headers
Series Returning osabi from gdbserer in more cases |

Message

Andrew Burgess Oct. 27, 2024, 8:07 p.m. UTC
  In v5:

  - Rebased to current HEAD.

  - Retested.

In v4:

  - Updated a default value of osabi in gdb/regformats/regdat.sh in
    patch #3 which fixed a build failure highlighted by the sourceware
    CI testing.

  - Rebased onto current master.

---

This series replaces patch #5 which I posted here:

  https://inbox.sourceware.org/gdb-patches/77fa25e6f6fd213f89ebceb7c1fcf33010cc8e39.1728407374.git.aburgess@redhat.com

I did merge that patch, but then CI testing flagged build errors on a
number of targets.

Unfortunately I'd overlooked that we have two ways of creating
target_desc objects within gdbserver.  The (I think) older approach
that uses fixed xml files, and the newer (I think) features based
approach.

My changes handled the features based approach, but completely
overlooked the fixed xml file approach.

This series should fix that oversight.

Patches #1 and #2 do some prep work.

Then patch #3 makes the important change.  The general approach is
unchange from my original attempt, but thanks to the groundwork in the
first two patches I'm now able to also update the fixed xml file
targets too.

I have done some testing of this version on a couple of targets that
use the fixed xml approach, so I'm pretty confident this is now OK.
But I have also pushed a try- branch for some additional confidence.

Thanks,
Andrew

---

Andrew Burgess (3):
  gdb/features: set osabi in all Linux related features/*.xml files
  gdb/regformats: add osabi information to generated .dat files
  gdbserver: pass osabi to GDB in more target descriptions

 gdb/features/Makefile                         |  2 +
 gdb/features/mips64-dsp-linux.c               |  2 +
 gdb/features/mips64-dsp-linux.xml             |  1 +
 gdb/features/mips64-linux.c                   |  2 +
 gdb/features/mips64-linux.xml                 |  1 +
 gdb/features/print-osabi.xsl                  | 39 +++++++++++++++++++
 gdb/features/s390-gs-linux64.c                |  2 +
 gdb/features/s390-gs-linux64.xml              |  1 +
 gdb/features/s390-linux32.c                   |  2 +
 gdb/features/s390-linux32.xml                 |  1 +
 gdb/features/s390-linux32v1.c                 |  2 +
 gdb/features/s390-linux32v1.xml               |  1 +
 gdb/features/s390-linux32v2.c                 |  2 +
 gdb/features/s390-linux32v2.xml               |  1 +
 gdb/features/s390-linux64.c                   |  2 +
 gdb/features/s390-linux64.xml                 |  1 +
 gdb/features/s390-linux64v1.c                 |  2 +
 gdb/features/s390-linux64v1.xml               |  1 +
 gdb/features/s390-linux64v2.c                 |  2 +
 gdb/features/s390-linux64v2.xml               |  1 +
 gdb/features/s390-te-linux64.c                |  2 +
 gdb/features/s390-te-linux64.xml              |  1 +
 gdb/features/s390-tevx-linux64.c              |  2 +
 gdb/features/s390-tevx-linux64.xml            |  1 +
 gdb/features/s390-vx-linux64.c                |  2 +
 gdb/features/s390-vx-linux64.xml              |  1 +
 gdb/features/s390x-gs-linux64.c               |  2 +
 gdb/features/s390x-gs-linux64.xml             |  1 +
 gdb/features/s390x-linux64.c                  |  2 +
 gdb/features/s390x-linux64.xml                |  1 +
 gdb/features/s390x-linux64v1.c                |  2 +
 gdb/features/s390x-linux64v1.xml              |  1 +
 gdb/features/s390x-linux64v2.c                |  2 +
 gdb/features/s390x-linux64v2.xml              |  1 +
 gdb/features/s390x-te-linux64.c               |  2 +
 gdb/features/s390x-te-linux64.xml             |  1 +
 gdb/features/s390x-tevx-linux64.c             |  2 +
 gdb/features/s390x-tevx-linux64.xml           |  1 +
 gdb/features/s390x-vx-linux64.c               |  2 +
 gdb/features/s390x-vx-linux64.xml             |  1 +
 gdb/regformats/mips-dsp-linux.dat             |  1 +
 gdb/regformats/mips-linux.dat                 |  1 +
 gdb/regformats/mips64-dsp-linux.dat           |  1 +
 gdb/regformats/mips64-linux.dat               |  1 +
 gdb/regformats/nios2-linux.dat                |  1 +
 gdb/regformats/or1k-linux.dat                 |  1 +
 gdb/regformats/regdat.sh                      | 14 +++++--
 gdb/regformats/rs6000/powerpc-32.dat          |  1 +
 gdb/regformats/rs6000/powerpc-32l.dat         |  1 +
 gdb/regformats/rs6000/powerpc-64l.dat         |  1 +
 gdb/regformats/rs6000/powerpc-altivec32l.dat  |  1 +
 gdb/regformats/rs6000/powerpc-altivec64l.dat  |  1 +
 gdb/regformats/rs6000/powerpc-e500l.dat       |  1 +
 gdb/regformats/rs6000/powerpc-isa205-32l.dat  |  1 +
 gdb/regformats/rs6000/powerpc-isa205-64l.dat  |  1 +
 .../rs6000/powerpc-isa205-altivec32l.dat      |  1 +
 .../rs6000/powerpc-isa205-altivec64l.dat      |  1 +
 .../rs6000/powerpc-isa205-ppr-dscr-vsx32l.dat |  1 +
 .../rs6000/powerpc-isa205-ppr-dscr-vsx64l.dat |  1 +
 .../rs6000/powerpc-isa205-vsx32l.dat          |  1 +
 .../rs6000/powerpc-isa205-vsx64l.dat          |  1 +
 .../rs6000/powerpc-isa207-htm-vsx32l.dat      |  1 +
 .../rs6000/powerpc-isa207-htm-vsx64l.dat      |  1 +
 .../rs6000/powerpc-isa207-vsx32l.dat          |  1 +
 .../rs6000/powerpc-isa207-vsx64l.dat          |  1 +
 gdb/regformats/rs6000/powerpc-vsx32l.dat      |  1 +
 gdb/regformats/rs6000/powerpc-vsx64l.dat      |  1 +
 gdb/regformats/s390-gs-linux64.dat            |  1 +
 gdb/regformats/s390-linux32.dat               |  1 +
 gdb/regformats/s390-linux32v1.dat             |  1 +
 gdb/regformats/s390-linux32v2.dat             |  1 +
 gdb/regformats/s390-linux64.dat               |  1 +
 gdb/regformats/s390-linux64v1.dat             |  1 +
 gdb/regformats/s390-linux64v2.dat             |  1 +
 gdb/regformats/s390-te-linux64.dat            |  1 +
 gdb/regformats/s390-tevx-linux64.dat          |  1 +
 gdb/regformats/s390-vx-linux64.dat            |  1 +
 gdb/regformats/s390x-gs-linux64.dat           |  1 +
 gdb/regformats/s390x-linux64.dat              |  1 +
 gdb/regformats/s390x-linux64v1.dat            |  1 +
 gdb/regformats/s390x-linux64v2.dat            |  1 +
 gdb/regformats/s390x-te-linux64.dat           |  1 +
 gdb/regformats/s390x-tevx-linux64.dat         |  1 +
 gdb/regformats/s390x-vx-linux64.dat           |  1 +
 gdb/regformats/tic6x-c62x-linux.dat           |  1 +
 gdb/regformats/tic6x-c64x-linux.dat           |  1 +
 gdb/regformats/tic6x-c64xp-linux.dat          |  1 +
 gdbserver/Makefile.in                         |  9 +++--
 gdbserver/linux-aarch32-tdesc.cc              |  2 +-
 gdbserver/linux-aarch64-tdesc.cc              |  3 +-
 gdbserver/linux-arc-low.cc                    |  2 +-
 gdbserver/linux-arm-tdesc.cc                  |  2 +-
 gdbserver/linux-csky-low.cc                   |  2 +-
 gdbserver/linux-loongarch-low.cc              |  2 +-
 gdbserver/linux-riscv-low.cc                  |  2 +-
 gdbserver/linux-x86-tdesc.cc                  | 15 ++++++-
 gdbserver/netbsd-aarch64-low.cc               |  2 +-
 gdbserver/netbsd-amd64-low.cc                 |  2 +-
 gdbserver/netbsd-i386-low.cc                  |  2 +-
 gdbserver/tdesc.cc                            |  5 ++-
 gdbserver/tdesc.h                             |  6 ++-
 gdbserver/win32-i386-low.cc                   |  4 +-
 gdbserver/win32-low.h                         |  7 ++++
 103 files changed, 200 insertions(+), 25 deletions(-)
 create mode 100644 gdb/features/print-osabi.xsl


base-commit: a723c56efb07c4f8b3f6a3ed4b878a2f8f5572cc