From nobody Tue Jul 09 18:45:18 2024 X-Original-To: dev-commits-src-all@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 4WJVKp52ZJz5Qt8q; Tue, 09 Jul 2024 18:45:18 +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 4WJVKp3VdRz4kfr; Tue, 9 Jul 2024 18:45:18 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1720550718; 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=p/H/+QaKuOkmAN+bA3SExDfPBC21ufaeUiLM/fTQVTQ=; b=FJXE4i+iSN2Zi04UURinGQ/BcHKK+6IWFwNqwzjcssr0Kl2jKMu0MyW/T9s6xwXPL88WXz 5Ww3/ehnkz1pJJmUNYALbXqF5GHZ4NgDreGLuvYRUNlr8rhVY+AdpeuOrdaEnVDL7tEY0z NgOCpSOjeBE5Rdd6sm1MP/osLeCkgbutSW83dRj/rjT6emuqEsRCE3A2RQ3jCLgaZ/nDCj NypIYEkSEOBdhiLNAq69fKgJUDCWNRNvm2W5RYmgQSzU+hzOHguJ7gfmh7Gy8NsTQ68noR ng2+t6ai4++JWy7zZdLj6AtoUdFNbsViyGf0fYcIFVsoA+qqA5Wr80Oe8DUA8g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1720550718; a=rsa-sha256; cv=none; b=dnbsnFww6d6tgvlbfgtlxvLg+tLVYJpYBA9cYs45KIfkJpreeF5LUatjNJ/a4aysNZOGmN 66TinqGBYBLtCdNi9FO+TdnaPhIgHxHeorFpv8bSyZM6ZMcuw+/PB27gs/aVB3m24O+rYs uphN6kALe5B3+caQbvr9gjyEMIzkqNNP1jV0GESnlgWJWZnR7q1FipE0SUJ5VMob0rW2Mg aU53YZEhDAhP1hZu5hxupzugwvba5jtPICv4geszE27oz2kBH2wsQRcxx5NqjdsOVjnI4C QqgPkXJsVC8OU1BIM1R01yDcCNHBStcCHziMtOxsys9Uzi9iC/hFnVC23e6pLw== 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=1720550718; 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=p/H/+QaKuOkmAN+bA3SExDfPBC21ufaeUiLM/fTQVTQ=; b=CYXqXHoQjiPp8hhstrN2Yce9EJs6jrYGih8PlG7ZSPM7Inv2WzDnKGLICoRlhdCj2isOvj xPlQw0gIPacHOgi1Hp4OB4sO5I9uFOHTRhqWPcm00O6iobyBRD1yeAskn8JzHKY3+oDAAE sjP+HGBPyVWWZRjJ3z0BsXaYdSpddEcbyXy9B/TziSJ303M1VPo/TDI4d46A0HTvZLpnjI h50TZbNQ0ui77SBPfHwoLlwJJwTv2TRZbVqAi5TX9bLmhBM0tqmaZwM5bx5lE6np68OI+P 924fyDs+Qjwp0npMHr7yedPUh4KIwEqgciAtmimtVGpx9Cf0VHo1QMHNfVsw/w== 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 4WJVKp35Lxzlly; Tue, 9 Jul 2024 18:45:18 +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 469IjII8087578; Tue, 9 Jul 2024 18:45:18 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 469IjIso087575; Tue, 9 Jul 2024 18:45:18 GMT (envelope-from git) Date: Tue, 9 Jul 2024 18:45:18 GMT Message-Id: <202407091845.469IjIso087575@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Ryan Libby Subject: git: f0a7df4a6cc9 - main - ddb: make db_error reliably no-return List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: rlibby X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: f0a7df4a6cc9a795680d580fcabd993379e22ae5 Auto-Submitted: auto-generated The branch main has been updated by rlibby: URL: https://cgit.FreeBSD.org/src/commit/?id=f0a7df4a6cc9a795680d580fcabd993379e22ae5 commit f0a7df4a6cc9a795680d580fcabd993379e22ae5 Author: Ryan Libby AuthorDate: 2024-07-09 17:59:27 +0000 Commit: Ryan Libby CommitDate: 2024-07-09 17:59:27 +0000 ddb: make db_error reliably no-return Most code assumes db_error does not return, but according to kdb_reenter_silent, there may be cases where it could. Instead, panic if kdb_reenter_silent returns and mark the routine as __dead2. This addresses gcc warnings. Reported by: GCC -Wmaybe-uninitialized Reviewed by: kib Differential Revision: https://reviews.freebsd.org/D45918 --- sys/ddb/db_command.c | 1 + sys/ddb/ddb.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c index f621bd614ca2..1043f7091085 100644 --- a/sys/ddb/db_command.c +++ b/sys/ddb/db_command.c @@ -580,6 +580,7 @@ db_error(const char *s) db_printf("%s", s); db_flush_lex(); kdb_reenter_silent(); + panic("%s: did not reenter debugger", __func__); } static void diff --git a/sys/ddb/ddb.h b/sys/ddb/ddb.h index ab7dab1daa45..8088226c6939 100644 --- a/sys/ddb/ddb.h +++ b/sys/ddb/ddb.h @@ -233,7 +233,7 @@ void db_check_interrupt(void); void db_clear_watchpoints(void); db_addr_t db_disasm(db_addr_t loc, bool altfmt); /* instruction disassembler */ -void db_error(const char *s); +void db_error(const char *s) __dead2; int db_expression(db_expr_t *valuep); int db_getc(void); int db_get_variable(db_expr_t *valuep);