git: ffdac5099420 - stable/14 - libdtrace: Fix dt_print_sym() not printing symbols in non-oformat mode

Li-Wen Hsu <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.src
Message-ID <6a73e67e.39f94.17b0f7b__20848.986918439$1785980557$gmane$org@gitrepo.freebsd.org>
The branch stable/14 has been updated by lwhsu:

URL: https://cgit.FreeBSD.org/src/commit/?id=ffdac5099420c77ce658fed66e7eacd58b48b60e

commit ffdac5099420c77ce658fed66e7eacd58b48b60e
Author:     Li-Wen Hsu <[email protected]>
AuthorDate: 2026-06-27 02:26:05 +0000
Commit:     Li-Wen Hsu <[email protected]>
CommitDate: 2026-08-06 01:40:12 +0000

    libdtrace: Fix dt_print_sym() not printing symbols in non-oformat mode
    
    dt_print_sym() fills the symbol string via snprintf() in non-oformat
    mode but the guarding `dtp->dt_oformat != 0 &&` for the dt_printf()
    call causes the symbol is computed but never emitted.
    
    This fixes tests:
    
    - common.profile-n.t_dtrace_contrib.tst_sym_ksh
    - common.profile-n.t_dtrace_contrib.tst_func_ksh
    
    Reviewed by:    markj
    Fixes:          93f27766a7e1 ("dtrace: Add the 'oformat' libdtrace option")
    MFC after:      3 days
    Event:          Halifax Hackathon 202606
    Location:       Room 208, Computer Science Building, Dalhousie University
    Sponsored by:   The FreeBSD Foundation
    Differential Revision:  https://reviews.freebsd.org/D57895
    
    (cherry picked from commit 8e61d8707f8a10acc143210089fea2502a3f2922)
---
 cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
index 56418d7283b6..8938a6a2bc3e 100644
--- a/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
+++ b/cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c
@@ -2143,7 +2143,7 @@ dt_print_sym(dtrace_hdl_t *dtp, FILE *fp, const char *format, caddr_t addr)
 		}
 	}
 
-	if (dtp->dt_oformat != 0 && dt_printf(dtp, fp, format, c) < 0)
+	if (!dtp->dt_oformat && dt_printf(dtp, fp, format, c) < 0)
 		return (-1);
 
 	return (0);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.