debuggerd: a few generic improvements

This one makes dump_memory reasonably architecture-agnostic so it is
possible to share the code between architectures.

It also includes a few small improvements in tombstone.cpp.

Change-Id: Ib8a9599bfa420b41e80207988e87aee1b9d79541
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
diff --git a/debuggerd/utility.h b/debuggerd/utility.h
index 1f006ed..232b7bc 100644
--- a/debuggerd/utility.h
+++ b/debuggerd/utility.h
@@ -18,8 +18,9 @@
 #ifndef _DEBUGGERD_UTILITY_H
 #define _DEBUGGERD_UTILITY_H
 
-#include <stddef.h>
+#include <inttypes.h>
 #include <stdbool.h>
+#include <stddef.h>
 
 typedef struct {
     /* tombstone file descriptor */
@@ -60,7 +61,17 @@
 #define XLOG2(fmt...) do {} while(0)
 #endif
 
+#if __LP64__
+#define PRIPTR "016" PRIxPTR
+typedef uint64_t word_t;
+#else
+#define PRIPTR "08" PRIxPTR
+typedef uint32_t word_t;
+#endif
+
 int wait_for_signal(pid_t tid, int* total_sleep_time_usec);
 void wait_for_stop(pid_t tid, int* total_sleep_time_usec);
 
+void dump_memory(log_t* log, pid_t tid, uintptr_t addr, int scope_flags);
+
 #endif // _DEBUGGERD_UTILITY_H