diff options
author | Flavio Cruz <flaviocruz@gmail.com> | 2025-02-02 23:15:22 -0500 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2025-02-10 23:27:15 +0100 |
commit | 5110839934507dca11761e538ce3158849c1354b (patch) | |
tree | 7f940768e5ccb17d312878934465e4f6d1cc4163 /gdb/config | |
parent | 8eca085f0ad6319f2ba331d27281a478b67992d3 (diff) | |
download | binutils-5110839934507dca11761e538ce3158849c1354b.zip binutils-5110839934507dca11761e538ce3158849c1354b.tar.gz binutils-5110839934507dca11761e538ce3158849c1354b.tar.bz2 |
Port GDB to Hurd x86_64.
This port extends the existing i686 port to support x86_64 by reusing
existing code whenever it makes sense.
* gdb/amd64-gnu-tdep.c: Adds logic for handling signal frames and
position of amd64 registers in the different Hurd structs.
The signal code is very similar to i686, except the trampoline code
is adapted.
* gdb/config/i386/nm-i386gnu.h: renamed to gdb/config/i386/nm-x86-gnu.h
and adapt it for x86_64.
* gdb/config/i386/i386gnu.mn: renamed to gdb/config/i386/nm-x86-gnu.mn
and reuse it for x86_64.
* gdb/configure.host: recognize gnu64 as a host.
* gdb/configure.nat: recognize gnu64 host and update existing i386gnu to
reuse the new shared files.
* gdb/configure.tgt: recognize x86_64-*-gnu* triplet and use
amd64-gnu-tdep.c.
* gdb/i386-gnu-tdep.c: added i386_gnu_thread_state_reg_offset that is
copied from i386-gnu-nat.c. This makes it similar to amd64.
* gdb/i386-gnu-nat.c: rename it to x86-gnu-nat.c since we reuse this for
i386 and amd64. Updated REG_ADDR to use one of the structures. Added
VALID_REGISTER to make sure it's a register we can provide at this time
(not all of them are available in amd64). FLAGS_REGISTER is either rfl
or efl depending on the arch. Renamed functions and class from i386 to x86
whenever they can be reused.
Tested on Hurd x86_64 and i686.
Diffstat (limited to 'gdb/config')
-rw-r--r-- | gdb/config/i386/nm-x86-gnu.h (renamed from gdb/config/i386/nm-i386gnu.h) | 7 | ||||
-rw-r--r-- | gdb/config/i386/x86-gnu.mn (renamed from gdb/config/i386/i386gnu.mn) | 0 |
2 files changed, 7 insertions, 0 deletions
diff --git a/gdb/config/i386/nm-i386gnu.h b/gdb/config/i386/nm-x86-gnu.h index d2d5de8..ed4d172 100644 --- a/gdb/config/i386/nm-i386gnu.h +++ b/gdb/config/i386/nm-x86-gnu.h @@ -22,9 +22,16 @@ /* Thread flavors used in re-setting the T bit. */ #define THREAD_STATE_FLAVOR i386_REGS_SEGS_STATE #define THREAD_STATE_SIZE i386_THREAD_STATE_COUNT +#ifdef __x86_64__ +#define THREAD_STATE_SET_TRACED(state) \ + ((struct i386_thread_state *) (state))->rfl |= 0x100 +#define THREAD_STATE_CLEAR_TRACED(state) \ + ((((struct i386_thread_state *) (state))->rfl &= ~0x100), 1) +#else #define THREAD_STATE_SET_TRACED(state) \ ((struct i386_thread_state *) (state))->efl |= 0x100 #define THREAD_STATE_CLEAR_TRACED(state) \ ((((struct i386_thread_state *) (state))->efl &= ~0x100), 1) +#endif /* __x86_64__ */ #endif /* CONFIG_I386_NM_I386GNU_H */ diff --git a/gdb/config/i386/i386gnu.mn b/gdb/config/i386/x86-gnu.mn index 24c58b0..24c58b0 100644 --- a/gdb/config/i386/i386gnu.mn +++ b/gdb/config/i386/x86-gnu.mn |