From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 2/3] x86-bsd-nat: Only define gdb_ptrace when using debug registers.
Date: Mon, 26 Jul 2021 17:24:20 -0700 [thread overview]
Message-ID: <20210727002421.18947-3-jhb@FreeBSD.org> (raw)
In-Reply-To: <20210727002421.18947-1-jhb@FreeBSD.org>
This fixes an unused function warning on OpenBSD which does not
support PT_GETDBREGS.
---
gdb/x86-bsd-nat.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/gdb/x86-bsd-nat.c b/gdb/x86-bsd-nat.c
index 453fc44116..6aac76f182 100644
--- a/gdb/x86-bsd-nat.c
+++ b/gdb/x86-bsd-nat.c
@@ -33,6 +33,14 @@
#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. */
--
2.31.1
next prev parent reply other threads:[~2021-07-27 0:25 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-27 0:24 [PATCH 0/3] A few fixes to OpenBSD's native target John Baldwin
2021-07-27 0:24 ` [PATCH 1/3] Don't compile x86 debug register support on OpenBSD John Baldwin
2021-07-27 1:19 ` Simon Marchi via Gdb-patches
2021-07-27 0:24 ` John Baldwin [this message]
2021-07-27 1:20 ` [PATCH 2/3] x86-bsd-nat: Only define gdb_ptrace when using debug registers Simon Marchi via Gdb-patches
2021-07-27 0:24 ` [PATCH 3/3] obsd-nat: Various fixes to obsd_nat_target::wait John Baldwin
2021-07-27 1:54 ` Simon Marchi via Gdb-patches
2021-07-27 16:03 ` John Baldwin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210727002421.18947-3-jhb@FreeBSD.org \
--to=jhb@freebsd.org \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox