From nobody Fri Apr 12 09:37:42 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VGBLZ5ZZtz5H48V; Fri, 12 Apr 2024 09:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VGBLZ3xNgz4Dvv; Fri, 12 Apr 2024 09:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712914662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKj2byVEnmdm1hjyC2TI3bDo5RMRiKlH0CzXtKSn9lU=; b=M/+8qhKRUYcZYUn3UrQd1tqovPRoFFrfyhL0E5kW7tvB+5NbuJ/gTsiV5HhJolw88UzlmY hM/un3kWHtHHQCuXvBlfPJKh8nRED0pFe/RVJEWRbnmkss4RDc7NgQnCT7K3gdlTwqNmOC NVZ/Cyn8Zk3+Ac2qlFQvBzxsiXYJEt9EP56eb63LciuT4NZ+v8U2Zr9QXRhe4juzJNACca pVVi0ur/A20T/N/osMAgEdLJr+ej9u/RIn3+n2ccEpTzv/Ow4gJD+ue1ktGZy/px97XU3N qoa9J11FTuGNWGbG9dDYd2H89n55EDQAKoiTHNDjUXiNAosVM09TOBjRSDjMuQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712914662; a=rsa-sha256; cv=none; b=TC5tgmi49PFr5ZFO76tBmGsBi2NlgxCslqcYC6S4LXk7Nhe0IjAhncy95eOKgBTgS5txVW MdnmBqVaDOw+bll373Bb/Ch7PSj684lcV6FrJnY5GoVR7u/kqbAOOnNu4I/Ej1GQmG6koS Ma7RG7KMgYfS3qsLkfYM6DdzySORvxUlLxnf87nNwONzkZmKhx3o7vxEMxkxjeGHoAWp+Q FWT1KOnIlQqKgkXvnkSda9xTbd1LOv/RiFMHHYQNCmJjEar+pe93NQqKZ5HnNZPkLAm6y1 w1dWckRwnop5mXmA0iULMgawDPZqFhXybttYgy1nZuh1YJw1UprFjddkwXOiCw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712914662; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=pKj2byVEnmdm1hjyC2TI3bDo5RMRiKlH0CzXtKSn9lU=; b=IB6QEscaHgcx9q4i0yIijJFlTCNlaMudBCwbkGu/toErWW/2pPqrKQdCNxPBMX6mkfQ3R0 Wkl10vywGYqG21WDqCD8bF89ul3flRqLqo4azlPiU/aKyVCoPl2okK+YsndsA5lA1IKuK1 oGhqBQM1bTnHLjtoijFQ4U8dC66QagBMGe2+Kj2Djc/MZdPuox/evc4vGRvTkxZCtx9Sfz A/0f1lyAuHeMXUhmhmmMvYtEz4kYTIr9ItX9LzjfhBoxGK89ZqjKW9PR4AJF5M4aeJ1I5a NSXqIbcmh1/i/hzOUQwXhUD1uM/4pKFPvcB/wWVYi7r7lgT3nUh83RTMjpHitw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VGBLZ3YV3zjsN; Fri, 12 Apr 2024 09:37:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 43C9bgPZ096659; Fri, 12 Apr 2024 09:37:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 43C9bgGm096656; Fri, 12 Apr 2024 09:37:42 GMT (envelope-from git) Date: Fri, 12 Apr 2024 09:37:42 GMT Message-Id: <202404120937.43C9bgGm096656@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Andrew Turner Subject: git: 0adc959a3730 - main - sys/gdb: Support hardware breakpoints List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: andrew X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0adc959a37303939e6c64cbeea47a62670bfaf58 Auto-Submitted: auto-generated The branch main has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=0adc959a37303939e6c64cbeea47a62670bfaf58 commit 0adc959a37303939e6c64cbeea47a62670bfaf58 Author: Andrew Turner AuthorDate: 2024-03-14 15:09:03 +0000 Commit: Andrew Turner CommitDate: 2024-04-12 09:32:55 +0000 sys/gdb: Support hardware breakpoints Support the use of hardware breakpoints in the kernel gdb stub. Reviewed by: jhb (earlier version) Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44354 --- sys/gdb/gdb_main.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sys/gdb/gdb_main.c b/sys/gdb/gdb_main.c index 5567c12c2a9f..3e8ada42adac 100644 --- a/sys/gdb/gdb_main.c +++ b/sys/gdb/gdb_main.c @@ -267,6 +267,11 @@ nofeatures: gdb_tx_str(";qXfer:threads:read+"); +#ifdef HAS_HW_BREAKPOINT + if ((*feat & GDB_HWBREAK) != 0) + gdb_tx_str(";hwbreak+"); +#endif + /* * If the debugport is a reliable transport, request No Ack mode from * the server. The server may or may not choose to enter No Ack mode. @@ -648,6 +653,10 @@ gdb_z_insert(void) (vm_size_t)length, KDB_DBG_ACCESS_RW); break; case '1': /* hardware breakpoint */ +#ifdef HAS_HW_BREAKPOINT + error = kdb_cpu_set_breakpoint((vm_offset_t)addr); + break; +#endif case '0': /* software breakpoint */ /* Not implemented. */ gdb_tx_empty(); @@ -692,6 +701,10 @@ gdb_z_remove(void) (vm_size_t)length); break; case '1': /* hardware breakpoint */ +#ifdef HAS_HW_BREAKPOINT + error = kdb_cpu_clr_breakpoint((vm_offset_t)addr); + break; +#endif case '0': /* software breakpoint */ /* Not implemented. */ gdb_tx_empty();