• Home
  • Raw
  • Download

Lines Matching refs:request

77 static void wait_for_user_action(const debugger_request_t& request) {  in wait_for_user_action()  argument
88 request.pid, request.tid); in wait_for_user_action()
100 ALOGI("debuggerd resuming process %d", request.pid); in wait_for_user_action()
154 static bool selinux_action_allowed(int s, debugger_request_t* request) in selinux_action_allowed() argument
161 …if (request->action <= 0 || request->action >= (sizeof(debuggerd_perms)/sizeof(debuggerd_perms[0])… in selinux_action_allowed()
162 ALOGE("SELinux: No permission defined for debugger action %d", request->action); in selinux_action_allowed()
166 perm = debuggerd_perms[request->action]; in selinux_action_allowed()
173 if (getpidcon(request->tid, &tcon) < 0) { in selinux_action_allowed()
174 ALOGE("Cannot get context for tid %d\n", request->tid); in selinux_action_allowed()
178 allowed = (selinux_check_access(scon, tcon, tclass, perm, reinterpret_cast<void*>(request)) == 0); in selinux_action_allowed()
330 static bool should_attach_gdb(const debugger_request_t& request) { in should_attach_gdb() argument
331 if (request.action == DEBUGGER_ACTION_CRASH) { in should_attach_gdb()
363 static void redirect_to_32(int fd, debugger_request_t* request) { in redirect_to_32() argument
366 msg.tid = request->tid; in redirect_to_32()
367 msg.action = request->action; in redirect_to_32()
455 static bool perform_dump(const debugger_request_t& request, int fd, int tombstone_fd, in perform_dump() argument
465 int signal = wait_for_signal(request.tid, &total_sleep_time_usec); in perform_dump()
472 if (request.action == DEBUGGER_ACTION_DUMP_TOMBSTONE) { in perform_dump()
474 engrave_tombstone(tombstone_fd, backtrace_map, request.pid, request.tid, siblings, signal, in perform_dump()
475 request.original_si_code, request.abort_msg_address, amfd_data); in perform_dump()
476 } else if (request.action == DEBUGGER_ACTION_DUMP_BACKTRACE) { in perform_dump()
478 dump_backtrace(fd, backtrace_map, request.pid, request.tid, siblings, nullptr); in perform_dump()
481 if (ptrace(PTRACE_CONT, request.tid, 0, 0) != 0) { in perform_dump()
501 engrave_tombstone(tombstone_fd, backtrace_map, request.pid, request.tid, siblings, signal, in perform_dump()
502 request.original_si_code, request.abort_msg_address, amfd_data); in perform_dump()
537 static void worker_process(int fd, debugger_request_t& request) { in worker_process() argument
541 switch (request.action) { in worker_process()
555 ALOGE("debuggerd: unexpected request action: %d", request.action); in worker_process()
571 if (ptrace(PTRACE_ATTACH, request.tid, 0, 0) != 0) { in worker_process()
578 bool attach_gdb = should_attach_gdb(request); in worker_process()
590 ptrace_siblings(request.pid, request.tid, siblings); in worker_process()
594 std::unique_ptr<BacktraceMap> backtrace_map(BacktraceMap::Create(request.pid)); in worker_process()
598 if (request.action == DEBUGGER_ACTION_CRASH) { in worker_process()
613 succeeded = perform_dump(request, fd, tombstone_fd, backtrace_map.get(), siblings, in worker_process()
616 if (request.action == DEBUGGER_ACTION_DUMP_TOMBSTONE) { in worker_process()
625 if (!send_signal(request.pid, 0, SIGSTOP)) { in worker_process()
635 activity_manager_write(request.pid, crash_signal, amfd, *amfd_data.get()); in worker_process()
638 if (ptrace(PTRACE_DETACH, request.tid, 0, 0) != 0) { in worker_process()
639 ALOGE("debuggerd: ptrace detach from %d failed: %s", request.tid, strerror(errno)); in worker_process()
647 if (!attach_gdb && request.action == DEBUGGER_ACTION_CRASH) { in worker_process()
648 if (!send_signal(request.pid, request.tid, crash_signal)) { in worker_process()
649 ALOGE("debuggerd: failed to kill process %d: %s", request.pid, strerror(errno)); in worker_process()
655 wait_for_user_action(request); in worker_process()
658 activity_manager_write(request.pid, crash_signal, amfd, *amfd_data.get()); in worker_process()
661 if (!send_signal(request.pid, 0, SIGCONT)) { in worker_process()
662 ALOGE("debuggerd: failed to resume process %d: %s", request.pid, strerror(errno)); in worker_process()
673 static void monitor_worker_process(int child_pid, const debugger_request_t& request) { in monitor_worker_process() argument
675 if (should_attach_gdb(request)) { in monitor_worker_process()
734 if (kill_target && request.action == DEBUGGER_ACTION_CRASH) { in monitor_worker_process()
735 ALOGE("debuggerd: killing target %d", request.pid); in monitor_worker_process()
738 ALOGW("debuggerd: resuming target %d", request.pid); in monitor_worker_process()
741 if (kill(request.pid, exit_signal) != 0) { in monitor_worker_process()
755 debugger_request_t request; in handle_request() local
756 memset(&request, 0, sizeof(request)); in handle_request()
757 int status = read_request(fd, &request); in handle_request()
762 ALOGW("debuggerd: handling request: pid=%d uid=%d gid=%d tid=%d\n", request.pid, request.uid, in handle_request()
763 request.gid, request.tid); in handle_request()
769 if (is32bit(request.tid)) { in handle_request()
771 if (request.action == DEBUGGER_ACTION_DUMP_BACKTRACE || in handle_request()
772 request.action == DEBUGGER_ACTION_DUMP_TOMBSTONE) { in handle_request()
773 redirect_to_32(fd, &request); in handle_request()
775 ALOGE("debuggerd: Not allowed to redirect action %d to 32 bit debuggerd\n", request.action); in handle_request()
786 worker_process(fd, request); in handle_request()
788 monitor_worker_process(fork_pid, request); in handle_request()