From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.baldwin.cx (bigwig.baldwin.cx [IPv6:2607:f138:0:13::2]) by sourceware.org (Postfix) with ESMTPS id B2223394FC30 for ; Wed, 16 Mar 2022 20:19:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B2223394FC30 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 ralph.com (ralph.baldwin.cx [66.234.199.215]) by mail.baldwin.cx (Postfix) with ESMTPSA id 23A1F1A84AD1 for ; Wed, 16 Mar 2022 16:19:44 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org Subject: [PATCH v2 00/12] FreeBSD/aarch64 hardware watchpoint support Date: Wed, 16 Mar 2022 13:19:11 -0700 Message-Id: <20220316201923.89694-1-jhb@FreeBSD.org> X-Mailer: git-send-email 2.34.1 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]); Wed, 16 Mar 2022 16:19:44 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.103.1 at mail.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, FORGED_SPF_HELO, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, SPF_HELO_PASS, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: , X-List-Received-Date: Wed, 16 Mar 2022 20:19:45 -0000 Changes since V1: - The unordered_map<>'s in x86-nat.c and aarch64-nat.c both now store objects directly rather than pointers to objects. - Trimmed "Contributed by" notices from new files. - I have compiled and (very lightly) tested this on Linux Aarch64. By light testing I mean that I ran a test program with a harware breakpoint set on main and it stopped correctly. I haven't run a full test suite as my Aarch64 test box is a lowly Raspberry Pi for which such a run would take a fairly long time. I still have some open questions about Patch 6 from the first version: Patch 6 has an open question about how best to handle having a platform-specific hook for when debug registers have been changed. Right now we require the platform to supply the function that nat/aarch64-hw-point.c calls. I did not choose to create an equivalent to x86_dr_low, but perhaps that sort of structure, or at least a function pointer should be used instead? There is also some messiness around the Linux-specific kernel_supports_any_contiguous_range workaround in patch 6. OTOH, some of the FreeBSD/x86 cleanups in the first half of the series (such as adding x86-fbsd-nat.*) might be nice to reuse in my XSAVE series, so if that half of the series is ok (first 5 patches), it might be nice to push that in sooner. John Baldwin (12): Remove USE_SIGTRAP_SIGINFO condition for FreeBSD/x86 debug regs support. x86-nat: Use an unordered_map to store per-pid debug reg state. x86-nat: Add x86_lookup_debug_reg_state. Add an x86_fbsd_nat_target mixin class for FreeBSD x86 native targets. fbsd-nat: Add a low_new_fork virtual method. x86-fbsd-nat: Copy debug register state on fork. nat: Split out platform-independent aarch64 debug register support. aarch64: Add an aarch64_nat_target mixin class. fbsd-nat: Add helper routine to fetch siginfo_t for a ptid. fbsd-nat: Add a low_delete_thread virtual method. fbsd-nat: Add a low_prepare_to_resume virtual method. Add support for hardware breakpoints/watchpoints on FreeBSD/Aarch64. gdb/NEWS | 2 + gdb/aarch64-fbsd-nat.c | 260 ++++++++++++- gdb/aarch64-linux-nat.c | 352 +---------------- gdb/aarch64-nat.c | 302 +++++++++++++++ gdb/aarch64-nat.h | 109 ++++++ gdb/amd64-fbsd-nat.c | 20 +- gdb/configure.nat | 12 +- gdb/fbsd-nat.c | 28 +- gdb/fbsd-nat.h | 18 + gdb/i386-fbsd-nat.c | 20 +- gdb/nat/aarch64-hw-point.c | 624 +++++++++++++++++++++++++++++++ gdb/nat/aarch64-hw-point.h | 126 +++++++ gdb/nat/aarch64-linux-hw-point.c | 605 +----------------------------- gdb/nat/aarch64-linux-hw-point.h | 105 +----- gdb/nat/aarch64-linux.c | 4 +- gdb/x86-fbsd-nat.c | 45 +++ gdb/x86-fbsd-nat.h | 36 ++ gdb/x86-nat.c | 92 +---- gdb/x86-nat.h | 5 + gdbserver/configure.srv | 1 + gdbserver/linux-aarch64-low.cc | 13 +- 21 files changed, 1612 insertions(+), 1167 deletions(-) create mode 100644 gdb/aarch64-nat.c create mode 100644 gdb/aarch64-nat.h create mode 100644 gdb/nat/aarch64-hw-point.c create mode 100644 gdb/nat/aarch64-hw-point.h create mode 100644 gdb/x86-fbsd-nat.c create mode 100644 gdb/x86-fbsd-nat.h -- 2.34.1