public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tsukasa OI <a4lg@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] sim/ppc: Fix core_find_mapping diagnostics
Date: Wed, 12 Oct 2022 13:51:13 +0000 (GMT)	[thread overview]
Message-ID: <20221012135113.6D4CB3821FE3@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=4bd531c7ffda1df83b6e54ce11f28a0821e3d59e

commit 4bd531c7ffda1df83b6e54ce11f28a0821e3d59e
Author: Tsukasa OI <research_trasio@irq.a4lg.com>
Date:   Wed Oct 12 12:22:12 2022 +0000

    sim/ppc: Fix core_find_mapping diagnostics
    
    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.

Diff:
---
 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;
 }

                 reply	other threads:[~2022-10-12 13:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221012135113.6D4CB3821FE3@sourceware.org \
    --to=a4lg@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).