From: John Baldwin Date: Thu, 29 Jul 2021 20:16:29 +0000 (-0700) Subject: x86-bsd-nat: Only define gdb_ptrace when using debug registers. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9f07c7700101a4a69e4f78a0cfd16403228694ee;p=binutils-gdb.git 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. --- diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c index 453fc44116c..6aac76f1826 100644 --- a/gdb/x86-bsd-nat.c +++ b/gdb/x86-bsd-nat.c @@ -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. */