From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id tL8FNnBS/2AcZwAAWB0awg (envelope-from ) for ; Mon, 26 Jul 2021 20:25:20 -0400 Received: by simark.ca (Postfix, from userid 112) id CC9E41EDFB; Mon, 26 Jul 2021 20:25:20 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.6 required=5.0 tests=MAILING_LIST_MULTI, RDNS_DYNAMIC autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0C6E31E813 for ; Mon, 26 Jul 2021 20:25:20 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83B3F3898019 for ; Tue, 27 Jul 2021 00:25:19 +0000 (GMT) Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2607:f138:0:13::2]) by sourceware.org (Postfix) with ESMTPS id 71FCC389852F for ; Tue, 27 Jul 2021 00:24:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 71FCC389852F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=FreeBSD.org Received: from gimli.baldwin.cx (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 48F061A84C5E for ; Mon, 26 Jul 2021 20:24:27 -0400 (EDT) From: John Baldwin 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 Message-Id: <20210727002421.18947-3-jhb@FreeBSD.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210727002421.18947-1-jhb@FreeBSD.org> References: <20210727002421.18947-1-jhb@FreeBSD.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.6.4 (mail.baldwin.cx [0.0.0.0]); Mon, 26 Jul 2021 20:24:27 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" 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" +#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