summaryrefslogtreecommitdiffstats
path: root/debuggerd
diff options
context:
space:
mode:
authorDmitriy Ivanov <dimitry@google.com>2014-08-10 00:08:34 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-08-10 00:08:34 +0000
commitc3261151152f27011135786820579eb1981540f3 (patch)
treee9d3470071e8979842cba737db0c54b4a33c8f60 /debuggerd
parent9cf963d61e0d9e33abfbc15b81f09ec487266a93 (diff)
parent75ef453e5d3352aad8c55cd8fa572945c6f4bbfa (diff)
downloadsystem_core-c3261151152f27011135786820579eb1981540f3.zip
system_core-c3261151152f27011135786820579eb1981540f3.tar.gz
system_core-c3261151152f27011135786820579eb1981540f3.tar.bz2
am 75ef453e: am 2f40ddf3: Merge "Do not suppress maps dump when si_addr<PAGE_SIZE"
* commit '75ef453e5d3352aad8c55cd8fa572945c6f4bbfa': Do not suppress maps dump when si_addr<PAGE_SIZE
Diffstat (limited to 'debuggerd')
-rw-r--r--debuggerd/tombstone.cpp15
1 files changed, 6 insertions, 9 deletions
diff --git a/debuggerd/tombstone.cpp b/debuggerd/tombstone.cpp
index df982a9..a7e1524 100644
--- a/debuggerd/tombstone.cpp
+++ b/debuggerd/tombstone.cpp
@@ -64,6 +64,7 @@ static bool signal_has_si_addr(int sig) {
case SIGFPE:
case SIGILL:
case SIGSEGV:
+ case SIGTRAP:
return true;
default:
return false;
@@ -350,16 +351,12 @@ static void dump_nearby_maps(BacktraceMap* map, log_t* log, pid_t tid) {
return;
}
- bool is_running = (si.si_code == SI_USER);
+ bool has_fault_address = signal_has_si_addr(si.si_signo);
uintptr_t addr = reinterpret_cast<uintptr_t>(si.si_addr);
- addr &= ~0xfff; // round to 4K page boundary
- if (!is_running && addr == 0) { // null-pointer deref
- return;
- }
- _LOG(log, logtype::MAPS, "\nmemory map: %s\n", is_running? "" : "(fault address prefixed with --->)");
+ _LOG(log, logtype::MAPS, "\nmemory map: %s\n", has_fault_address ? "(fault address prefixed with --->)" : "");
- if(!is_running && (addr < map->begin()->start)) {
+ if (has_fault_address && (addr < map->begin()->start)) {
_LOG(log, logtype::MAPS, "--->Fault address falls at %" PRIPTR " before any mapped regions\n", addr);
}
@@ -369,10 +366,10 @@ static void dump_nearby_maps(BacktraceMap* map, log_t* log, pid_t tid) {
_LOG(log, logtype::MAPS, "--->Fault address falls at %" PRIPTR " between mapped regions\n", addr);
}
prev = it;
- bool in_map = !is_running && (addr >= (*it).start) && (addr < (*it).end);
+ bool in_map = has_fault_address && (addr >= (*it).start) && (addr < (*it).end);
dump_map(log, &*it, in_map);
}
- if (!is_running && (addr >= (*prev).end)) {
+ if (has_fault_address && (addr >= (*prev).end)) {
_LOG(log, logtype::MAPS, "--->Fault address falls at %" PRIPTR " after any mapped regions\n", addr);
}
}