From nobody Wed Apr 03 16:18:25 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 4V8qg551mxz5FLLN; Wed, 3 Apr 2024 16:18:25 +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 4V8qg54Y5Lz4pJM; Wed, 3 Apr 2024 16:18:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1712161105; 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=VAIjn6FVxOOGYhSWnqdfrqbg8YseK8WECNcILedyE1A=; b=YqKgIu5ny9RLxOWTYHs2Auk//GwhhgjoTiXRrmYROazc1pDpbBKFi9N3fB+4vJh8VdrqQm OXQBZ3+qgQXNDHyaIcqyjssDTVU8ErUVfgIpAiIBn6R8EpErZ2S6uY+1FXa8kkVtw0fPuD Pvlr0jSwwG4u7e2VojLTyATQ8jRv9awW7zz16REQZPPbHaV5nw8+SylNFB/21ZeopPRkBx u1KXGlZGRl7EHh3ZKfj2LlQ3qWWYfGSgRGe1qYxwY0fRAc5CneIM3UtOnaT0Z+zfjqEydd V91pbbyl4wgmNfU+wwNP95p8I6F60QBzcBLNghyTkBAmGj2/gbMuyvsnZ1VkuA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1712161105; a=rsa-sha256; cv=none; b=mmk/ztTVsdtkrNVwfWB0gyRReFuTZoKuazOwyw/kkxCRphzOHaREGWBgiOO7FSoEaI4UrQ 7MZYr0X9oJMAsQMC38k93k25OrIUp+wjSXBZuNb9rj00crXetk6aTMX4AtgxZa0b1Jj5cO HfUCw49JT8sjlxOKd3TwddXlaxpTQ80VnkvIujQghFDhbDVR4CfoJ5Nd9MZzxyhksHSZuz HCPoMbsiBBraD8/nAPUBU9F/9hnmFNp7xUiotgyuAdld9zs5JEymaHrbr+ES8fXRxK5TED tPf98OO6Dfmm3FICiCjfPNCpsosGtPtDbBfxmmAbMfR6fSFQ33Z3nybtZxgujw== 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=1712161105; 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=VAIjn6FVxOOGYhSWnqdfrqbg8YseK8WECNcILedyE1A=; b=DBQMxt186QahK+Vn0+fNRHm6v4fcBW4zvQ4IPBamKMECc3NnevJTegTe+lTC79Ayq+Hred Sy+qi4aPf9AuCqbDPpONgRXvjVo8LlUsVrRslKDTuBo/SB7lrz6jHhENanjAN1LsDFlk0E hXcRT2lEP8NzWWr1SN2xQKRPtrxabVjzcws0//f/Gf5tivlB3xCmT4ElPcAfahyQc5GnsT 7iO+qdff81p5z1W4mW8aBBx14J+KcyPJ/zTtSuXqe1FDRXgCLkTM41SoQJWYQQtPERjSrC 1CDYFq718E8m4gJtHkMeq7iMGfNsbb4ImyWngNysAjXSUb6IZtfLwV6SlMnWoQ== 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 4V8qg542KVzfyr; Wed, 3 Apr 2024 16:18:25 +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 433GIPKo096544; Wed, 3 Apr 2024 16:18:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 433GIPbq096540; Wed, 3 Apr 2024 16:18:25 GMT (envelope-from git) Date: Wed, 3 Apr 2024 16:18:25 GMT Message-Id: <202404031618.433GIPbq096540@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Bojan =?utf-8?Q?Novkovi=C4=87?= Subject: git: aada453dcbaa - main - ddb: Properly pretty-print non-labeled enum values 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: bnovkov X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: aada453dcbaab1b8f7d50b66add5a38eb9e06cc3 Auto-Submitted: auto-generated The branch main has been updated by bnovkov: URL: https://cgit.FreeBSD.org/src/commit/?id=aada453dcbaab1b8f7d50b66add5a38eb9e06cc3 commit aada453dcbaab1b8f7d50b66add5a38eb9e06cc3 Author: Bojan Novković AuthorDate: 2024-04-03 15:47:00 +0000 Commit: Bojan Novković CommitDate: 2024-04-03 16:17:11 +0000 ddb: Properly pretty-print non-labeled enum values The ddb pretty-printer currently does not print out enum values that are not labeled (e.g. X | Y). The enum printer was reworked to print non-labeled values. Reported by: jrtc27 Fixes: c21bc6f ("ddb: Add CTF-based pretty printing") Approved by: markj (mentor) --- sys/ddb/db_pprint.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/ddb/db_pprint.c b/sys/ddb/db_pprint.c index 8aa14550f068..b4116372cf65 100644 --- a/sys/ddb/db_pprint.c +++ b/sys/ddb/db_pprint.c @@ -225,13 +225,14 @@ db_pprint_enum(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) for (; ep < endp; ep++) { if (val == ep->cte_value) { valname = db_ctf_stroff_to_str(&sym_data, ep->cte_name); - if (valname != NULL) - db_printf("%s (0x%lx)", valname, (long)val); - else - db_printf("(0x%lx)", (long)val); - break; + if (valname != NULL) { + db_printf("%s (0x%lx)", valname, val); + break; + } } } + if (ep == endp) + db_printf("0x%lx", val); } /*