summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2013-01-03 15:21:56 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2013-01-03 15:21:56 -0800
commite8097be24e508f6ff6b6dfd9144bd4de1db8becc (patch)
tree76f3f741b5fcbd81a03d4cc670902b9e7cb86d92 /debuggerd
parent2b5b3bb103f59d9d3bf25c0c1f8035db036917da (diff)
parenta82985b6686f8b47119193fee2f804376a90125b (diff)
downloadsystem_core-e8097be24e508f6ff6b6dfd9144bd4de1db8becc.zip
system_core-e8097be24e508f6ff6b6dfd9144bd4de1db8becc.tar.gz
system_core-e8097be24e508f6ff6b6dfd9144bd4de1db8becc.tar.bz2
am a82985b6: am 7cd45071: Merge "Include page protections in the debuggerd map output."
* commit 'a82985b6686f8b47119193fee2f804376a90125b': Include page protections in the debuggerd map output.
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/tombstone.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/debuggerd/tombstone.c b/debuggerd/tombstone.c
index 98016c3..e8b3e24 100644
--- a/debuggerd/tombstone.c
+++ b/debuggerd/tombstone.c
@@ -350,6 +350,18 @@ static void dump_backtrace_and_stack(const ptrace_context_t* context, log_t* log
}
}
+static void dump_map(log_t* log, map_info_t* m, const char* what) {
+ if (m != NULL) {
+ _LOG(log, false, " %08x-%08x %c%c%c %s\n", m->start, m->end,
+ m->is_readable ? 'r' : '-',
+ m->is_writable ? 'w' : '-',
+ m->is_executable ? 'x' : '-',
+ m->name);
+ } else {
+ _LOG(log, false, " (no %s)\n", what);
+ }
+}
+
static void dump_nearby_maps(const ptrace_context_t* context, log_t* log, pid_t tid) {
siginfo_t si;
memset(&si, 0, sizeof(si));
@@ -396,21 +408,9 @@ static void dump_nearby_maps(const ptrace_context_t* context, log_t* log, pid_t
* Show "next" then "match" then "prev" so that the addresses appear in
* ascending order (like /proc/pid/maps).
*/
- if (next != NULL) {
- _LOG(log, false, " %08x-%08x %s\n", next->start, next->end, next->name);
- } else {
- _LOG(log, false, " (no map below)\n");
- }
- if (map != NULL) {
- _LOG(log, false, " %08x-%08x %s\n", map->start, map->end, map->name);
- } else {
- _LOG(log, false, " (no map for address)\n");
- }
- if (prev != NULL) {
- _LOG(log, false, " %08x-%08x %s\n", prev->start, prev->end, prev->name);
- } else {
- _LOG(log, false, " (no map above)\n");
- }
+ dump_map(log, next, "map below");
+ dump_map(log, map, "map for address");
+ dump_map(log, prev, "map above");
}
static void dump_thread(const ptrace_context_t* context, log_t* log, pid_t tid, bool at_fault,