[PATCH 2/5] monitor: Print addresses like identifiers

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 23 07:14:51 UTC 2015


This avoids the "0x0xabc" output and is more compact.
---
 cpukit/libmisc/monitor/mon-prmisc.c | 4 ++--
 cpukit/libmisc/monitor/monitor.h    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/cpukit/libmisc/monitor/mon-prmisc.c b/cpukit/libmisc/monitor/mon-prmisc.c
index 1b3a4df..f0d6b00 100644
--- a/cpukit/libmisc/monitor/mon-prmisc.c
+++ b/cpukit/libmisc/monitor/mon-prmisc.c
@@ -47,9 +47,9 @@ rtems_monitor_dump_decimal(uint32_t   num)
 }
 
 int
-rtems_monitor_dump_addr(void *addr)
+rtems_monitor_dump_addr(const void *addr)
 {
-    return fprintf(stdout,"0x%p", addr);
+    return fprintf(stdout,"%08" PRIxPTR, (intptr_t) addr);
 }
 
 int
diff --git a/cpukit/libmisc/monitor/monitor.h b/cpukit/libmisc/monitor/monitor.h
index 2f6cb71..add32bc 100644
--- a/cpukit/libmisc/monitor/monitor.h
+++ b/cpukit/libmisc/monitor/monitor.h
@@ -403,7 +403,7 @@ void       rtems_monitor_separator(void);
 uint32_t   rtems_monitor_pad(uint32_t   dest_col, uint32_t   curr_col);
 int        rtems_monitor_dump_decimal(uint32_t   num);
 int        rtems_monitor_dump_hex(uint32_t   num);
-int        rtems_monitor_dump_addr(void *addr);
+int        rtems_monitor_dump_addr(const void *addr);
 int        rtems_monitor_dump_id(rtems_id id);
 int        rtems_monitor_dump_name(rtems_id id);
 int        rtems_monitor_dump_priority(rtems_task_priority priority);
-- 
1.8.4.5




More information about the devel mailing list