From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id EVrVJEwSYmqmWykAWB0awg (envelope-from ) for ; Thu, 23 Jul 2026 09:08:28 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=palves.net header.i=@palves.net header.a=rsa-sha256 header.s=dreamhost header.b=pgBPcgWo; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 91DA61E09E; Thu, 23 Jul 2026 09:08:28 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.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 autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::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 2366A1E099 for ; Thu, 23 Jul 2026 09:08:28 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id E5D084BA799C for ; Thu, 23 Jul 2026 13:08:26 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E5D084BA799C Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=palves.net header.i=@palves.net header.a=rsa-sha256 header.s=dreamhost header.b=pgBPcgWo Received: from firebrick.apple.relay.mailchannels.net (firebrick.apple.relay.mailchannels.net [23.83.208.59]) by sourceware.org (Postfix) with ESMTPS id 4810F4BA7997 for ; Thu, 23 Jul 2026 13:04:49 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 4810F4BA7997 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=palves.net ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 4810F4BA7997 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=23.83.208.59 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784811889; cv=none; b=T9uuCN7Cs0RyRsH+7RUAqX0v1PVsHmOz3S8lrTrMJ8VdYouQW03rUrwlUFTJaRVnblSxGk1dmtK1AZEm7pou5O2YjRLpujUgMsnzLAa8uOLuvqd1w5901ZFU61VaarjqfFwV+c1qEcnVH8Av0YCneXKs1/01f0T3VbDZcFNe2zU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1784811889; c=relaxed/simple; bh=r7bpUn/X5vhclGSFFN73VTl2kZALXUNSrhyyLU9oY80=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=GeVa+QPHXilArOD7toTTTT2+QQMYAMUgvBab7YTAmu2u6yo3INTww01/CSnThyzihapnE7LycwvR7hb+YOgA/QmweEaQ33KHSl6MQ64Dpx8Q/zEZbAlUn2FNh+q/McVp9NWt6b+SHma0rLDtNK0TuIWbiwx7ZrbPUm5GrRkYoDo= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=palves.net header.i=@palves.net header.a=rsa-sha256 header.s=dreamhost header.b=pgBPcgWo DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4810F4BA7997 X-Sender-Id: dreamhost|x-authsender|pedro@palves.net Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 49124602D7 for ; Thu, 23 Jul 2026 13:04:48 +0000 (UTC) Received: from pdx1-sub0-mail-a249.dreamhost.com (100-103-105-133.trex-nlb.outbound.svc.cluster.local [100.103.105.133]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id E3DCF60641 for ; Thu, 23 Jul 2026 13:04:47 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|pedro@palves.net X-MC-Relay: Good X-MailChannels-SenderId: dreamhost|x-authsender|pedro@palves.net X-MailChannels-Auth-Id: dreamhost X-Abiding-Daffy: 483777670a927d6f_1784811888154_3815477539 X-MC-Loop-Signature: 1784811888154:1200681361 X-MC-Ingress-Time: 1784811888153 Received: from pdx1-sub0-mail-a249.dreamhost.com (pop.dreamhost.com [64.90.62.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384) by 100.103.105.133 (trex/8.0.2); Thu, 23 Jul 2026 13:04:48 +0000 Received: from localhost (bl20-181-64.dsl.telepac.pt [2.81.181.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: pedro@palves.net) by pdx1-sub0-mail-a249.dreamhost.com (Postfix) with ESMTPSA id 4h5WYW2xmlz1041 for ; Thu, 23 Jul 2026 06:04:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=palves.net; s=dreamhost; t=1784811887; bh=XQMur2+TkGjgZPTxBlPQh17capef6cenDpBlaCZmvNc=; h=From:To:Subject:Date:Content-Transfer-Encoding; b=pgBPcgWoS2+lJR7ofCGbf8xMcUXMbtMJ9Jn2Wks7NKR01DAc1WqUzh8TfVbRT5Qjb JM+YLXs+h2720k2zkHSF3afymPL0/8ZMK0lvwLxU9gunD82ceD9OzPS7U4lZSla/iw 2YoVAc8dk3BC68LxjRfAovmr48LhE408l4A2Sa+xiToA1WY4vYYQ29qmCFQ7BRkzOE ceZ0s0JpAfnZy2WsXv3wlu3A12pYQh0qODpnJmXrVy+CdoCBg3yR1yJaSSe75K8LJJ iDIQxg3US6dGNvI8+INM5MjyqqpQqpRsKF8p5Qd1h/5pWeIttH1ZDPCxCk4Fcrlbsn 38E838oiAEXpA== From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 18/27] gdb: %p => host_address_to_string, target-section owner token Date: Thu, 23 Jul 2026 14:01:09 +0100 Message-ID: <20260723130118.206735-19-pedro@palves.net> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260723130118.206735-1-pedro@palves.net> References: <20260723130118.206735-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 "maintenance info target-sections" prints an owner token for each section, formatted with %p: gdb_printf ("%*sStart: %s, End: %s, Owner token: %p\n", ... The exact rendering of %p is implementation-defined. glibc prints it with a leading "0x", but the MSVC C runtime prints it zero-padded and with no "0x" prefix, e.g.: Owner token: 000001833bd9bde0 gdb.base/maint-info-sections.exp expects a "0x"-prefixed value there, so on windows-msvc the auxiliary-information line does not match and the test fails: FAIL: gdb.base/maint-info-sections.exp: with executable: maint info target-sections Fix this by using host_address_to_string, which always renders a host pointer with a "0x" prefix regardless of the C runtime, as GDB does elsewhere for this reason. Tested on x86_64-pc-linux-gnu and x86_64-pc-windows-msvc. Change-Id: Ib9f081b65f02e2820783f87cfaffcff81e46e983 --- gdb/maint.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gdb/maint.c b/gdb/maint.c index 1daa6ce1d2e..cbcdf59001b 100644 --- a/gdb/maint.c +++ b/gdb/maint.c @@ -522,11 +522,11 @@ maintenance_info_target_sections (const char *arg, int from_tty) digits); /* The magic '8 + digits' here ensures that the 'Start' is aligned with the output of print_bfd_section_info. */ - gdb_printf ("%*sStart: %s, End: %s, Owner token: %p\n", + gdb_printf ("%*sStart: %s, End: %s, Owner token: %s\n", (8 + digits), "", hex_string_custom (sec.addr, addr_size), hex_string_custom (sec.endaddr, addr_size), - sec.owner.v ()); + host_address_to_string (sec.owner.v ())); } } -- 2.54.0