delve/pkg/proc/amd64util/xsave_other.go
Chen bef326c6a5
proc: use CPUID to determine ZMM_Hi256 region offset (#3831)
The offset of state component i can be found via
CPUID.(EAX=0DH,ECX=i):EBX. The ZMM_Hi256 is state component 6, so we use
CPUID to enumerate the offset instead of hardcoding.

For core dumps, we guess the ZMM_Hi256 offset based on xcr0 and the
length of xsave region. The logic comes from binutils-gdb.

Fixes #3827.
2024-10-21 09:16:57 -07:00

13 lines
181 B
Go

//go:build !amd64
package amd64util
func AMD64XstateMaxSize() int {
return _XSTATE_MAX_KNOWN_SIZE
}
func AMD64XstateZMMHi256Offset() int {
// AVX-512 not supported
return 0
}