summaryrefslogtreecommitdiffstats
path: root/debuggerd/arm
diff options
context:
space:
mode:
authorAndy McFadden <fadden@android.com>2011-10-18 20:03:07 -0700
committerAndy McFadden <fadden@android.com>2011-10-18 20:20:14 -0700
commite5cc5396e83d12b7ca02ff6096a9950807aa010d (patch)
tree650b8cdf4aa7060d055615c2ce5d2079aaf89579 /debuggerd/arm
parentf2eae5a860ebdf0dd47669c9bf58b8824b57728c (diff)
downloadsystem_core-e5cc5396e83d12b7ca02ff6096a9950807aa010d.zip
system_core-e5cc5396e83d12b7ca02ff6096a9950807aa010d.tar.gz
system_core-e5cc5396e83d12b7ca02ff6096a9950807aa010d.tar.bz2
Add log summary to tombstones
When the tombstones are uploaded to APR, they're truncated at 64KB. This causes the log data, which is at the end, to be lost if the process has more than about 12 threads (which many do). This change adds the last few lines of the log right below the report for the crashing thread, where we should be guaranteed to keep it. Also, clean up trailing newlines on log messages (which end up in the tombstone), and don't print a "------- log" banner if there aren't any messages in that log file (e.g. slog). Also also, don't try to show_nearby_maps unless this is the crashing thread. Bug 5471955 Change-Id: Iaa4fd2fafbaeda2f20bb95f202177d7744a91f9d
Diffstat (limited to 'debuggerd/arm')
-rw-r--r--debuggerd/arm/machine.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/debuggerd/arm/machine.c b/debuggerd/arm/machine.c
index fb0d6ba..d5efb79 100644
--- a/debuggerd/arm/machine.c
+++ b/debuggerd/arm/machine.c
@@ -56,6 +56,8 @@ extern int unwind_backtrace_with_ptrace(int tfd, pid_t pid, mapinfo *map,
/*
* If this isn't clearly a null pointer dereference, dump the
* /proc/maps entries near the fault address.
+ *
+ * This only makes sense to do on the thread that crashed.
*/
static void show_nearby_maps(int tfd, int pid, mapinfo *map)
{
@@ -63,7 +65,8 @@ static void show_nearby_maps(int tfd, int pid, mapinfo *map)
memset(&si, 0, sizeof(si));
if (ptrace(PTRACE_GETSIGINFO, pid, 0, &si)) {
- _LOG(tfd, false, "cannot get siginfo: %s\n", strerror(errno));
+ _LOG(tfd, false, "cannot get siginfo for %d: %s\n",
+ pid, strerror(errno));
return;
}
if (!signal_has_address(si.si_signo))
@@ -237,7 +240,9 @@ void dump_stack_and_code(int tfd, int pid, mapinfo *map,
}
}
- show_nearby_maps(tfd, pid, map);
+ if (at_fault) {
+ show_nearby_maps(tfd, pid, map);
+ }
unsigned int p, end;
unsigned int sp = r.ARM_sp;