Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4334b3b2 authored by Elliott Hughes's avatar Elliott Hughes Committed by android-build-merger
Browse files

Merge "Decode ptrace-induced SIGTRAP si_code values." am: 293936e4 am: a3cdfc93 am: 4982d2b1

am: 736a9464

Change-Id: Iabd11a98a11a90a2c94635fbb269857e9c3d3a40
parents e1700aea 736a9464
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -168,6 +168,26 @@ static const char* get_sigcode(int signo, int code) {
        case TRAP_BRANCH: return "TRAP_BRANCH";
        case TRAP_HWBKPT: return "TRAP_HWBKPT";
      }
      if ((code & 0xff) == SIGTRAP) {
        switch ((code >> 8) & 0xff) {
          case PTRACE_EVENT_FORK:
            return "PTRACE_EVENT_FORK";
          case PTRACE_EVENT_VFORK:
            return "PTRACE_EVENT_VFORK";
          case PTRACE_EVENT_CLONE:
            return "PTRACE_EVENT_CLONE";
          case PTRACE_EVENT_EXEC:
            return "PTRACE_EVENT_EXEC";
          case PTRACE_EVENT_VFORK_DONE:
            return "PTRACE_EVENT_VFORK_DONE";
          case PTRACE_EVENT_EXIT:
            return "PTRACE_EVENT_EXIT";
          case PTRACE_EVENT_SECCOMP:
            return "PTRACE_EVENT_SECCOMP";
          case PTRACE_EVENT_STOP:
            return "PTRACE_EVENT_STOP";
        }
      }
      static_assert(NSIGTRAP == TRAP_HWBKPT, "missing TRAP_* si_code");
      break;
  }