public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH v2 2/5] x86-bsd-nat: Only define gdb_ptrace when using debug registers.
Date: Tue, 27 Jul 2021 10:41:07 -0700	[thread overview]
Message-ID: <20210727174110.62480-3-jhb@FreeBSD.org> (raw)
In-Reply-To: <20210727174110.62480-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 453fc44116c..6aac76f1826 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


  parent reply	other threads:[~2021-07-27 17:42 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27 17:41 [PATCH v2 0/5] A few fixes to OpenBSD's native target John Baldwin
2021-07-27 17:41 ` [PATCH v2 1/5] Don't compile x86 debug register support on OpenBSD John Baldwin
2021-07-27 17:41 ` John Baldwin [this message]
2021-07-27 17:41 ` [PATCH v2 3/5] obsd-nat: Various fixes to obsd_nat_target::wait John Baldwin
2021-07-29 19:05   ` Simon Marchi
2021-07-29 19:11     ` Simon Marchi
2021-07-29 20:11       ` John Baldwin
2021-07-30  1:27         ` Simon Marchi
2021-07-27 17:41 ` [PATCH v2 4/5] obsd-nat: Various fixes for fork following John Baldwin
2021-07-29 19:14   ` Simon Marchi
2021-07-27 17:41 ` [PATCH v2 5/5] obsd-nat: Report both thread and PID in ::pid_to_str John Baldwin
2021-07-29 19:15 ` [PATCH v2 0/5] A few fixes to OpenBSD's native target Simon Marchi

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=20210727174110.62480-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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).