Skip to content

Commit 4d3cc27

Browse files
committed
Correct debugserver to write xmm/ymm/zmm reg values
debugserver does not call thread_set_state when changing xmm/ymm/zmm register values, so the register contents are never updated. Fix that. Mark the shell tests which xfail'ed these tests on darwin systems to xfail them when the system debugserver, they will pass when using the in-tree debugserver. When this makes it into the installed system debugservers, we'll remove the xfails. Differential Revision: https://reviews.llvm.org/D123269 rdar://91258333 rdar://31294382
1 parent f891123 commit 4d3cc27

File tree

4 files changed

+26
-7
lines changed

4 files changed

+26
-7
lines changed

lldb/test/Shell/Register/x86-64-write.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# XFAIL: system-darwin
1+
# xfail with system debugserver until the fix for
2+
# https://reviews.llvm.org/D123269 in
3+
# lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
4+
# has made it into released tools.
5+
# XFAIL: system-debugserver
6+
27
# XFAIL: system-windows
38
# REQUIRES: native && target-x86_64
49
# RUN: %clangxx_host %p/Inputs/x86-64-write.cpp -o %t

lldb/test/Shell/Register/x86-64-ymm-write.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# XFAIL: system-darwin
1+
# xfail with system debugserver until the fix for
2+
# https://reviews.llvm.org/D123269 in
3+
# lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
4+
# has made it into released tools.
5+
# XFAIL: system-debugserver
6+
27
# XFAIL: system-windows
38
# REQUIRES: native && target-x86_64 && native-cpu-avx
49
# RUN: %clangxx_host %p/Inputs/x86-ymm-write.cpp -o %t

lldb/test/Shell/Register/x86-64-zmm-write.test

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
# XFAIL: system-darwin
1+
# xfail with system debugserver until the fix for
2+
# https://reviews.llvm.org/D123269 in
3+
# lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
4+
# has made it into released tools.
5+
# XFAIL: system-debugserver
6+
27
# XFAIL: system-freebsd
38
# XFAIL: system-linux
49
# XFAIL: system-netbsd

lldb/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2632,7 +2632,8 @@ bool DNBArchImplX86_64::SetRegisterValue(uint32_t set, uint32_t reg,
26322632
&value->value.uint8, 16);
26332633
memcpy(&m_state.context.fpu.avx.__fpu_ymmh0 + (reg - fpu_ymm0),
26342634
(&value->value.uint8) + 16, 16);
2635-
return true;
2635+
success = true;
2636+
break;
26362637
case fpu_k0:
26372638
case fpu_k1:
26382639
case fpu_k2:
@@ -2643,7 +2644,8 @@ bool DNBArchImplX86_64::SetRegisterValue(uint32_t set, uint32_t reg,
26432644
case fpu_k7:
26442645
memcpy(&m_state.context.fpu.avx512f.__fpu_k0 + (reg - fpu_k0),
26452646
&value->value.uint8, 8);
2646-
return true;
2647+
success = true;
2648+
break;
26472649
case fpu_zmm0:
26482650
case fpu_zmm1:
26492651
case fpu_zmm2:
@@ -2666,7 +2668,8 @@ bool DNBArchImplX86_64::SetRegisterValue(uint32_t set, uint32_t reg,
26662668
&value->value.uint8 + 16, 16);
26672669
memcpy(&m_state.context.fpu.avx512f.__fpu_zmmh0 + (reg - fpu_zmm0),
26682670
&value->value.uint8 + 32, 32);
2669-
return true;
2671+
success = true;
2672+
break;
26702673
case fpu_zmm16:
26712674
case fpu_zmm17:
26722675
case fpu_zmm18:
@@ -2685,7 +2688,8 @@ bool DNBArchImplX86_64::SetRegisterValue(uint32_t set, uint32_t reg,
26852688
case fpu_zmm31:
26862689
memcpy(&m_state.context.fpu.avx512f.__fpu_zmm16 + (reg - fpu_zmm16),
26872690
&value->value.uint8, 64);
2688-
return true;
2691+
success = true;
2692+
break;
26892693
}
26902694
break;
26912695

0 commit comments

Comments
 (0)