Loading debuggerd/debuggerd.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -248,8 +248,8 @@ static int read_request(int fd, debugger_request_t* out_request) { return 0; } static bool should_attach_gdb(debugger_request_t* request) { if (request->action == DEBUGGER_ACTION_CRASH) { static bool should_attach_gdb(const debugger_request_t& request) { if (request.action == DEBUGGER_ACTION_CRASH) { return property_get_bool("debug.debuggerd.wait_for_gdb", false); } return false; Loading Loading @@ -487,7 +487,7 @@ static void worker_process(int fd, debugger_request_t& request) { // Don't attach to the sibling threads if we want to attach gdb. // Supposedly, it makes the process less reliable. bool attach_gdb = should_attach_gdb(&request); bool attach_gdb = should_attach_gdb(request); if (attach_gdb) { // Open all of the input devices we need to listen for VOLUMEDOWN before dropping privileges. if (init_getevent() != 0) { Loading Loading @@ -563,6 +563,10 @@ static void worker_process(int fd, debugger_request_t& request) { static void monitor_worker_process(int child_pid, const debugger_request_t& request) { struct timespec timeout = {.tv_sec = 10, .tv_nsec = 0 }; if (should_attach_gdb(request)) { // If wait_for_gdb is enabled, set the timeout to something large. timeout.tv_sec = INT_MAX; } sigset_t signal_set; sigemptyset(&signal_set); Loading Loading
debuggerd/debuggerd.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -248,8 +248,8 @@ static int read_request(int fd, debugger_request_t* out_request) { return 0; } static bool should_attach_gdb(debugger_request_t* request) { if (request->action == DEBUGGER_ACTION_CRASH) { static bool should_attach_gdb(const debugger_request_t& request) { if (request.action == DEBUGGER_ACTION_CRASH) { return property_get_bool("debug.debuggerd.wait_for_gdb", false); } return false; Loading Loading @@ -487,7 +487,7 @@ static void worker_process(int fd, debugger_request_t& request) { // Don't attach to the sibling threads if we want to attach gdb. // Supposedly, it makes the process less reliable. bool attach_gdb = should_attach_gdb(&request); bool attach_gdb = should_attach_gdb(request); if (attach_gdb) { // Open all of the input devices we need to listen for VOLUMEDOWN before dropping privileges. if (init_getevent() != 0) { Loading Loading @@ -563,6 +563,10 @@ static void worker_process(int fd, debugger_request_t& request) { static void monitor_worker_process(int child_pid, const debugger_request_t& request) { struct timespec timeout = {.tv_sec = 10, .tv_nsec = 0 }; if (should_attach_gdb(request)) { // If wait_for_gdb is enabled, set the timeout to something large. timeout.tv_sec = INT_MAX; } sigset_t signal_set; sigemptyset(&signal_set); Loading