summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/runtime_linux.cc16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/runtime_linux.cc b/src/runtime_linux.cc
index c96b1e530f..c4d4b3ca10 100644
--- a/src/runtime_linux.cc
+++ b/src/runtime_linux.cc
@@ -188,13 +188,15 @@ static void HandleUnexpectedSignal(int signal_number, siginfo_t* info, void*) {
<< (has_address ? StringPrintf(" fault addr %p", info->si_addr) : "");
Backtrace();
- // TODO: make this part optional, like it is on the device?
- // Wait for debugger to attach.
- LOG(INTERNAL_FATAL) << "********************************************************\n"
- << "* Process " << getpid() << " has been suspended while crashing. Attach gdb:\n"
- << "* gdb -p " << getpid() << "\n"
- << "********************************************************\n";
- while (true) {
+ // TODO: instead, get debuggerd running on the host, try to connect, and hang around on success.
+ if (getenv("debug_db_uid") != NULL) {
+ LOG(INTERNAL_FATAL) << "********************************************************\n"
+ << "* Process " << getpid() << " has been suspended while crashing. Attach gdb:\n"
+ << "* gdb -p " << getpid() << "\n"
+ << "********************************************************\n";
+ // Wait for debugger to attach.
+ while (true) {
+ }
}
}