]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
x86-bsd-nat: Only define gdb_ptrace when using debug registers.
authorJohn Baldwin <jhb@FreeBSD.org>
Thu, 29 Jul 2021 20:16:29 +0000 (13:16 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Thu, 29 Jul 2021 20:16:29 +0000 (13:16 -0700)
This fixes an unused function warning on OpenBSD which does not
support PT_GETDBREGS.

gdb/x86-bsd-nat.c

index 453fc44116cb0f40131e01bb0f25a99f545b088f..6aac76f1826ddb00d8a871041aec0d73c28a0688 100644 (file)
 #include "inf-ptrace.h"
 \f
 
+#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.  */