diff options
-rw-r--r-- | gdb/gdbserver/linux-x86-low.c | 2 | ||||
-rw-r--r-- | gdb/gdbserver/linux-x86-tdesc.c | 16 |
2 files changed, 15 insertions, 3 deletions
diff --git a/gdb/gdbserver/linux-x86-low.c b/gdb/gdbserver/linux-x86-low.c index 54bd2a2..479cec0 100644 --- a/gdb/gdbserver/linux-x86-low.c +++ b/gdb/gdbserver/linux-x86-low.c @@ -133,7 +133,7 @@ static const int x86_64_regmap[] = -1, -1, -1, -1, -1, -1, -1, -1, ORIG_RAX * 8, #ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE - 21 * 8, 22 * 8, + FS_BASE * 8, GS_BASE * 8, #else -1, -1, #endif diff --git a/gdb/gdbserver/linux-x86-tdesc.c b/gdb/gdbserver/linux-x86-tdesc.c index b39ed53..ab43ae5 100644 --- a/gdb/gdbserver/linux-x86-tdesc.c +++ b/gdb/gdbserver/linux-x86-tdesc.c @@ -87,7 +87,13 @@ i386_linux_read_description (uint64_t xcr0) if (*tdesc == NULL) { - *tdesc = i386_create_target_description (xcr0, true, false); +#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE + const bool segment = true; +#else + const bool segment = false; +#endif + + *tdesc = i386_create_target_description (xcr0, true, segment); init_target_desc (*tdesc, i386_expedite_regs); } @@ -118,7 +124,13 @@ amd64_linux_read_description (uint64_t xcr0, bool is_x32) if (*tdesc == NULL) { - *tdesc = amd64_create_target_description (xcr0, is_x32, true, true); +#ifdef HAVE_STRUCT_USER_REGS_STRUCT_FS_BASE + const bool segment = true; +#else + const bool segment = false; +#endif + + *tdesc = amd64_create_target_description (xcr0, is_x32, true, segment); init_target_desc (*tdesc, amd64_expedite_regs); } |