Re: [PATCH V5 2/3] Add AVX512 register support to gdbserver.

Joel Brobecker
2015-01-10T07:00:43Z

[-- Attachment #1: Type: text/plain, Size: 460 bytes --]

Hello,

> Sorry for the late reply! Yes, the proposed change is correct. Thanks
> a lot for catching this bug!

Thanks for confirming.

Attached is the patch I ended up pushing.

gdb/gdbserver/ChangeLog:

* i387-fp.c (i387_cache_to_xsave): In look over
num_avx512_zmmh_high_registers, replace use of struct i387_xsave
zmmh_low_space field by use of zmmh_high_space.

Tested on x86_64-linux, using boards/native-gdbserver.exp.

--
Joel

[-- Attachment #2: 0001-Fix-use-of-wrong-struct-i387_xsave-field-in-i387_cac.patch --]
[-- Type: text/x-diff, Size: 1691 bytes --]

From 3368c1e5ce12ea262ab3ff7a9154472503aadedb Mon Sep 17 00:00:00 2001
From: Joel Brobecker <brobecker@adacore.com>
Date: Sat, 10 Jan 2015 09:50:44 +0400
Subject: [PATCH] Fix use of wrong struct i387_xsave field in
i387_cache_to_xsave

gdb/gdbserver/ChangeLog:

* i387-fp.c (i387_cache_to_xsave): In look over
num_avx512_zmmh_high_registers, replace use of struct i387_xsave
zmmh_low_space field by use of zmmh_high_space.

Tested on x86_64-linux, using boards/native-gdbserver.exp.
---
gdb/gdbserver/ChangeLog | 6 ++++++
gdb/gdbserver/i387-fp.c | 2 +-
2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 180e341..d126748 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,3 +1,9 @@
+2015-01-10 Joel Brobecker <brobecker@adacore.com>
+
+ * i387-fp.c (i387_cache_to_xsave): In look over
+ num_avx512_zmmh_high_registers, replace use of struct i387_xsave
+ zmmh_low_space field by use of zmmh_high_space.
+
2015-01-09 Pedro Alves <palves@redhat.com>

* linux-low.c (step_over_bkpt): Move higher up in the file.
diff --git a/gdb/gdbserver/i387-fp.c b/gdb/gdbserver/i387-fp.c
index a4c218d..ddfec6e 100644
--- a/gdb/gdbserver/i387-fp.c
+++ b/gdb/gdbserver/i387-fp.c
@@ -454,7 +454,7 @@ i387_cache_to_xsave (struct regcache *regcache, void *buf)
for (i = 0; i < num_avx512_zmmh_high_registers; i++)
{
collect_register (regcache, i + zmm16h_regnum, raw);
- p = ((char *) &fp->zmmh_low_space[0]) + 32 + i * 64;
+ p = ((char *) &fp->zmmh_high_space[0]) + 32 + i * 64;
if (memcmp (raw, p, 32) != 0)
{
xstate_bv |= X86_XSTATE_ZMM;
--
1.9.1