x86-bsd-nat: Only define gdb_ptrace when using debug registers.

This fixes an unused function warning on OpenBSD which does not
support PT_GETDBREGS.
This commit is contained in:
John Baldwin 2021-07-29 13:16:29 -07:00
parent 757e686afb
commit 9f07c77001

View File

@ -33,6 +33,14 @@
#include "inf-ptrace.h"
#ifdef PT_GETXSTATE_INFO
size_t x86bsd_xsave_len;
#endif
/* Support for debug registers. */
#ifdef HAVE_PT_GETDBREGS
static PTRACE_TYPE_RET
gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr)
{
@ -46,14 +54,6 @@ gdb_ptrace (PTRACE_TYPE_ARG1 request, ptid_t ptid, PTRACE_TYPE_ARG3 addr)
#endif
}
#ifdef PT_GETXSTATE_INFO
size_t x86bsd_xsave_len;
#endif
/* Support for debug registers. */
#ifdef HAVE_PT_GETDBREGS
/* Helper macro to access debug register X. FreeBSD/amd64 and modern
versions of FreeBSD/i386 provide this macro in system headers. Define
a local version for systems that do not provide it. */