From nobody Mon Jul 15 12:38:06 2024 X-Original-To: dev-commits-src-branches@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 4WN1vM54J7z5QrXB; Mon, 15 Jul 2024 12:38:07 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WN1vM18cYz4H1j; Mon, 15 Jul 2024 12:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1721047087; 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=nTPBygYzG5zGnfZWAJxVswtMkngyIpj1+VSxrKZ8s0Q=; b=RSH8RausJ96RmMihnQJVagjdC+0xN+weEK8DnG6faFeVAh2rhWJ4k+ef3QKLKorPzYfnEE 1jkCSnhJSqGUXPC1nMu/tAECmg3fAjuv8rQgXW7sYLPI/FgkygHjWCVsGyqZ9L2OpliawB ek2CnbKgBwWMTzT6/oAQZaF+vjhpGnaXzMl5z+HiP5YjzjjhlDpiN5x4sPFFc1oIaGXv5u 1IBAYWen9FM/cSYcdl1ZzTJd3ouOmjPQDnDn46QupNEJKvBf2FxIkQbLlQQeavTrW6uleb Tlb1PDEvAM13n3CfnL0o/a8+jZs/jK5D2ARGuPFLZ4QP91pLYtc1b0F9cV2KVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1721047087; a=rsa-sha256; cv=none; b=OcnhPKfonhCOcx4qfosFIvTdzIJez4LaEsqoDqFsSmJvk2i3yefwi5DjnavuM5ELU1WqDa Fc0GmX9PqXqjgcv7HTN07Ojm9chQ4rabg1kKoJAIYhXNPtNGUSQCWWdFWCUW+JJXqhg68b +j+bW1S39etIHCd62R7hyCwe04146jcQ24mX19UN1YuyGF+2ieHBp5FHLcv2rSVaXIfrRm +i9DNeu1pAzp9wNFm5AqbrqweLmUCT7210zKruFoZ5M5SSF0qcZyMip7Vrf031xejjTo73 fkHncQ+9t5C7fr4BMhm6wWaLU37x6eE2lF6KyFzSiALx7v+WquJVZlhQpf8Vyg== 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=1721047087; 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=nTPBygYzG5zGnfZWAJxVswtMkngyIpj1+VSxrKZ8s0Q=; b=hasPPO3E6GRpED6GjsHdmTL6TyI39MII47b+zWod3nxLuVLEliKCqURTGsFVjy99ZzMMxl hTGBYs7iX1KYNbtexSd/0gA4am+mWY8rYJ12Qw44XsU/2kTa1ofsdgw7NKVhWyuNpxJV0X GpFYQLcSdXX5cww6YmnGgsVt9YUXkogpEAeRbm/mmcbzgB5SdxuNeSKoGYtksIQmj3Z8Kp SIZfsUkh+dN2xyx94m0g2pV+BpnqdqrdSR3VN0hdrFwDsAsRXMY63WA8AAzeiPdM3VmIR3 0wqVBXSlg2wnfxhe9FWXJwmrrghaUgohFR/bd3VdmKvBG/W9163EsIe/nARadQ== 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 4WN1vM0jvdzsZC; Mon, 15 Jul 2024 12:38:07 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 46FCc7PP059732; Mon, 15 Jul 2024 12:38:07 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 46FCc6bf059729; Mon, 15 Jul 2024 12:38:06 GMT (envelope-from git) Date: Mon, 15 Jul 2024 12:38:06 GMT Message-Id: <202407151238.46FCc6bf059729@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Andrew Turner Subject: git: f236a9c8c437 - stable/13 - arm64: Return all registers to gdb when able List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: f236a9c8c437abaab9fceb6feecf56607801d48e Auto-Submitted: auto-generated The branch stable/13 has been updated by andrew: URL: https://cgit.FreeBSD.org/src/commit/?id=f236a9c8c437abaab9fceb6feecf56607801d48e commit f236a9c8c437abaab9fceb6feecf56607801d48e Author: Andrew Turner AuthorDate: 2024-03-14 17:31:39 +0000 Commit: Andrew Turner CommitDate: 2024-07-15 12:34:28 +0000 arm64: Return all registers to gdb when able When the kdb thread is the current thread we read the registers from the trap frame. As this contains all general purpose registers we can use it to read these in the gdb stub. This allows us to include the non-callee saved registers, e.g. function arguments. Reviewed by: imp Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D44360 (cherry picked from commit 0a5f7918fc0e274a904b8fdd7c167bea7cdaf0f4) --- sys/arm64/arm64/gdb_machdep.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm64/arm64/gdb_machdep.c b/sys/arm64/arm64/gdb_machdep.c index 0673f591ef98..14af8b256e5d 100644 --- a/sys/arm64/arm64/gdb_machdep.c +++ b/sys/arm64/arm64/gdb_machdep.c @@ -55,6 +55,10 @@ gdb_cpu_getreg(int regnum, size_t *regsz) case GDB_REG_SP: return (&kdb_frame->tf_sp); case GDB_REG_PC: return (&kdb_frame->tf_elr); case GDB_REG_CSPR: return (&kdb_frame->tf_spsr); + default: + if (regnum >= GDB_REG_X0 && regnum <= GDB_REG_X29) + return (&kdb_frame->tf_x[regnum - GDB_REG_X0]); + break; } } switch (regnum) {