From nobody Fri Mar 22 06:14:30 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 4V1Bqp4K4Fz5Fqlw; Fri, 22 Mar 2024 06:14:30 +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 4V1Bqp3pVsz4DBK; Fri, 22 Mar 2024 06:14:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1711088070; 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=07LoONq/m2cg5gSNFMB9YshdVJJ2CQk5KaqKaTUbM1Y=; b=OUd0MCYUufeMdqqPpXMsOip7cRa3LMu5DhDnWpNpdgTDsrY5sZZfw1TJsjIMxUM4JYB99e UxWly5/IX9OF1hsQu47K/FDh/qOtOp7X6CcoysL7aPlY/vg7tGVTNr79li6KoiCNoP8G3n hPsTKw/v8dlEwFmEYk/CeYj11TiFBOwt4owXdJAeTKjs0ZMJ6GG7n6g7glO1lOj0Lga/zJ ZiSeAqS2ShJdxFYQt2TPrth1YMsMOsIGkpj1ByrxwVeU0kSMbrTRskMIwPv/ZQ2Hea3/40 dv+iBz4hXzlhM33w2Dtw5FQuTlDkMAVNnPlndm1dczbeq+ei7dvk02cRIpDe6Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1711088070; a=rsa-sha256; cv=none; b=xA3RdI0z2zhhX4CqHKAaHOpM8r3qmSoEOkgE+btMMKHlNqKsNXdUqm1V7lcjU/b4hXATeJ T5w6q1H29evxwzubZ+CqT81aAFj9z+DBFkSZ+RmsNTPmkWVbzpyOD6LumO65iiK3zCMF14 HK8+j4N2sNcJCiaOVbifezAkffiDhw6vD/PVz1eMbv9/90BYyeIMnOYXZxr1vaRF8nE+wV o39KQoTyZxpaVnAuW+wUxIKUE1aOZo7QJyrTzEzGwrB0xu5onW14MQe3PmGn1IBmuy865Z 0fOsQyc593NIm4xGxco3Ar8rIe3Yp/TlMI+mFjUvbJIAfYuUN1RbeUYQXQ1Jow== 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=1711088070; 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=07LoONq/m2cg5gSNFMB9YshdVJJ2CQk5KaqKaTUbM1Y=; b=atbfoxtBxcTJRmXzpmfEMNyiQkOTNXfS/YuowzGJbcpgZXbUzWLap9vSWoPLg2IMQu+VSH FwfxvLIcsiXzx3aiSEU4cdZShcfxCqPeo480UG/rf+y3k/i9ETng1qTP3KnOmuRbaz36ug TJQ5mFiz5MeuvlKEbMiw9jHiSojyP8ryINOzYwJjdpejDJFhMoDivEkZivHC8ASvLacOBL AntR3nOhrinb5yEear8iJ09paV312vxWN58VEPEwiCC3dAnD7lAsYfjAZdrOD2WGfJ0lv1 HH9/MF6C/eKTHCkTTWQPogrZ6qI2aKXEaD/50Jtb06oe9sW66Wz6/p9ckiEN5Q== 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 4V1Bqp3Pk0z16rF; Fri, 22 Mar 2024 06:14:30 +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 42M6EUwV057669; Fri, 22 Mar 2024 06:14:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 42M6EU2l057666; Fri, 22 Mar 2024 06:14:30 GMT (envelope-from git) Date: Fri, 22 Mar 2024 06:14:30 GMT Message-Id: <202403220614.42M6EU2l057666@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mark Johnston Subject: git: d722901fa3a2 - main - ddb: Fix format string errors in db_pprint.c 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: markj X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d722901fa3a258d879ce894242a926961a964107 Auto-Submitted: auto-generated The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=d722901fa3a258d879ce894242a926961a964107 commit d722901fa3a258d879ce894242a926961a964107 Author: Mark Johnston AuthorDate: 2024-03-22 06:11:03 +0000 Commit: Mark Johnston CommitDate: 2024-03-22 06:11:03 +0000 ddb: Fix format string errors in db_pprint.c For some reason, db_expr_t is defined as "long" on 64-bit platforms and "int" on others. When printing values of this type, simply cast them to long to suppress compilation errors on 32-bit systems. Reviewed by: bnovkov Fixes: c21bc6f3c242 ("ddb: Add CTF-based pretty printing") --- sys/ddb/db_pprint.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sys/ddb/db_pprint.c b/sys/ddb/db_pprint.c index dc7582864957..aae3d698e8ec 100644 --- a/sys/ddb/db_pprint.c +++ b/sys/ddb/db_pprint.c @@ -72,7 +72,7 @@ db_pprint_int(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) return; } db_printf("0x%lx", - db_get_value(addr, (bits / 8) ? (bits / 8) : 1, sign)); + (long)db_get_value(addr, (bits / 8) ? (bits / 8) : 1, sign)); } /* @@ -226,9 +226,9 @@ db_pprint_enum(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) 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, val); + db_printf("%s (0x%lx)", valname, (long)val); else - db_printf("(0x%lx)", val); + db_printf("(0x%lx)", (long)val); break; } } @@ -273,9 +273,9 @@ db_pprint_ptr(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) name = db_ctf_stroff_to_str(&sym_data, ref_type->ctt_name); db_indent = depth; if (name != NULL) - db_printf("(%s%s *) 0x%lx", qual, name, val); + db_printf("(%s%s *) 0x%lx", qual, name, (long)val); else - db_printf("0x%lx", val); + db_printf("0x%lx", (long)val); } } @@ -305,7 +305,7 @@ db_pprint_type(db_addr_t addr, struct ctf_type_v3 *type, u_int depth) case CTF_K_FUNCTION: case CTF_K_FLOAT: db_indent = depth; - db_iprintf("0x%lx", addr); + db_iprintf("0x%lx", (long)addr); break; case CTF_K_POINTER: db_pprint_ptr(addr, type, depth);