From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id LIxeHCbGRmNYaQoAWB0awg (envelope-from ) for ; Wed, 12 Oct 2022 09:50:30 -0400 Received: by simark.ca (Postfix, from userid 112) id 642231E112; Wed, 12 Oct 2022 09:50:30 -0400 (EDT) Authentication-Results: simark.ca; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=XXSiA+Hy; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 120591E0CB for ; Wed, 12 Oct 2022 09:50:30 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 57B173821FDD for ; Wed, 12 Oct 2022 13:50:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 57B173821FDD DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1665582629; bh=NbS49VTZCfIwngo+hRKXwRPp9RJSwqSWU/o5LZDKKtg=; h=To:Subject:In-Reply-To:References:Date:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=XXSiA+HymowVDcd1scx34E7qN03ajXX65tTPtN2v7eBCcLuG8dXeoZo9lfnwG0mbq CtE7617r87nZBRgsQ0w1tmZW3c1OC/sTsbFo6zyg73ikhAVuGStp4+Nw057vK4JoZ6 RtsWuDdMXvhlV1x+QWRlozGhttvHCjrWX1s2FFpk= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 30C463851416 for ; Wed, 12 Oct 2022 13:50:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 30C463851416 Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-437-WhWeSN8EM3CHnXwxGCIBXQ-1; Wed, 12 Oct 2022 09:50:06 -0400 X-MC-Unique: WhWeSN8EM3CHnXwxGCIBXQ-1 Received: by mail-wm1-f69.google.com with SMTP id l15-20020a05600c4f0f00b003b4bec80edbso10020798wmq.9 for ; Wed, 12 Oct 2022 06:50:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=NbS49VTZCfIwngo+hRKXwRPp9RJSwqSWU/o5LZDKKtg=; b=dCcPFbO31NkBLV/ed67iVl76/1lY2MOZbbDNcekPeqfdkwICVJrNxDWOba3DNpJh8k fwT0vPFrIl70CvE6sXfGCvwPPIURB+Qsv09R75HZ8EPCtk6UMSRICxN9UAm6xxqI+Aba geLse07e/kX/9o3SlhIBZhhWPPDC36rJTzVdt/yeFkLnM2XINyscNZvLbbVY45x096sa BydsbopNOPfURDnt4h52NTmdPymF44ckZKH7a3wclkIQ2RojgheKi4fweVZaNh1TlTjV qpvyT2TPeKJAYpm2f2HfLHlryFP57iewtFRC/VbS8JabJ37a6hsNufuSW8nqjo8Ly6Nb ti3A== X-Gm-Message-State: ACrzQf0oNlSQq7w4Tpm70jNZ1Fl4j9mjVZ7/uR0wuwE4S8Xim3HhLvcb RAnMdsokx2Io8B/TdRpXGtUtNHFQXxdPYf812eU/1zKqO7u8tqgcLnPJt7NMmenxmd3aXYv8sGj l+75rUaZtvf/7ocPxk0ChUA== X-Received: by 2002:adf:ec4d:0:b0:22e:3211:483a with SMTP id w13-20020adfec4d000000b0022e3211483amr19115751wrn.295.1665582605750; Wed, 12 Oct 2022 06:50:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4s+ExXsK3Da8ldTioanUQqLZ0FxNba6XMHWDlcTjQlVydHoeNkdRq7mvSNXee560ec+aD+Og== X-Received: by 2002:adf:ec4d:0:b0:22e:3211:483a with SMTP id w13-20020adfec4d000000b0022e3211483amr19115739wrn.295.1665582605480; Wed, 12 Oct 2022 06:50:05 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id z5-20020a056000110500b0022b11a27e39sm13635488wrw.1.2022.10.12.06.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Oct 2022 06:50:04 -0700 (PDT) To: Tsukasa OI , Tsukasa OI , Tom de Vries Subject: Re: [PATCH 1/1] sim/ppc: Fix core_find_mapping diagnostics In-Reply-To: <5894ec3b0f77b7fe60b8fe7376780f0874267e15.1665578330.git.research_trasio@irq.a4lg.com> References: <87wn95bctu.fsf@redhat.com> <5894ec3b0f77b7fe60b8fe7376780f0874267e15.1665578330.git.research_trasio@irq.a4lg.com> Date: Wed, 12 Oct 2022 14:50:03 +0100 Message-ID: <87r0zdb184.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: gdb-patches@sourceware.org Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" Tsukasa OI writes: > Because "%p" is the pointer conversion specifier to print a pointer in an > implementation-defined manner, the result with format string containing > "0x%p" can be strange. For instance, core_map_find_mapping prints error > containing "0x0x...." (processor is not NULL) or "0x(null)" (processor is > NULL) on glibc. > > This commit replaces "0x%p" with "%p" to prevent unpredictable > behavior. Thanks, please go ahead and push. Thanks, Andrew > --- > sim/ppc/corefile.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/sim/ppc/corefile.c b/sim/ppc/corefile.c > index b2faef58c5b..ee4e2cf733e 100644 > --- a/sim/ppc/corefile.c > +++ b/sim/ppc/corefile.c > @@ -292,7 +292,7 @@ core_map_find_mapping(core_map *map, > mapping = mapping->next; > } > if (abort) > - error("core_find_mapping() - access to unmaped address, attach a default map to handle this - addr=0x%x nr_bytes=0x%x processor=0x%p cia=0x%x\n", > + error("core_find_mapping() - access to unmaped address, attach a default map to handle this - addr=0x%x nr_bytes=0x%x processor=%p cia=0x%x\n", > addr, nr_bytes, (void *) processor, cia); > return NULL; > } > -- > 2.34.1