This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] arc: Fix ARI warning for printf(%p)
- From: Anton Kolesov <Anton dot Kolesov at synopsys dot com>
- To: gdb-patches at sourceware dot org
- Cc: Anton Kolesov <Anton dot Kolesov at synopsys dot com>, Francois Bedard <Francois dot Bedard at synopsys dot com>
- Date: Thu, 22 Sep 2016 13:40:08 +0300
- Subject: [PATCH] arc: Fix ARI warning for printf(%p)
- Authentication-results: sourceware.org; auth=none
- References: <20160922015601.GA123362@sourceware.org>
This particular warning is printed only when option -Wari is passed to
contrib/ari/gdb_ari.sh , so it slipped under my radar.
Ok to commit?
--
Replace printf ("%p") with printf ("%s", host_address_to_string ()). Printing
host address might make sense here because printed pointers can be null and
this would affect how arc_return_value behaves.
---
gdb/arc-tdep.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c
index 6048ad6..7bb93ad 100644
--- a/gdb/arc-tdep.c
+++ b/gdb/arc-tdep.c
@@ -574,8 +574,9 @@ arc_return_value (struct gdbarch *gdbarch, struct value *function,
|| TYPE_LENGTH (valtype) > 2 * ARC_REGISTER_SIZE);
if (arc_debug)
- debug_printf ("arc: return_value (readbuf = %p, writebuf = %p)\n",
- readbuf, writebuf);
+ debug_printf ("arc: return_value (readbuf = %s, writebuf = %s)\n",
+ host_address_to_string (readbuf),
+ host_address_to_string (writebuf));
if (writebuf != NULL)
{
--
2.8.1