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

Commit 1e1bae1b authored by Christopher Ferris's avatar Christopher Ferris Committed by Android Git Automerger
Browse files

am c2945850: Merge "Add some clarifying defines."

* commit 'c2945850':
  Add some clarifying defines.
parents f4b3b73e c2945850
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -23,6 +23,14 @@

__BEGIN_DECLS

// When the pid to be traced is set to this value, then trace the current
// process. If the tid value is not BACKTRACE_NO_TID, then the specified
// thread from the current process will be traced.
#define BACKTRACE_CURRENT_PROCESS -1
// When the tid to be traced is set to this value, then trace the specified
// pid.
#define BACKTRACE_NO_TID -1

#define MAX_BACKTRACE_FRAMES 64

typedef struct backtrace_map_info {
+3 −3
Original line number Diff line number Diff line
@@ -213,13 +213,13 @@ bool BacktracePtrace::ReadWord(uintptr_t ptr, uint32_t* out_value) {
}

Backtrace* Backtrace::Create(pid_t pid, pid_t tid) {
  if (pid < 0 || pid == getpid()) {
    if (tid < 0 || tid == gettid()) {
  if (pid == BACKTRACE_CURRENT_PROCESS || pid == getpid()) {
    if (tid == BACKTRACE_NO_TID || tid == gettid()) {
      return CreateCurrentObj();
    } else {
      return CreateThreadObj(tid);
    }
  } else if (tid < 0) {
  } else if (tid == BACKTRACE_NO_TID) {
    return CreatePtraceObj(pid, pid);
  } else {
    return CreatePtraceObj(pid, tid);