/* Check if PTRACE_GETREGSET works. */
if (ptrace (PTRACE_GETREGSET, tid, NT_PRSTATUS, &iov) == 0)
- have_ptrace_getregset = 1;
+ have_ptrace_getregset = TRIBOOL_TRUE;
else
- have_ptrace_getregset = 0;
+ have_ptrace_getregset = TRIBOOL_FALSE;
}
bool
{
const struct target_desc *tdesc = current_process ()->tdesc;
- if (have_ptrace_getregset == 1
+ if (have_ptrace_getregset == TRIBOOL_TRUE
&& (is_aarch32_linux_description (tdesc)
|| arm_linux_get_tdesc_fp_type (tdesc) == ARM_FP_TYPE_VFPV3))
return ®s_info_aarch32;
#endif
/* Does the current host support PTRACE_GETREGSET? */
-int have_ptrace_getregset = -1;
+enum tribool have_ptrace_getregset = TRIBOOL_UNKNOWN;
/* Return TRUE if THREAD is the leader thread of the process. */
bool thread_db_thread_handle (ptid_t ptid, gdb_byte **handle, int *handle_len);
-extern int have_ptrace_getregset;
+extern enum tribool have_ptrace_getregset;
/* Search for the value with type MATCH in the auxv vector, with entries of
length WORDSIZE bytes, of process with pid PID. If found, store the
if (ptrace (PTRACE_GETFPXREGS, tid, 0, (long) &fpxregs) < 0)
{
have_ptrace_getfpxregs = 0;
- have_ptrace_getregset = 0;
+ have_ptrace_getregset = TRIBOOL_FALSE;
return i386_linux_read_description (X86_XSTATE_X87);
}
else
return tdesc_i386_linux_no_xml.get ();
}
- if (have_ptrace_getregset == -1)
+ if (have_ptrace_getregset == TRIBOOL_UNKNOWN)
{
uint64_t xstateregs[(X86_XSTATE_SSE_SIZE / sizeof (uint64_t))];
struct iovec iov;
/* Check if PTRACE_GETREGSET works. */
if (ptrace (PTRACE_GETREGSET, tid,
(unsigned int) NT_X86_XSTATE, (long) &iov) < 0)
- have_ptrace_getregset = 0;
+ have_ptrace_getregset = TRIBOOL_FALSE;
else
{
- have_ptrace_getregset = 1;
+ have_ptrace_getregset = TRIBOOL_TRUE;
/* Get XCR0 from XSAVE extended state. */
xcr0 = xstateregs[(I386_LINUX_XSAVE_XCR0_OFFSET
}
/* Check the native XCR0 only if PTRACE_GETREGSET is available. */
- xcr0_features = (have_ptrace_getregset
+ xcr0_features = (have_ptrace_getregset == TRIBOOL_TRUE
&& (xcr0 & X86_XSTATE_ALL_MASK));
if (xcr0_features)