From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 6VJmJoxzbmnkHQsAWB0awg (envelope-from ) for ; Mon, 19 Jan 2026 13:10:20 -0500 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=Bq6m3a0r; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 905B31E089; Mon, 19 Jan 2026 13:10:20 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 98DCF1E089 for ; Mon, 19 Jan 2026 13:10:19 -0500 (EST) Received: from vm01.sourceware.org (localhost [127.0.0.1]) by sourceware.org (Postfix) with ESMTP id 0B1F94BA9033 for ; Mon, 19 Jan 2026 18:10:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0B1F94BA9033 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=Bq6m3a0r Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 691FD4BA900C for ; Mon, 19 Jan 2026 18:09:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 691FD4BA900C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 691FD4BA900C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768846193; cv=none; b=Uug/NGE61ME3Z1zUF2h0bec5vw8TwH6cDPur4SIkr7clMZXlF7Oe4oN8tgLCgH0zApZUJQ12Z+vI4NJ0DGLxBTY7SGBvkn8fZvTo9/P7Bil/MQaX+QsPTh5Q8lzhvfTRmF/S9aS0nkE6scMmkl+vSTuA4xzr+Hamw2YCrfoWDWo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1768846193; c=relaxed/simple; bh=wKIVTUfk3ToMXvPj9SpUCKAGLdjSF+7LYhf0dr6D6dM=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=qll4hg/InhUJw5SSabm0nl7LInSa2l/fUdm9Q4iww/O8u0TsAJ2em3NKKdwZyQXd1QRfCqx/nHSHxWbRB7iuW5cYWVZvLiG8r+RVBibZ91EnHx/7ePhnjcghLBB8XAkxzii5dhtzr7kinxQME4krK1F21wuVYALfir/vUHv82xk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 691FD4BA900C Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 60JI9k5v119263 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jan 2026 13:09:50 -0500 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 60JI9k5v119263 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1768846191; bh=+0qpWaaTpVCARMnyv0bjIETqnYsLmGuTerWvVMsEWg8=; h=Date:Subject:To:From:In-Reply-To:From; b=Bq6m3a0rYZt19/TXj/L8pQTDwnM42fKkA4QvgauLB+Vtw5p6hNqRo/Z6TEUNKyM7V Zitb6Bz4jMS6E3l7UXxKN+7cduhZgEOkuCl3C+Za9TuXzv+jQ7G060bwX3yUHcNBrV Y98rfna9LQVueQhhSYXxecf+9gU0F9hv9vVM/M9AQ8Sqgprmj6XpOh5jOUcdmVpFcg 3RzQosdYcopJpAlUsjJHHCI8bGv67u4tAiNsADF6CNdpopw+QjMtNEXH9LweVyJJI+ 41Se0j/evSzxkwAX91xKpKBhssLu1+yQKqhoXv8q+YuQVrCYITFYg+nEC3fDiTOZLu 0Qw4hLb9XQ5Qg== Received: by simark.ca (Postfix) id CEA6D1E089; Mon, 19 Jan 2026 13:09:45 -0500 (EST) Message-ID: <5f4ce462-c6a2-4b87-ab22-c159251678a6@polymtl.ca> Date: Mon, 19 Jan 2026 13:09:45 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb, gdbsupport, gdbserver: add support for printf 't' length modifier To: Guinevere Larsen , gdb-patches@sourceware.org References: <20260112182407.622150-1-simon.marchi@polymtl.ca> Content-Language: fr From: Simon Marchi In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Mon, 19 Jan 2026 18:09:46 +0000 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 1/19/26 12:29 PM, Guinevere Larsen wrote: > On 1/12/26 3:24 PM, simon.marchi@polymtl.ca wrote: >> From: Simon Marchi >> >> Tom de Vries reported [1] that a use of the `t` printf length modifier >> (used for ptrdiff_t) breaks "set debug dwarf-die 1": >> >> +break -qualified main >> Reading Reading compcomp unit at offset unit at offset 0x00x39 >> >> Reading comp unit at offset 0x1a8 >> Reading comp unit at offset 0x1e9 >> Reading comp unit at offset 0x2c5 >> Reading comp unit at offset 0x2a2 >> Reading comp unit at offset 0x904 >> Unrecognized format specifier 't' in printf >> >> This use is in dwarf2/read.c: >> >> gdb_printf (gdb_stdlog, "Read die from %s@0x%tx of %s:\n", >> m_die_section->get_name (), >> (begin_info_ptr - m_die_section->buffer), >> bfd_get_filename (m_abfd)); >> >> Add support for the `t` length modifier in format_pieces, which >> gdb_printf ultimately uses (through ui_out::vmessage). Modify the three >> users of format_pieces: gdb's printf command, gdb's ui_out::vmessage >> function and gdbserver's ax_printf function. >> >> The implementation is mostly copied from what we do for size_t. >> >> Since format_pieces is also used to implement the printf command, this >> patch brings user-visible changes. Before: >> >> (gdb) printf "%td\n", -123 >> ❌️ Unrecognized format specifier 't' in printf >> >> After: >> >> (gdb) printf "%td\n", -123 >> -123 >> >> [1] https://inbox.sourceware.org/gdb-patches/d4ccce34-aad5-4e3d-8fc9-efb2fc11275c@suse.de/ >> >> Change-Id: Ie9fce78f5f48082d8f8a9ca2847b5ae26acaa60d >> --- > > This commit seems to have caused a regression. After this, when starting GDB without the quiet flag I get the following: > > 0x7ffc6b9bc520s > Copyright (C) 2026 Free Software Foundation, Inc. > License GPLv3+: GNU GPL version 3 or later <0x7ffc6b9bc560s> > This is free software: you are free to change and redistribute it > There is NO WARRANTY, to the extent permitted by law. > Type "0x7ffc6b9bc5e0s" and "0x7ffc6b9bc5a0s" for details. > This GDB was configured as "x86_64-pc-linux-gnu". > Type "0x7ffc6b9bc620s" for configuration details. > For bug reporting instructions, please see: > 0x7ffc6b9bc660s. > > That is, anywhere where GDB would print a styled string, we seem to be printing a pointer address instead. Hmm, I don't see this. I see a pink "GNU gdb (GDB) 18.0.50.20260119-git" where you see the "0x7ffc6b9bc660s". We will need to figure out what is different between our setups. Simon