From: John Baldwin <jhb@FreeBSD.org>
To: gdb-patches@sourceware.org
Subject: [PATCH 1/3] Don't compile x86 debug register support on OpenBSD.
Date: Mon, 26 Jul 2021 17:24:19 -0700 [thread overview]
Message-ID: <20210727002421.18947-2-jhb@FreeBSD.org> (raw)
In-Reply-To: <20210727002421.18947-1-jhb@FreeBSD.org>
- Change x86bsd_nat_target to only inherit from x86_nat_target if
PT_GETDBREGS is supported.
- Don't include x86-nat.o and nat/x86-dregs.o for OpenBSD/amd64. They
were already omitted for OpenBSD/i386.
---
gdb/configure.nat | 5 ++---
gdb/x86-bsd-nat.h | 9 +++++++--
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/gdb/configure.nat b/gdb/configure.nat
index e34cccffd9..655c75dd1a 100644
--- a/gdb/configure.nat
+++ b/gdb/configure.nat
@@ -451,9 +451,8 @@ case ${gdb_host} in
case ${gdb_host_cpu} in
i386)
# Host: OpenBSD/amd64
- NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o x86-nat.o \
- x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o \
- nat/x86-dregs.o"
+ NATDEPFILES="${NATDEPFILES} obsd-nat.o amd64-nat.o \
+ x86-bsd-nat.o amd64-bsd-nat.o amd64-obsd-nat.o bsd-kvm.o"
LOADLIBES='-lkvm'
;;
mips)
diff --git a/gdb/x86-bsd-nat.h b/gdb/x86-bsd-nat.h
index 02d61c20b0..caf62e38df 100644
--- a/gdb/x86-bsd-nat.h
+++ b/gdb/x86-bsd-nat.h
@@ -27,18 +27,23 @@ extern size_t x86bsd_xsave_len;
/* A prototype *BSD/x86 target. */
+#ifdef HAVE_PT_GETDBREGS
template<typename BaseTarget>
class x86bsd_nat_target : public x86_nat_target<BaseTarget>
{
using base_class = x86_nat_target<BaseTarget>;
public:
-#ifdef HAVE_PT_GETDBREGS
void mourn_inferior () override
{
x86_cleanup_dregs ();
base_class::mourn_inferior ();
}
+};
+#else /* !HAVE_PT_GETDBREGS */
+template<typename BaseTarget>
+class x86bsd_nat_target : public BaseTarget
+{
+};
#endif /* HAVE_PT_GETDBREGS */
-};
#endif /* x86-bsd-nat.h */
--
2.31.1
next prev parent reply other threads:[~2021-07-27 0:26 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 ` John Baldwin [this message]
2021-07-27 1:19 ` [PATCH 1/3] Don't compile x86 debug register support on OpenBSD Simon Marchi via Gdb-patches
2021-07-27 0:24 ` [PATCH 2/3] x86-bsd-nat: Only define gdb_ptrace when using debug registers John Baldwin
2021-07-27 1:20 ` 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-2-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