[0/7] x86/Linux Target Description Changes

Message ID cover.1706801009.git.aburgess@redhat.com
Headers
Series x86/Linux Target Description Changes |

Message

Andrew Burgess Feb. 1, 2024, 3:28 p.m. UTC
  This series started when I ran the test script
gdb.server/connect-with-no-symbol-file.exp on an x86-64/Linux target
(with the unix board file) and noticed that two core files were left
behind.

The test is a gdbserver test (even when the unix board is used), and
the two core files are generated by the inferior as gdbserver detaches
from them.

I tracked the problem down to some issues with how gdbserver creates
its target descriptions.

Instead of just fixing gdbserver I think it would be good to share
more of the target description creation code between GDB and
gdbserver, the issue that gdbserver has is already fixed on the GDB
side.

By patch #5 enough code is shared that the problem mentioned above is
fixed.

Patches #6 and #7 try to share more code between GDB and gdbserver as
I think this is a good thing.

Thanks,
Andrew

---

Andrew Burgess (7):
  gdbserver: convert have_ptrace_getregset to a tribool
  gdb/x86: move reading of cs and ds state into gdb/nat directory
  gdbserver/x86: move no-xml code earlier in x86_linux_read_description
  gdb/gdbserver: share I386_LINUX_XSAVE_XCR0_OFFSET definition
  gdb/gdbserver: share some code relating to target description creation
  gdbserver: update target description creation for x86/linux
  gdb/gdbserver: share x86/linux tdesc caching

 gdb/Makefile.in              |   1 +
 gdb/amd64-linux-tdep.c       |  33 +--
 gdb/amd64-linux-tdep.h       |   6 -
 gdb/configure.nat            |   4 +-
 gdb/i386-linux-tdep.c        |  32 +--
 gdb/i386-linux-tdep.h        |  23 --
 gdb/nat/x86-linux-tdesc.c    | 405 +++++++++++++++++++++++++++++++++++
 gdb/nat/x86-linux-tdesc.h    | 115 ++++++++++
 gdb/nat/x86-linux.c          |  47 ++++
 gdb/nat/x86-linux.h          |  48 +++++
 gdb/x86-linux-nat.c          | 123 ++---------
 gdbserver/Makefile.in        |   4 +
 gdbserver/configure.srv      |   4 +
 gdbserver/linux-amd64-ipa.cc |  45 +---
 gdbserver/linux-arm-low.cc   |   6 +-
 gdbserver/linux-i386-ipa.cc  |  25 +--
 gdbserver/linux-low.cc       |   2 +-
 gdbserver/linux-low.h        |   2 +-
 gdbserver/linux-x86-low.cc   | 185 +++++-----------
 gdbserver/linux-x86-tdesc.cc | 141 +-----------
 gdbserver/linux-x86-tdesc.h  |  56 -----
 21 files changed, 737 insertions(+), 570 deletions(-)
 create mode 100644 gdb/nat/x86-linux-tdesc.c
 create mode 100644 gdb/nat/x86-linux-tdesc.h
 delete mode 100644 gdbserver/linux-x86-tdesc.h


base-commit: 05d1b4b4ad7d74a64cc71c53d621241fc393fcb6