Revert "[Berberis][CrashReporting] Dump guest thread info to tom..."
Revert submission 3062926
Reason for revert: We want guest state to be present in all threads - revert to be able to fix the proto field type.
Reverted changes: /q/submissionid:3062926
Change-Id: I87b282a0d9caebe4eae2e7d8eca8ec8ebaa3eca6
diff --git a/debuggerd/crash_dump.cpp b/debuggerd/crash_dump.cpp
index 4640aeb..bc00c86 100644
--- a/debuggerd/crash_dump.cpp
+++ b/debuggerd/crash_dump.cpp
@@ -30,7 +30,6 @@
#include <map>
#include <memory>
#include <set>
-#include <string>
#include <vector>
#include <android-base/errno_restorer.h>
@@ -82,10 +81,6 @@
using android::base::StringPrintf;
using android::base::unique_fd;
-// This stores guest architecture. When the architecture is supported, tombstone file will output
-// guest state information.
-static Architecture g_guest_arch;
-
static bool pid_contains_tid(int pid_proc_fd, pid_t tid) {
struct stat st;
std::string task_path = StringPrintf("task/%d", tid);
@@ -495,8 +490,6 @@
arm_user_regs.regs[i] = guest_regs.regs_arm.r[i];
}
regs->reset(unwindstack::RegsArm::Read(&arm_user_regs));
-
- g_guest_arch = Architecture::ARM32;
break;
}
#if defined(__LP64__)
@@ -508,8 +501,6 @@
arm64_user_regs.sp = guest_regs.regs_arm64.sp;
arm64_user_regs.pc = guest_regs.regs_arm64.ip;
regs->reset(unwindstack::RegsArm64::Read(&arm64_user_regs));
-
- g_guest_arch = Architecture::ARM64;
break;
}
case NATIVE_BRIDGE_ARCH_RISCV64: {
@@ -520,8 +511,6 @@
riscv64_user_regs.regs[i] = guest_regs.regs_riscv64.x[i];
}
regs->reset(unwindstack::RegsRiscv64::Read(&riscv64_user_regs, tid));
-
- g_guest_arch = Architecture::RISCV64;
break;
}
#endif
@@ -786,32 +775,8 @@
{
ATRACE_NAME("engrave_tombstone");
- unwindstack::ArchEnum regs_arch = unwindstack::ARCH_UNKNOWN;
- switch (g_guest_arch) {
- case Architecture::ARM32: {
- regs_arch = unwindstack::ARCH_ARM;
- break;
- }
- case Architecture::ARM64: {
- regs_arch = unwindstack::ARCH_ARM64;
- break;
- }
- case Architecture::RISCV64: {
- regs_arch = unwindstack::ARCH_RISCV64;
- break;
- }
- default: {
- }
- }
- if (regs_arch == unwindstack::ARCH_UNKNOWN) {
- engrave_tombstone(std::move(g_output_fd), std::move(g_proto_fd), &unwinder, thread_info,
- g_target_thread, process_info, &open_files, &amfd_data);
- } else {
- unwindstack::AndroidRemoteUnwinder guest_unwinder(vm_pid, regs_arch);
- engrave_tombstone(std::move(g_output_fd), std::move(g_proto_fd), &unwinder, thread_info,
- g_target_thread, process_info, &open_files, &amfd_data, &g_guest_arch,
- &guest_unwinder);
- }
+ engrave_tombstone(std::move(g_output_fd), std::move(g_proto_fd), &unwinder, thread_info,
+ g_target_thread, process_info, &open_files, &amfd_data);
}
}