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

Commit dbf16972 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 4756844 from fe92dd09 to pi-release

Change-Id: I6f46fb4e0616da931822bc37a82e396cb4fb0716
parents e2047395 fe92dd09
Loading
Loading
Loading
Loading
+15 −11
Original line number Diff line number Diff line
@@ -190,6 +190,19 @@ static bool g_tombstoned_connected = false;
static unique_fd g_tombstoned_socket;
static unique_fd g_output_fd;

static void DefuseSignalHandlers() {
  // Don't try to dump ourselves.
  struct sigaction action = {};
  action.sa_handler = SIG_DFL;
  debuggerd_register_handlers(&action);

  sigset_t mask;
  sigemptyset(&mask);
  if (sigprocmask(SIG_SETMASK, &mask, nullptr) != 0) {
    PLOG(FATAL) << "failed to set signal mask";
  }
}

static void Initialize(char** argv) {
  android::base::InitLogging(argv);
  android::base::SetAborter([](const char* abort_msg) {
@@ -213,17 +226,6 @@ static void Initialize(char** argv) {

    _exit(1);
  });

  // Don't try to dump ourselves.
  struct sigaction action = {};
  action.sa_handler = SIG_DFL;
  debuggerd_register_handlers(&action);

  sigset_t mask;
  sigemptyset(&mask);
  if (sigprocmask(SIG_SETMASK, &mask, nullptr) != 0) {
    PLOG(FATAL) << "failed to set signal mask";
  }
}

static void ParseArgs(int argc, char** argv, pid_t* pseudothread_tid, DebuggerdDumpType* dump_type) {
@@ -321,6 +323,8 @@ static pid_t wait_for_vm_process(pid_t pseudothread_tid) {
}

int main(int argc, char** argv) {
  DefuseSignalHandlers();

  atrace_begin(ATRACE_TAG, "before reparent");
  pid_t target_process = getppid();

+3 −1
Original line number Diff line number Diff line
@@ -418,8 +418,10 @@ static bool dump_thread(log_t* log, BacktraceMap* map, Memory* process_memory,

  dump_registers(log, thread_info.registers.get());

  // Unwind will mutate the registers, so make a copy first.
  std::unique_ptr<Regs> regs_copy(thread_info.registers->Clone());
  std::vector<backtrace_frame_data_t> frames;
  if (!Backtrace::Unwind(thread_info.registers.get(), map, &frames, 0, nullptr)) {
  if (!Backtrace::Unwind(regs_copy.get(), map, &frames, 0, nullptr)) {
    _LOG(log, logtype::THREAD, "Failed to unwind");
    return false;
  }
+1 −4
Original line number Diff line number Diff line
@@ -119,10 +119,7 @@ static bool inline IsRecoveryMode() {
FirstStageMount::FirstStageMount()
    : need_dm_verity_(false), device_tree_fstab_(fs_mgr_read_fstab_dt(), fs_mgr_free_fstab) {
    if (!device_tree_fstab_) {
        // The client of FirstStageMount should check the existence of fstab in device-tree
        // in advance, without parsing it. Reaching here means there is a FATAL error when
        // parsing the fstab. So stop here to expose the failure.
        LOG(FATAL) << "Failed to read fstab from device tree";
        LOG(INFO) << "Failed to read fstab from device tree";
        return;
    }
    // Stores device_tree_fstab_->recs[] into mount_fstab_recs_ (vector<fstab_rec*>)
+4 −0
Original line number Diff line number Diff line
@@ -197,4 +197,8 @@ bool RegsArm::StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_mem
  return true;
}

Regs* RegsArm::Clone() {
  return new RegsArm(*this);
}

}  // namespace unwindstack
+4 −0
Original line number Diff line number Diff line
@@ -148,4 +148,8 @@ bool RegsArm64::StepIfSignalHandler(uint64_t rel_pc, Elf* elf, Memory* process_m
  return true;
}

Regs* RegsArm64::Clone() {
  return new RegsArm64(*this);
}

}  // namespace unwindstack
Loading