summaryrefslogtreecommitdiffstats
path: root/libbacktrace
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-12-11 17:44:33 -0800
committerChristopher Ferris <cferris@google.com>2018-01-29 10:41:11 -0800
commitc8bec5aa91b20b0173bf6bf5f73f9e6daa40519d (patch)
treecada46a2ee86c8c6c22d563b605a5120caff0426 /libbacktrace
parent8abe4e2638587957f621450b4e4c3ff7af310b08 (diff)
downloadsystem_core-c8bec5aa91b20b0173bf6bf5f73f9e6daa40519d.tar.gz
system_core-c8bec5aa91b20b0173bf6bf5f73f9e6daa40519d.tar.bz2
system_core-c8bec5aa91b20b0173bf6bf5f73f9e6daa40519d.zip
Use new unwinder for offline in libbacktrace.
libbbacktrace changes: - Completely rewrite the BacktraceOffline class to use the new unwinder. - Modify the test data to save ucontext_t data instead of unw_context data. - Convert the previous tests from unw_context data to ucontext_t data. Bug: 65682279 Test: New unit tests pass in libunwindstack. Test: All offline tests continue to pass. Change-Id: I540345c304b20199d46deeb0349a0638a0f3ab2f
Diffstat (limited to 'libbacktrace')
-rw-r--r--libbacktrace/Android.bp55
-rw-r--r--libbacktrace/Backtrace.cpp4
-rw-r--r--libbacktrace/BacktraceCurrent.cpp2
-rw-r--r--libbacktrace/BacktraceCurrent.h5
-rw-r--r--libbacktrace/BacktraceMap.cpp10
-rw-r--r--libbacktrace/BacktraceOffline.cpp1145
-rw-r--r--libbacktrace/BacktraceOffline.h90
-rw-r--r--libbacktrace/UnwindStack.cpp113
-rw-r--r--libbacktrace/UnwindStack.h22
-rw-r--r--libbacktrace/UnwindStackMap.cpp50
-rw-r--r--libbacktrace/UnwindStackMap.h12
-rw-r--r--libbacktrace/backtrace_offline_test.cpp203
-rw-r--r--libbacktrace/backtrace_test.cpp84
-rw-r--r--libbacktrace/backtrace_testlib.cpp67
-rw-r--r--libbacktrace/backtrace_testlib.h4
-rw-r--r--libbacktrace/include/backtrace/Backtrace.h39
-rw-r--r--libbacktrace/include/backtrace/BacktraceMap.h6
-rw-r--r--libbacktrace/testdata/arm/offline_testdata2
-rw-r--r--libbacktrace/testdata/arm/offline_testdata_for_libGLESv2_adreno4
-rw-r--r--libbacktrace/testdata/arm/offline_testdata_for_libandroid_runtime4
-rw-r--r--libbacktrace/testdata/arm/offline_testdata_for_libart2
-rw-r--r--libbacktrace/testdata/arm64/offline_testdata2
-rw-r--r--libbacktrace/testdata/arm64/offline_testdata_for_eglSubDriverAndroid4
-rw-r--r--libbacktrace/testdata/arm64/offline_testdata_for_libskia4
-rw-r--r--libbacktrace/testdata/x86/offline_testdata2
-rw-r--r--libbacktrace/testdata/x86_64/offline_testdata2
26 files changed, 424 insertions, 1513 deletions
diff --git a/libbacktrace/Android.bp b/libbacktrace/Android.bp
index 94b193594..14ae44564 100644
--- a/libbacktrace/Android.bp
+++ b/libbacktrace/Android.bp
@@ -128,39 +128,8 @@ cc_library_shared {
cflags: ["-O0"],
srcs: ["backtrace_testlib.cpp"],
- target: {
- linux: {
- shared_libs: [
- "libunwind",
- "libunwindstack",
- ],
- },
- }
-}
-
-//-------------------------------------------------------------------------
-// The libbacktrace_offline static library.
-//-------------------------------------------------------------------------
-cc_library_static {
- name: "libbacktrace_offline",
- defaults: ["libbacktrace_common"],
- host_supported: true,
- srcs: ["BacktraceOffline.cpp"],
-
- cflags: [
- "-D__STDC_CONSTANT_MACROS",
- "-D__STDC_LIMIT_MACROS",
- "-D__STDC_FORMAT_MACROS",
- ],
-
- header_libs: ["llvm-headers"],
-
- // Use shared libraries so their headers get included during build.
- shared_libs = [
- "libbase",
- "libunwind",
- "libunwindstack",
- "libziparchive",
+ shared_libs: [
+ "libunwindstack",
],
}
@@ -193,28 +162,11 @@ cc_test {
"libbase",
"libcutils",
"liblog",
- "libunwind",
"libunwindstack",
],
group_static_libs: true,
- // Statically link LLVMlibraries to remove dependency on llvm shared library.
- static_libs = [
- "libbacktrace_offline",
- "libLLVMObject",
- "libLLVMBitReader",
- "libLLVMMC",
- "libLLVMMCParser",
- "libLLVMCore",
- "libLLVMSupport",
-
- "libziparchive",
- "libz",
- ],
-
- header_libs: ["llvm-headers"],
-
target: {
android: {
cflags: ["-DENABLE_PSS_TESTS"],
@@ -223,9 +175,6 @@ cc_test {
],
},
linux_glibc: {
- host_ldlibs: [
- "-lncurses",
- ],
static_libs: ["libutils"],
},
},
diff --git a/libbacktrace/Backtrace.cpp b/libbacktrace/Backtrace.cpp
index 1195e5f26..dec241c3c 100644
--- a/libbacktrace/Backtrace.cpp
+++ b/libbacktrace/Backtrace.cpp
@@ -168,5 +168,9 @@ std::string Backtrace::GetErrorString(BacktraceUnwindError error) {
return "Failed to find a function in debug sections";
case BACKTRACE_UNWIND_ERROR_EXECUTE_DWARF_INSTRUCTION_FAILED:
return "Failed to execute dwarf instructions in debug sections";
+ case BACKTRACE_UNWIND_ERROR_UNWIND_INFO:
+ return "Failed to unwind due to invalid unwind information";
+ case BACKTRACE_UNWIND_ERROR_REPEATED_FRAME:
+ return "Failed to unwind due to same sp/pc repeating";
}
}
diff --git a/libbacktrace/BacktraceCurrent.cpp b/libbacktrace/BacktraceCurrent.cpp
index d61b28147..f6f4423a1 100644
--- a/libbacktrace/BacktraceCurrent.cpp
+++ b/libbacktrace/BacktraceCurrent.cpp
@@ -64,7 +64,7 @@ size_t BacktraceCurrent::Read(uint64_t addr, uint8_t* buffer, size_t bytes) {
return bytes;
}
-bool BacktraceCurrent::Unwind(size_t num_ignore_frames, ucontext_t* ucontext) {
+bool BacktraceCurrent::Unwind(size_t num_ignore_frames, void* ucontext) {
if (GetMap() == nullptr) {
// Without a map object, we can't do anything.
error_.error_code = BACKTRACE_UNWIND_ERROR_MAP_MISSING;
diff --git a/libbacktrace/BacktraceCurrent.h b/libbacktrace/BacktraceCurrent.h
index 60a9117a9..48c14eaf3 100644
--- a/libbacktrace/BacktraceCurrent.h
+++ b/libbacktrace/BacktraceCurrent.h
@@ -19,7 +19,6 @@
#include <stdint.h>
#include <sys/types.h>
-#include <ucontext.h>
#include <backtrace/Backtrace.h>
@@ -44,7 +43,7 @@ class BacktraceCurrent : public Backtrace {
bool ReadWord(uint64_t ptr, word_t* out_value) override;
- bool Unwind(size_t num_ignore_frames, ucontext_t* ucontext) override;
+ bool Unwind(size_t num_ignore_frames, void* ucontext) override;
protected:
bool DiscardFrame(const backtrace_frame_data_t& frame);
@@ -52,7 +51,7 @@ class BacktraceCurrent : public Backtrace {
private:
bool UnwindThread(size_t num_ignore_frames);
- virtual bool UnwindFromContext(size_t num_ignore_frames, ucontext_t* ucontext) = 0;
+ virtual bool UnwindFromContext(size_t num_ignore_frames, void* ucontext) = 0;
};
#endif // _LIBBACKTRACE_BACKTRACE_CURRENT_H
diff --git a/libbacktrace/BacktraceMap.cpp b/libbacktrace/BacktraceMap.cpp
index 2a657b85e..c8a500cee 100644
--- a/libbacktrace/BacktraceMap.cpp
+++ b/libbacktrace/BacktraceMap.cpp
@@ -146,13 +146,3 @@ BacktraceMap* BacktraceMap::Create(pid_t pid, bool /*uncached*/) {
return map;
}
#endif
-
-BacktraceMap* BacktraceMap::Create(pid_t pid, const std::vector<backtrace_map_t>& maps) {
- BacktraceMap* backtrace_map = new BacktraceMap(pid);
- backtrace_map->maps_.insert(backtrace_map->maps_.begin(), maps.begin(), maps.end());
- std::sort(backtrace_map->maps_.begin(), backtrace_map->maps_.end(),
- [](const backtrace_map_t& map1, const backtrace_map_t& map2) {
- return map1.start < map2.start;
- });
- return backtrace_map;
-}
diff --git a/libbacktrace/BacktraceOffline.cpp b/libbacktrace/BacktraceOffline.cpp
deleted file mode 100644
index a05671651..000000000
--- a/libbacktrace/BacktraceOffline.cpp
+++ /dev/null
@@ -1,1145 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "BacktraceOffline.h"
-
-extern "C" {
-#define UNW_REMOTE_ONLY
-#include <dwarf.h>
-}
-
-#include <pthread.h>
-#include <stdint.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <ucontext.h>
-#include <unistd.h>
-
-#include <memory>
-#include <mutex>
-#include <string>
-#include <vector>
-
-#include <android-base/file.h>
-#include <android-base/macros.h>
-#include <backtrace/Backtrace.h>
-#include <backtrace/BacktraceMap.h>
-#include <ziparchive/zip_archive.h>
-
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-parameter"
-
-#include <llvm/ADT/StringRef.h>
-#include <llvm/Object/Binary.h>
-#include <llvm/Object/ELFObjectFile.h>
-#include <llvm/Object/ObjectFile.h>
-
-#pragma clang diagnostic pop
-
-#include "BacktraceLog.h"
-
-struct EhFrame {
- uint64_t hdr_vaddr;
- uint64_t vaddr;
- uint64_t fde_table_offset;
- uint64_t min_func_vaddr;
- std::vector<uint8_t> hdr_data;
- std::vector<uint8_t> data;
-};
-
-struct ArmIdxEntry {
- uint32_t func_offset;
- uint32_t value;
-};
-
-struct ArmExidx {
- uint64_t exidx_vaddr;
- uint64_t extab_vaddr;
- std::vector<ArmIdxEntry> exidx_data;
- std::vector<uint8_t> extab_data;
- // There is a one-to-one map from exidx_data.func_offset to func_vaddr_array.
- std::vector<uint32_t> func_vaddr_array;
-};
-
-struct DebugFrameInfo {
- bool has_arm_exidx;
- bool has_eh_frame;
- bool has_debug_frame;
- bool has_gnu_debugdata;
-
- EhFrame eh_frame;
- ArmExidx arm_exidx;
-
- uint64_t min_vaddr;
- uint64_t text_end_vaddr;
-
- DebugFrameInfo() : has_arm_exidx(false), has_eh_frame(false),
- has_debug_frame(false), has_gnu_debugdata(false) { }
-};
-
-void Space::Clear() {
- start = 0;
- end = 0;
- data = nullptr;
-}
-
-size_t Space::Read(uint64_t addr, uint8_t* buffer, size_t size) {
- if (addr >= start && addr < end) {
- size_t read_size = std::min(size, static_cast<size_t>(end - addr));
- memcpy(buffer, data + (addr - start), read_size);
- return read_size;
- }
- return 0;
-}
-
-static int FindProcInfo(unw_addr_space_t addr_space, unw_word_t ip, unw_proc_info* proc_info,
- int need_unwind_info, void* arg) {
- BacktraceOffline* backtrace = reinterpret_cast<BacktraceOffline*>(arg);
- bool result = backtrace->FindProcInfo(addr_space, ip, proc_info, need_unwind_info);
- return result ? 0 : -UNW_EINVAL;
-}
-
-static void PutUnwindInfo(unw_addr_space_t, unw_proc_info_t*, void*) {
-}
-
-static int GetDynInfoListAddr(unw_addr_space_t, unw_word_t*, void*) {
- return -UNW_ENOINFO;
-}
-
-static int AccessMem(unw_addr_space_t, unw_word_t addr, unw_word_t* value, int write, void* arg) {
- if (write == 1) {
- return -UNW_EINVAL;
- }
- BacktraceOffline* backtrace = reinterpret_cast<BacktraceOffline*>(arg);
- *value = 0;
- size_t read_size = backtrace->Read(addr, reinterpret_cast<uint8_t*>(value), sizeof(unw_word_t));
- // Strictly we should check if read_size matches sizeof(unw_word_t), but it is possible in
- // .eh_frame_hdr that the section can end at a position not aligned in sizeof(unw_word_t), and
- // we should permit the read at the end of the section.
- return (read_size > 0u ? 0 : -UNW_EINVAL);
-}
-
-static int AccessReg(unw_addr_space_t, unw_regnum_t unwind_reg, unw_word_t* value, int write,
- void* arg) {
- if (write == 1) {
- return -UNW_EINVAL;
- }
- BacktraceOffline* backtrace = reinterpret_cast<BacktraceOffline*>(arg);
- uint64_t reg_value;
- bool result = backtrace->ReadReg(unwind_reg, &reg_value);
- if (result) {
- *value = static_cast<unw_word_t>(reg_value);
- }
- return result ? 0 : -UNW_EINVAL;
-}
-
-static int AccessFpReg(unw_addr_space_t, unw_regnum_t, unw_fpreg_t*, int, void*) {
- return -UNW_EINVAL;
-}
-
-static int Resume(unw_addr_space_t, unw_cursor_t*, void*) {
- return -UNW_EINVAL;
-}
-
-static int GetProcName(unw_addr_space_t, unw_word_t, char*, size_t, unw_word_t*, void*) {
- return -UNW_EINVAL;
-}
-
-static unw_accessors_t accessors = {
- .find_proc_info = FindProcInfo,
- .put_unwind_info = PutUnwindInfo,
- .get_dyn_info_list_addr = GetDynInfoListAddr,
- .access_mem = AccessMem,
- .access_reg = AccessReg,
- .access_fpreg = AccessFpReg,
- .resume = Resume,
- .get_proc_name = GetProcName,
-};
-
-bool BacktraceOffline::Unwind(size_t num_ignore_frames, ucontext_t* context) {
- if (context == nullptr) {
- BACK_LOGW("The context is needed for offline backtracing.");
- error_.error_code = BACKTRACE_UNWIND_ERROR_NO_CONTEXT;
- return false;
- }
- context_ = context;
- error_.error_code = BACKTRACE_UNWIND_NO_ERROR;
-
- unw_addr_space_t addr_space = unw_create_addr_space(&accessors, 0);
- unw_cursor_t cursor;
- int ret = unw_init_remote(&cursor, addr_space, this);
- if (ret != 0) {
- BACK_LOGW("unw_init_remote failed %d", ret);
- unw_destroy_addr_space(addr_space);
- error_.error_code = BACKTRACE_UNWIND_ERROR_SETUP_FAILED;
- return false;
- }
- size_t num_frames = 0;
- while (true) {
- unw_word_t pc;
- ret = unw_get_reg(&cursor, UNW_REG_IP, &pc);
- if (ret < 0) {
- BACK_LOGW("Failed to read IP %d", ret);
- error_.error_code = BACKTRACE_UNWIND_ERROR_ACCESS_REG_FAILED;
- error_.error_info.regno = UNW_REG_IP;
- break;
- }
- unw_word_t sp;
- ret = unw_get_reg(&cursor, UNW_REG_SP, &sp);
- if (ret < 0) {
- BACK_LOGW("Failed to read SP %d", ret);
- error_.error_code = BACKTRACE_UNWIND_ERROR_ACCESS_REG_FAILED;
- error_.error_info.regno = UNW_REG_SP;
- break;
- }
-
- if (num_ignore_frames == 0) {
- backtrace_map_t map;
- FillInMap(pc, &map);
- if (map.start == 0 || (map.flags & PROT_EXEC) == 0) {
- // .eh_frame and .ARM.exidx doesn't know how to unwind from instructions setting up or
- // destroying stack frames. It can lead to wrong callchains, which may contain pcs outside
- // executable mapping areas. Stop unwinding once this is detected.
- error_.error_code = BACKTRACE_UNWIND_ERROR_MAP_MISSING;
- break;
- }
- frames_.resize(num_frames + 1);
- backtrace_frame_data_t* frame = &frames_[num_frames];
- frame->num = num_frames;
- frame->pc = static_cast<uint64_t>(pc);
- frame->sp = static_cast<uint64_t>(sp);
- frame->stack_size = 0;
-
- if (num_frames > 0) {
- backtrace_frame_data_t* prev = &frames_[num_frames - 1];
- prev->stack_size = frame->sp - prev->sp;
- }
- frame->func_name = GetFunctionName(frame->pc, &frame->func_offset);
- frame->map = map;
- num_frames++;
- } else {
- num_ignore_frames--;
- }
- is_debug_frame_used_ = false;
- ret = unw_step(&cursor);
- if (ret <= 0) {
- if (error_.error_code == BACKTRACE_UNWIND_NO_ERROR) {
- error_.error_code = BACKTRACE_UNWIND_ERROR_EXECUTE_DWARF_INSTRUCTION_FAILED;
- }
- break;
- }
- if (num_frames == MAX_BACKTRACE_FRAMES) {
- error_.error_code = BACKTRACE_UNWIND_ERROR_EXCEED_MAX_FRAMES_LIMIT;
- break;
- }
- }
- unw_destroy_addr_space(addr_space);
- context_ = nullptr;
- return true;
-}
-
-bool BacktraceOffline::ReadWord(uint64_t ptr, word_t* out_value) {
- size_t bytes_read = Read(ptr, reinterpret_cast<uint8_t*>(out_value), sizeof(word_t));
- return bytes_read == sizeof(word_t);
-}
-
-size_t BacktraceOffline::Read(uint64_t addr, uint8_t* buffer, size_t bytes) {
- // Normally, libunwind needs stack information and call frame information to do remote unwinding.
- // If call frame information is stored in .debug_frame, libunwind can read it from file
- // by itself. If call frame information is stored in .eh_frame, we need to provide data in
- // .eh_frame/.eh_frame_hdr sections.
- // The order of readings below doesn't matter, as the spaces don't overlap with each other.
- size_t read_size = eh_frame_hdr_space_.Read(addr, buffer, bytes);
- if (read_size != 0) {
- return read_size;
- }
- read_size = eh_frame_space_.Read(addr, buffer, bytes);
- if (read_size != 0) {
- return read_size;
- }
- read_size = arm_exidx_space_.Read(addr, buffer, bytes);
- if (read_size != 0) {
- return read_size;
- }
- read_size = arm_extab_space_.Read(addr, buffer, bytes);
- if (read_size != 0) {
- return read_size;
- }
- read_size = stack_space_.Read(addr, buffer, bytes);
- if (read_size != 0) {
- return read_size;
- }
- // In some libraries (like /system/lib64/libskia.so), some CIE entries in .eh_frame use
- // augmentation "P", which makes libunwind/libunwindstack try to read personality routine in
- // memory. However, that is not available in offline unwinding. Work around this by returning
- // all zero data.
- error_.error_code = BACKTRACE_UNWIND_ERROR_ACCESS_MEM_FAILED;
- error_.error_info.addr = addr;
- memset(buffer, 0, bytes);
- return bytes;
-}
-
-bool BacktraceOffline::FindProcInfo(unw_addr_space_t addr_space, uint64_t ip,
- unw_proc_info_t* proc_info, int need_unwind_info) {
- backtrace_map_t map;
- FillInMap(ip, &map);
- if (!BacktraceMap::IsValid(map)) {
- error_.error_code = BACKTRACE_UNWIND_ERROR_FIND_PROC_INFO_FAILED;
- return false;
- }
- const std::string& filename = map.name;
- DebugFrameInfo* debug_frame = GetDebugFrameInFile(filename);
- if (debug_frame == nullptr) {
- error_.error_code = BACKTRACE_UNWIND_ERROR_FIND_PROC_INFO_FAILED;
- return false;
- }
- // Each FindProcInfo() is a new attempt to unwind, so reset the reason.
- error_.error_code = BACKTRACE_UNWIND_NO_ERROR;
-
- eh_frame_hdr_space_.Clear();
- eh_frame_space_.Clear();
- arm_exidx_space_.Clear();
- arm_extab_space_.Clear();
-
- // vaddr in the elf file.
- uint64_t ip_vaddr = ip - map.start + debug_frame->min_vaddr;
-
- // The unwind info can come from .ARM.exidx or .eh_frame, or .debug_frame/.gnu_debugdata.
- // First check .eh_frame/.debug_frame, then check .ARM.exidx. Because .eh_frame/.debug_frame has
- // function range for each entry, by matching ip address with the function range, we know exactly
- // whether the ip address hits an entry. But .ARM.exidx doesn't have function range for each
- // entry, it thinks that an ip address hits an entry when (entry.addr <= ip < next_entry.addr).
- // To prevent ip addresses hit in .eh_frame/.debug_frame being regarded as addresses hit in
- // .ARM.exidx, we need to check .eh_frame/.debug_frame first.
-
- // Check .debug_frame/.gnu_debugdata before .eh_frame, because .debug_frame can unwind from
- // instructions setting up or destroying stack frames, while .eh_frame can't.
- if (!is_debug_frame_used_ && (debug_frame->has_debug_frame || debug_frame->has_gnu_debugdata)) {
- is_debug_frame_used_ = true;
- unw_dyn_info_t di;
- unw_word_t segbase = map.start - debug_frame->min_vaddr;
- // TODO: http://b/32916571
- // TODO: Do it ourselves is more efficient than calling libunwind functions.
- int found = dwarf_find_debug_frame(0, &di, ip, segbase, filename.c_str(), map.start, map.end);
- if (found == 1) {
- int ret = dwarf_search_unwind_table(addr_space, ip, &di, proc_info, need_unwind_info, this);
- if (ret == 0) {
- return true;
- }
- }
- }
- if (debug_frame->has_eh_frame) {
- if (ip_vaddr >= debug_frame->eh_frame.min_func_vaddr &&
- ip_vaddr < debug_frame->text_end_vaddr) {
- // Prepare eh_frame_hdr space and eh_frame space.
- eh_frame_hdr_space_.start = ip - ip_vaddr + debug_frame->eh_frame.hdr_vaddr;
- eh_frame_hdr_space_.end =
- eh_frame_hdr_space_.start + debug_frame->eh_frame.hdr_data.size();
- eh_frame_hdr_space_.data = debug_frame->eh_frame.hdr_data.data();
- eh_frame_space_.start = ip - ip_vaddr + debug_frame->eh_frame.vaddr;
- eh_frame_space_.end = eh_frame_space_.start + debug_frame->eh_frame.data.size();
- eh_frame_space_.data = debug_frame->eh_frame.data.data();
-
- unw_dyn_info di;
- memset(&di, '\0', sizeof(di));
- di.start_ip = map.start;
- di.end_ip = map.end;
- di.format = UNW_INFO_FORMAT_REMOTE_TABLE;
- di.u.rti.name_ptr = 0;
- di.u.rti.segbase = eh_frame_hdr_space_.start;
- di.u.rti.table_data =
- eh_frame_hdr_space_.start + debug_frame->eh_frame.fde_table_offset;
- di.u.rti.table_len = (eh_frame_hdr_space_.end - di.u.rti.table_data) / sizeof(unw_word_t);
- // TODO: Do it ourselves is more efficient than calling this function.
- int ret = dwarf_search_unwind_table(addr_space, ip, &di, proc_info, need_unwind_info, this);
- if (ret == 0) {
- return true;
- }
- }
- }
-
- if (debug_frame->has_arm_exidx) {
- auto& func_vaddrs = debug_frame->arm_exidx.func_vaddr_array;
- if (ip_vaddr >= func_vaddrs[0] && ip_vaddr < debug_frame->text_end_vaddr) {
- // Use binary search to find the correct function.
- auto it = std::upper_bound(func_vaddrs.begin(), func_vaddrs.end(),
- static_cast<uint32_t>(ip_vaddr));
- if (it != func_vaddrs.begin()) {
- --it;
- // Found the exidx entry.
- size_t index = it - func_vaddrs.begin();
- proc_info->start_ip = *it;
- proc_info->format = UNW_INFO_FORMAT_ARM_EXIDX;
- proc_info->unwind_info = reinterpret_cast<void*>(
- static_cast<uint64_t>(index * sizeof(ArmIdxEntry) + debug_frame->arm_exidx.exidx_vaddr +
- debug_frame->min_vaddr));
- eh_frame_hdr_space_.Clear();
- eh_frame_space_.Clear();
- // Prepare arm_exidx space and arm_extab space.
- arm_exidx_space_.start = debug_frame->min_vaddr + debug_frame->arm_exidx.exidx_vaddr;
- arm_exidx_space_.end = arm_exidx_space_.start +
- debug_frame->arm_exidx.exidx_data.size() * sizeof(ArmIdxEntry);
- arm_exidx_space_.data = reinterpret_cast<const uint8_t*>(
- debug_frame->arm_exidx.exidx_data.data());
-
- arm_extab_space_.start = debug_frame->min_vaddr + debug_frame->arm_exidx.extab_vaddr;
- arm_extab_space_.end = arm_extab_space_.start +
- debug_frame->arm_exidx.extab_data.size();
- arm_extab_space_.data = debug_frame->arm_exidx.extab_data.data();
- return true;
- }
- }
- }
- error_.error_code = BACKTRACE_UNWIND_ERROR_FIND_PROC_INFO_FAILED;
- return false;
-}
-
-bool BacktraceOffline::ReadReg(size_t reg, uint64_t* value) {
- bool result = true;
-#if defined(__arm__)
- switch (reg) {
- case UNW_ARM_R0:
- *value = context_->uc_mcontext.arm_r0;
- break;
- case UNW_ARM_R1:
- *value = context_->uc_mcontext.arm_r1;
- break;
- case UNW_ARM_R2:
- *value = context_->uc_mcontext.arm_r2;
- break;
- case UNW_ARM_R3:
- *value = context_->uc_mcontext.arm_r3;
- break;
- case UNW_ARM_R4:
- *value = context_->uc_mcontext.arm_r4;
- break;
- case UNW_ARM_R5:
- *value = context_->uc_mcontext.arm_r5;
- break;
- case UNW_ARM_R6:
- *value = context_->uc_mcontext.arm_r6;
- break;
- case UNW_ARM_R7:
- *value = context_->uc_mcontext.arm_r7;
- break;
- case UNW_ARM_R8:
- *value = context_->uc_mcontext.arm_r8;
- break;
- case UNW_ARM_R9:
- *value = context_->uc_mcontext.arm_r9;
- break;
- case UNW_ARM_R10:
- *value = context_->uc_mcontext.arm_r10;
- break;
- case UNW_ARM_R11:
- *value = context_->uc_mcontext.arm_fp;
- break;
- case UNW_ARM_R12:
- *value = context_->uc_mcontext.arm_ip;
- break;
- case UNW_ARM_R13:
- *value = context_->uc_mcontext.arm_sp;
- break;
- case UNW_ARM_R14:
- *value = context_->uc_mcontext.arm_lr;
- break;
- case UNW_ARM_R15:
- *value = context_->uc_mcontext.arm_pc;
- break;
- default:
- result = false;
- }
-#elif defined(__aarch64__)
- if (reg <= UNW_AARCH64_PC) {
- *value = context_->uc_mcontext.regs[reg];
- } else {
- result = false;
- }
-#elif defined(__x86_64__)
- switch (reg) {
- case UNW_X86_64_R8:
- *value = context_->uc_mcontext.gregs[REG_R8];
- break;
- case UNW_X86_64_R9:
- *value = context_->uc_mcontext.gregs[REG_R9];
- break;
- case UNW_X86_64_R10:
- *value = context_->uc_mcontext.gregs[REG_R10];
- break;
- case UNW_X86_64_R11:
- *value = context_->uc_mcontext.gregs[REG_R11];
- break;
- case UNW_X86_64_R12:
- *value = context_->uc_mcontext.gregs[REG_R12];
- break;
- case UNW_X86_64_R13:
- *value = context_->uc_mcontext.gregs[REG_R13];
- break;
- case UNW_X86_64_R14:
- *value = context_->uc_mcontext.gregs[REG_R14];
- break;
- case UNW_X86_64_R15:
- *value = context_->uc_mcontext.gregs[REG_R15];
- break;
- case UNW_X86_64_RDI:
- *value = context_->uc_mcontext.gregs[REG_RDI];
- break;
- case UNW_X86_64_RSI:
- *value = context_->uc_mcontext.gregs[REG_RSI];
- break;
- case UNW_X86_64_RBP:
- *value = context_->uc_mcontext.gregs[REG_RBP];
- break;
- case UNW_X86_64_RBX:
- *value = context_->uc_mcontext.gregs[REG_RBX];
- break;
- case UNW_X86_64_RDX:
- *value = context_->uc_mcontext.gregs[REG_RDX];
- break;
- case UNW_X86_64_RAX:
- *value = context_->uc_mcontext.gregs[REG_RAX];
- break;
- case UNW_X86_64_RCX:
- *value = context_->uc_mcontext.gregs[REG_RCX];
- break;
- case UNW_X86_64_RSP:
- *value = context_->uc_mcontext.gregs[REG_RSP];
- break;
- case UNW_X86_64_RIP:
- *value = context_->uc_mcontext.gregs[REG_RIP];
- break;
- default:
- result = false;
- }
-#elif defined(__i386__)
- switch (reg) {
- case UNW_X86_GS:
- *value = context_->uc_mcontext.gregs[REG_GS];
- break;
- case UNW_X86_FS:
- *value = context_->uc_mcontext.gregs[REG_FS];
- break;
- case UNW_X86_ES:
- *value = context_->uc_mcontext.gregs[REG_ES];
- break;
- case UNW_X86_DS:
- *value = context_->uc_mcontext.gregs[REG_DS];
- break;
- case UNW_X86_EAX:
- *value = context_->uc_mcontext.gregs[REG_EAX];
- break;
- case UNW_X86_EBX:
- *value = context_->uc_mcontext.gregs[REG_EBX];
- break;
- case UNW_X86_ECX:
- *value = context_->uc_mcontext.gregs[REG_ECX];
- break;
- case UNW_X86_EDX:
- *value = context_->uc_mcontext.gregs[REG_EDX];
- break;
- case UNW_X86_ESI:
- *value = context_->uc_mcontext.gregs[REG_ESI];
- break;
- case UNW_X86_EDI:
- *value = context_->uc_mcontext.gregs[REG_EDI];
- break;
- case UNW_X86_EBP:
- *value = context_->uc_mcontext.gregs[REG_EBP];
- break;
- case UNW_X86_EIP:
- *value = context_->uc_mcontext.gregs[REG_EIP];
- break;
- case UNW_X86_ESP:
- *value = context_->uc_mcontext.gregs[REG_ESP];
- break;
- case UNW_X86_TRAPNO:
- *value = context_->uc_mcontext.gregs[REG_TRAPNO];
- break;
- case UNW_X86_CS:
- *value = context_->uc_mcontext.gregs[REG_CS];
- break;
- case UNW_X86_EFLAGS:
- *value = context_->uc_mcontext.gregs[REG_EFL];
- break;
- case UNW_X86_SS:
- *value = context_->uc_mcontext.gregs[REG_SS];
- break;
- default:
- result = false;
- }
-#else
- UNUSED(reg);
- UNUSED(value);
- result = false;
-#endif
- if (!result) {
- error_.error_code = BACKTRACE_UNWIND_ERROR_ACCESS_REG_FAILED;
- error_.error_info.regno = reg;
- }
- return result;
-}
-
-std::string BacktraceOffline::GetFunctionNameRaw(uint64_t, uint64_t* offset) {
- // We don't have enough information to support this. And it is expensive.
- *offset = 0;
- return "";
-}
-
-static std::mutex g_lock;
-static std::unordered_map<std::string, std::unique_ptr<DebugFrameInfo>>* g_debug_frames = nullptr;
-
-static DebugFrameInfo* ReadDebugFrameFromFile(const std::string& filename);
-
-DebugFrameInfo* BacktraceOffline::GetDebugFrameInFile(const std::string& filename) {
- if (cache_file_) {
- std::lock_guard<std::mutex> lock(g_lock);
- if (g_debug_frames != nullptr) {
- auto it = g_debug_frames->find(filename);
- if (it != g_debug_frames->end()) {
- return it->second.get();
- }
- }
- }
- DebugFrameInfo* debug_frame = ReadDebugFrameFromFile(filename);
- if (cache_file_) {
- std::lock_guard<std::mutex> lock(g_lock);
- if (g_debug_frames == nullptr) {
- g_debug_frames = new std::unordered_map<std::string, std::unique_ptr<DebugFrameInfo>>;
- }
- auto pair = g_debug_frames->emplace(filename, std::unique_ptr<DebugFrameInfo>(debug_frame));
- if (!pair.second) {
- debug_frame = pair.first->second.get();
- }
- }
- return debug_frame;
-}
-
-static bool OmitEncodedValue(uint8_t encode, const uint8_t*& p, bool is_elf64) {
- if (encode == DW_EH_PE_omit) {
- return 0;
- }
- uint8_t format = encode & 0x0f;
- switch (format) {
- case DW_EH_PE_ptr:
- p += is_elf64 ? 8 : 4;
- break;
- case DW_EH_PE_uleb128:
- case DW_EH_PE_sleb128:
- while ((*p & 0x80) != 0) {
- ++p;
- }
- ++p;
- break;
- case DW_EH_PE_udata2:
- case DW_EH_PE_sdata2:
- p += 2;
- break;
- case DW_EH_PE_udata4:
- case DW_EH_PE_sdata4:
- p += 4;
- break;
- case DW_EH_PE_udata8:
- case DW_EH_PE_sdata8:
- p += 8;
- break;
- default:
- return false;
- }
- return true;
-}
-
-static bool GetFdeTableOffsetInEhFrameHdr(const std::vector<uint8_t>& data,
- uint64_t* table_offset_in_eh_frame_hdr, bool is_elf64) {
- const uint8_t* p = data.data();
- const uint8_t* end = p + data.size();
- if (p + 4 > end) {
- return false;
- }
- uint8_t version = *p++;
- if (version != 1) {
- return false;
- }
- uint8_t eh_frame_ptr_encode = *p++;
- uint8_t fde_count_encode = *p++;
- uint8_t fde_table_encode = *p++;
-
- if (fde_table_encode != (DW_EH_PE_datarel | DW_EH_PE_sdata4)) {
- return false;
- }
-
- if (!OmitEncodedValue(eh_frame_ptr_encode, p, is_elf64) ||
- !OmitEncodedValue(fde_count_encode, p, is_elf64)) {
- return false;
- }
- if (p >= end) {
- return false;
- }
- *table_offset_in_eh_frame_hdr = p - data.data();
- return true;
-}
-
-static uint64_t ReadFromBuffer(const uint8_t*& p, size_t size) {
- uint64_t result = 0;
- int shift = 0;
- while (size-- > 0) {
- uint64_t tmp = *p++;
- result |= tmp << shift;
- shift += 8;
- }
- return result;
-}
-
-static uint64_t ReadSignValueFromBuffer(const uint8_t*& p, size_t size) {
- uint64_t result = 0;
- int shift = 0;
- for (size_t i = 0; i < size; ++i) {
- uint64_t tmp = *p++;
- result |= tmp << shift;
- shift += 8;
- }
- if (*(p - 1) & 0x80) {
- result |= (-1ULL) << (size * 8);
- }
- return result;
-}
-
-static const char* ReadStrFromBuffer(const uint8_t*& p) {
- const char* result = reinterpret_cast<const char*>(p);
- p += strlen(result) + 1;
- return result;
-}
-
-static int64_t ReadLEB128FromBuffer(const uint8_t*& p) {
- int64_t result = 0;
- int64_t tmp;
- int shift = 0;
- while (*p & 0x80) {
- tmp = *p & 0x7f;
- result |= tmp << shift;
- shift += 7;
- p++;
- }
- tmp = *p;
- result |= tmp << shift;
- if (*p & 0x40) {
- result |= -((tmp & 0x40) << shift);
- }
- p++;
- return result;
-}
-
-static uint64_t ReadULEB128FromBuffer(const uint8_t*& p) {
- uint64_t result = 0;
- uint64_t tmp;
- int shift = 0;
- while (*p & 0x80) {
- tmp = *p & 0x7f;
- result |= tmp << shift;
- shift += 7;
- p++;
- }
- tmp = *p;
- result |= tmp << shift;
- p++;
- return result;
-}
-
-static uint64_t ReadEhEncoding(const uint8_t*& p, uint8_t encoding, bool is_elf64,
- uint64_t section_vaddr, const uint8_t* section_begin) {
- const uint8_t* init_addr = p;
- uint64_t result = 0;
- switch (encoding & 0x0f) {
- case DW_EH_PE_absptr:
- result = ReadFromBuffer(p, is_elf64 ? 8 : 4);
- break;
- case DW_EH_PE_omit:
- result = 0;
- break;
- case DW_EH_PE_uleb128:
- result = ReadULEB128FromBuffer(p);
- break;
- case DW_EH_PE_udata2:
- result = ReadFromBuffer(p, 2);
- break;
- case DW_EH_PE_udata4:
- result = ReadFromBuffer(p, 4);
- break;
- case DW_EH_PE_udata8:
- result = ReadFromBuffer(p, 8);
- break;
- case DW_EH_PE_sleb128:
- result = ReadLEB128FromBuffer(p);
- break;
- case DW_EH_PE_sdata2:
- result = ReadSignValueFromBuffer(p, 2);
- break;
- case DW_EH_PE_sdata4:
- result = ReadSignValueFromBuffer(p, 4);
- break;
- case DW_EH_PE_sdata8:
- result = ReadSignValueFromBuffer(p, 8);
- break;
- }
- switch (encoding & 0xf0) {
- case DW_EH_PE_pcrel:
- result += init_addr - section_begin + section_vaddr;
- break;
- case DW_EH_PE_datarel:
- result += section_vaddr;
- break;
- }
- return result;
-}
-
-static bool BuildEhFrameHdr(DebugFrameInfo* info, bool is_elf64) {
- // For each fde entry, collect its (func_vaddr, fde_vaddr) pair.
- std::vector<std::pair<uint64_t, uint64_t>> index_table;
- // Map form cie_offset to fde encoding.
- std::unordered_map<size_t, uint8_t> cie_map;
- const uint8_t* eh_frame_begin = info->eh_frame.data.data();
- const uint8_t* eh_frame_end = eh_frame_begin + info->eh_frame.data.size();
- const uint8_t* p = eh_frame_begin;
- uint64_t eh_frame_vaddr = info->eh_frame.vaddr;
- while (p < eh_frame_end) {
- const uint8_t* unit_begin = p;
- uint64_t unit_len = ReadFromBuffer(p, 4);
- size_t secbytes = 4;
- if (unit_len == 0xffffffff) {
- unit_len = ReadFromBuffer(p, 8);
- secbytes = 8;
- }
- const uint8_t* unit_end = p + unit_len;
- uint64_t cie_id = ReadFromBuffer(p, secbytes);
- if (cie_id == 0) {
- // This is a CIE.
- // Read version
- uint8_t version = *p++;
- // Read augmentation
- const char* augmentation = ReadStrFromBuffer(p);
- if (version >= 4) {
- // Read address size and segment size
- p += 2;
- }
- // Read code alignment factor
- ReadULEB128FromBuffer(p);
- // Read data alignment factor
- ReadLEB128FromBuffer(p);
- // Read return address register
- if (version == 1) {
- p++;
- } else {
- ReadULEB128FromBuffer(p);
- }
- uint8_t fde_pointer_encoding = 0;
- if (augmentation[0] == 'z') {
- // Read augmentation length.
- ReadULEB128FromBuffer(p);
- for (int i = 1; augmentation[i] != '\0'; ++i) {
- char c = augmentation[i];
- if (c == 'R') {
- fde_pointer_encoding = *p++;
- } else if (c == 'P') {
- // Read personality handler
- uint8_t encoding = *p++;
- OmitEncodedValue(encoding, p, is_elf64);
- } else if (c == 'L') {
- // Read lsda encoding
- p++;
- }
- }
- }
- cie_map[unit_begin - eh_frame_begin] = fde_pointer_encoding;
- } else {
- // This is an FDE.
- size_t cie_offset = p - secbytes - eh_frame_begin - cie_id;
- auto it = cie_map.find(cie_offset);
- if (it != cie_map.end()) {
- uint8_t fde_pointer_encoding = it->second;
- uint64_t initial_location =
- ReadEhEncoding(p, fde_pointer_encoding, is_elf64, eh_frame_vaddr, eh_frame_begin);
- uint64_t fde_vaddr = unit_begin - eh_frame_begin + eh_frame_vaddr;
- index_table.push_back(std::make_pair(initial_location, fde_vaddr));
- }
- }
- p = unit_end;
- }
- if (index_table.empty()) {
- return false;
- }
- std::sort(index_table.begin(), index_table.end());
- info->eh_frame.hdr_vaddr = 0;
- info->eh_frame.hdr_data.resize(index_table.size() * 8);
- uint32_t* ptr = reinterpret_cast<uint32_t*>(info->eh_frame.hdr_data.data());
- for (auto& pair : index_table) {
- *ptr++ = static_cast<uint32_t>(pair.first - info->eh_frame.hdr_vaddr);
- *ptr++ = static_cast<uint32_t>(pair.second - info->eh_frame.hdr_vaddr);
- }
- info->eh_frame.fde_table_offset = 0;
- info->eh_frame.min_func_vaddr = index_table[0].first;
- return true;
-}
-
-template <class ELFT>
-DebugFrameInfo* ReadDebugFrameFromELFFile(const llvm::object::ELFFile<ELFT>* elf) {
- DebugFrameInfo* result = new DebugFrameInfo;
- result->eh_frame.hdr_vaddr = 0;
- result->text_end_vaddr = std::numeric_limits<uint64_t>::max();
-
- bool is_elf64 = (elf->getHeader()->getFileClass() == llvm::ELF::ELFCLASS64);
- bool has_eh_frame_hdr = false;
- bool has_eh_frame = false;
-
- for (auto it = elf->section_begin(); it != elf->section_end(); ++it) {
- llvm::ErrorOr<llvm::StringRef> name = elf->getSectionName(&*it);
- if (name) {
- std::string s = name.get();
- if (s == ".debug_frame") {
- result->has_debug_frame = true;
- } else if (s == ".gnu_debugdata") {
- result->has_gnu_debugdata = true;
- } else if (s == ".eh_frame_hdr") {
- result->eh_frame.hdr_vaddr = it->sh_addr;
- llvm::ErrorOr<llvm::ArrayRef<uint8_t>> data = elf->getSectionContents(&*it);
- if (data) {
- result->eh_frame.hdr_data.insert(result->eh_frame.hdr_data.end(),
- data->data(), data->data() + data->size());
-
- uint64_t fde_table_offset;
- if (GetFdeTableOffsetInEhFrameHdr(result->eh_frame.hdr_data, &fde_table_offset, is_elf64)) {
- result->eh_frame.fde_table_offset = fde_table_offset;
- // Make sure we have at least one entry in fde_table.
- if (fde_table_offset + 2 * sizeof(int32_t) <= data->size()) {
- intptr_t eh_frame_hdr_vaddr = it->sh_addr;
- int32_t sdata;
- uint8_t* p = result->eh_frame.hdr_data.data() + fde_table_offset;
- memcpy(&sdata, p, sizeof(sdata));
- result->eh_frame.min_func_vaddr = eh_frame_hdr_vaddr + sdata;
- has_eh_frame_hdr = true;
- }
- }
- }
- } else if (s == ".eh_frame") {
- result->eh_frame.vaddr = it->sh_addr;
- llvm::ErrorOr<llvm::ArrayRef<uint8_t>> data = elf->getSectionContents(&*it);
- if (data) {
- result->eh_frame.data.insert(result->eh_frame.data.end(),
- data->data(), data->data() + data->size());
- has_eh_frame = true;
- }
- } else if (s == ".ARM.exidx") {
- result->arm_exidx.exidx_vaddr = it->sh_addr;
- llvm::ErrorOr<llvm::ArrayRef<uint8_t>> data = elf->getSectionContents(&*it);
- if (data) {
- size_t entry_count = data->size() / sizeof(ArmIdxEntry);
- result->arm_exidx.exidx_data.resize(entry_count);
- memcpy(result->arm_exidx.exidx_data.data(), data->data(),
- entry_count * sizeof(ArmIdxEntry));
- if (entry_count > 0u) {
- // Change IdxEntry.func_offset into vaddr.
- result->arm_exidx.func_vaddr_array.reserve(entry_count);
- uint32_t vaddr = it->sh_addr;
- for (auto& entry : result->arm_exidx.exidx_data) {
- uint32_t func_offset = entry.func_offset + vaddr;
- // Clear bit 31 for the prel31 offset.
- // Arm sets bit 0 to mark it as thumb code, remove the flag.
- result->arm_exidx.func_vaddr_array.push_back(
- func_offset & 0x7ffffffe);
- vaddr += 8;
- }
- result->has_arm_exidx = true;
- }
- }
- } else if (s == ".ARM.extab") {
- result->arm_exidx.extab_vaddr = it->sh_addr;
- llvm::ErrorOr<llvm::ArrayRef<uint8_t>> data = elf->getSectionContents(&*it);
- if (data) {
- result->arm_exidx.extab_data.insert(result->arm_exidx.extab_data.end(),
- data->data(), data->data() + data->size());
- }
- } else if (s == ".text") {
- result->text_end_vaddr = it->sh_addr + it->sh_size;
- }
- }
- }
-
- if (has_eh_frame) {
- if (!has_eh_frame_hdr) {
- // Some libraries (like /vendor/lib64/egl/eglSubDriverAndroid.so) contain empty
- // .eh_frame_hdr.
- if (BuildEhFrameHdr(result, is_elf64)) {
- has_eh_frame_hdr = true;
- }
- }
- if (has_eh_frame_hdr) {
- result->has_eh_frame = true;
- }
- }
- if (has_eh_frame_hdr && has_eh_frame) {
- result->has_eh_frame = true;
- }
-
- result->min_vaddr = std::numeric_limits<uint64_t>::max();
- for (auto it = elf->program_header_begin(); it != elf->program_header_end(); ++it) {
- if ((it->p_type == llvm::ELF::PT_LOAD) && (it->p_flags & llvm::ELF::PF_X)) {
- if (it->p_vaddr < result->min_vaddr) {
- result->min_vaddr = it->p_vaddr;
- }
- }
- }
- if (!result->has_eh_frame && !result->has_arm_exidx && !result->has_debug_frame &&
- !result->has_gnu_debugdata) {
- delete result;
- return nullptr;
- }
- return result;
-}
-
-static bool IsValidElfPath(const std::string& filename) {
- static const char elf_magic[] = {0x7f, 'E', 'L', 'F'};
-
- struct stat st;
- if (stat(filename.c_str(), &st) != 0 || !S_ISREG(st.st_mode)) {
- return false;
- }
- FILE* fp = fopen(filename.c_str(), "reb");
- if (fp == nullptr) {
- return false;
- }
- char buf[4];
- if (fread(buf, 4, 1, fp) != 1) {
- fclose(fp);
- return false;
- }
- fclose(fp);
- return memcmp(buf, elf_magic, 4) == 0;
-}
-
-static bool IsValidApkPath(const std::string& apk_path) {
- static const char zip_preamble[] = {0x50, 0x4b, 0x03, 0x04};
- struct stat st;
- if (stat(apk_path.c_str(), &st) != 0 || !S_ISREG(st.st_mode)) {
- return false;
- }
- FILE* fp = fopen(apk_path.c_str(), "reb");
- if (fp == nullptr) {
- return false;
- }
- char buf[4];
- if (fread(buf, 4, 1, fp) != 1) {
- fclose(fp);
- return false;
- }
- fclose(fp);
- return memcmp(buf, zip_preamble, 4) == 0;
-}
-
-class ScopedZiparchiveHandle {
- public:
- explicit ScopedZiparchiveHandle(ZipArchiveHandle handle) : handle_(handle) {
- }
-
- ~ScopedZiparchiveHandle() {
- CloseArchive(handle_);
- }
-
- private:
- ZipArchiveHandle handle_;
-};
-
-llvm::object::OwningBinary<llvm::object::Binary> OpenEmbeddedElfFile(const std::string& filename) {
- llvm::object::OwningBinary<llvm::object::Binary> nothing;
- size_t pos = filename.find("!/");
- if (pos == std::string::npos) {
- return nothing;
- }
- std::string apk_file = filename.substr(0, pos);
- std::string elf_file = filename.substr(pos + 2);
- if (!IsValidApkPath(apk_file)) {
- BACK_LOGW("%s is not a valid apk file", apk_file.c_str());
- return nothing;
- }
- ZipArchiveHandle handle;
- int32_t ret_code = OpenArchive(apk_file.c_str(), &handle);
- if (ret_code != 0) {
- CloseArchive(handle);
- BACK_LOGW("failed to open archive %s: %s", apk_file.c_str(), ErrorCodeString(ret_code));
- return nothing;
- }
- ScopedZiparchiveHandle scoped_handle(handle);
- ZipEntry zentry;
- ret_code = FindEntry(handle, ZipString(elf_file.c_str()), &zentry);
- if (ret_code != 0) {
- BACK_LOGW("failed to find %s in %s: %s", elf_file.c_str(), apk_file.c_str(),
- ErrorCodeString(ret_code));
- return nothing;
- }
- if (zentry.method != kCompressStored || zentry.compressed_length != zentry.uncompressed_length) {
- BACK_LOGW("%s is compressed in %s, which doesn't support running directly", elf_file.c_str(),
- apk_file.c_str());
- return nothing;
- }
- auto buffer_or_err = llvm::MemoryBuffer::getOpenFileSlice(GetFileDescriptor(handle), apk_file,
- zentry.uncompressed_length,
- zentry.offset);
- if (!buffer_or_err) {
- BACK_LOGW("failed to read %s in %s: %s", elf_file.c_str(), apk_file.c_str(),
- buffer_or_err.getError().message().c_str());
- return nothing;
- }
- auto binary_or_err = llvm::object::createBinary(buffer_or_err.get()->getMemBufferRef());
- if (!binary_or_err) {
- BACK_LOGW("failed to create binary for %s in %s: %s", elf_file.c_str(), apk_file.c_str(),
- llvm::toString(binary_or_err.takeError()).c_str());
- return nothing;
- }
- return llvm::object::OwningBinary<llvm::object::Binary>(std::move(binary_or_err.get()),
- std::move(buffer_or_err.get()));
-}
-
-static DebugFrameInfo* ReadDebugFrameFromFile(const std::string& filename) {
- llvm::object::OwningBinary<llvm::object::Binary> owning_binary;
- if (filename.find("!/") != std::string::npos) {
- owning_binary = OpenEmbeddedElfFile(filename);
- } else {
- if (!IsValidElfPath(filename)) {
- return nullptr;
- }
- auto binary_or_err = llvm::object::createBinary(llvm::StringRef(filename));
- if (!binary_or_err) {
- return nullptr;
- }
- owning_binary = std::move(binary_or_err.get());
- }
- llvm::object::Binary* binary = owning_binary.getBinary();
- auto obj = llvm::dyn_cast<llvm::object::ObjectFile>(binary);
- if (obj == nullptr) {
- return nullptr;
- }
- if (auto elf = llvm::dyn_cast<llvm::object::ELF32LEObjectFile>(obj)) {
- return ReadDebugFrameFromELFFile(elf->getELFFile());
- }
- if (auto elf = llvm::dyn_cast<llvm::object::ELF64LEObjectFile>(obj)) {
- return ReadDebugFrameFromELFFile(elf->getELFFile());
- }
- return nullptr;
-}
-
-Backtrace* Backtrace::CreateOffline(pid_t pid, pid_t tid, BacktraceMap* map,
- const backtrace_stackinfo_t& stack, bool cache_file) {
- return new BacktraceOffline(pid, tid, map, stack, cache_file);
-}
diff --git a/libbacktrace/BacktraceOffline.h b/libbacktrace/BacktraceOffline.h
deleted file mode 100644
index e028cd848..000000000
--- a/libbacktrace/BacktraceOffline.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Copyright (C) 2015 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef _LIBBACKTRACE_UNWIND_OFFLINE_H
-#define _LIBBACKTRACE_UNWIND_OFFLINE_H
-
-#include <libunwind.h>
-#include <stdint.h>
-#include <sys/types.h>
-#include <ucontext.h>
-
-#include <unordered_map>
-#include <unordered_set>
-
-#include <backtrace/Backtrace.h>
-
-struct Space {
- uint64_t start;
- uint64_t end;
- const uint8_t* data;
-
- Space() { Clear(); }
-
- void Clear();
- size_t Read(uint64_t addr, uint8_t* buffer, size_t size);
-};
-
-struct DebugFrameInfo;
-
-class BacktraceOffline : public Backtrace {
- public:
- BacktraceOffline(pid_t pid, pid_t tid, BacktraceMap* map, const backtrace_stackinfo_t& stack,
- bool cache_file)
- : Backtrace(pid, tid, map),
- cache_file_(cache_file),
- context_(nullptr),
- is_debug_frame_used_(false) {
- stack_space_.start = stack.start;
- stack_space_.end = stack.end;
- stack_space_.data = stack.data;
- }
-
- virtual ~BacktraceOffline() = default;
-
- bool Unwind(size_t num_ignore_frames, ucontext_t* context) override;
-
- bool ReadWord(uint64_t ptr, word_t* out_value) override;
-
- size_t Read(uint64_t addr, uint8_t* buffer, size_t bytes) override;
-
- bool FindProcInfo(unw_addr_space_t addr_space, uint64_t ip, unw_proc_info_t* proc_info,
- int need_unwind_info);
-
- bool ReadReg(size_t reg_index, uint64_t* value);
-
- protected:
- std::string GetFunctionNameRaw(uint64_t pc, uint64_t* offset) override;
- DebugFrameInfo* GetDebugFrameInFile(const std::string& filename);
-
- bool cache_file_;
- ucontext_t* context_;
- Space eh_frame_hdr_space_;
- Space eh_frame_space_;
- Space arm_extab_space_;
- Space arm_exidx_space_;
- Space stack_space_;
-
- // is_debug_frame_used_ is to make sure we can try both .debug_frame and .ARM.exidx in
- // FindProcInfo() on ARM. One example is EsxContext::Clear() in
- // vendor/lib/egl/libGLESv2_adreno.so. EsxContext::Clear() appears in both .debug_frame and
- // .ARM.exidx. However, libunwind fails to execute debug_frame instruction
- // "DW_CFA_offset_extended: r265 at cfa-48". So we need to try .ARM.exidx to unwind that
- // function.
- bool is_debug_frame_used_;
-};
-
-#endif // _LIBBACKTRACE_BACKTRACE_OFFLINE_H
diff --git a/libbacktrace/UnwindStack.cpp b/libbacktrace/UnwindStack.cpp
index c5d498cb8..158467ec2 100644
--- a/libbacktrace/UnwindStack.cpp
+++ b/libbacktrace/UnwindStack.cpp
@@ -18,7 +18,6 @@
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-#include <ucontext.h>
#include <memory>
#include <set>
@@ -103,7 +102,7 @@ static void FillInDexFrame(UnwindStackMap* stack_map, uint64_t dex_pc,
bool Backtrace::Unwind(unwindstack::Regs* regs, BacktraceMap* back_map,
std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames,
- std::vector<std::string>* skip_names) {
+ std::vector<std::string>* skip_names, BacktraceUnwindError* error) {
UnwindStackMap* stack_map = reinterpret_cast<UnwindStackMap*>(back_map);
auto process_memory = stack_map->process_memory();
unwindstack::Unwinder unwinder(MAX_BACKTRACE_FRAMES + num_ignore_frames, stack_map->stack_maps(),
@@ -112,6 +111,38 @@ bool Backtrace::Unwind(unwindstack::Regs* regs, BacktraceMap* back_map,
unwinder.SetJitDebug(stack_map->GetJitDebug(), regs->Arch());
}
unwinder.Unwind(skip_names, &stack_map->GetSuffixesToIgnore());
+ if (error != nullptr) {
+ switch (unwinder.LastErrorCode()) {
+ case unwindstack::ERROR_NONE:
+ error->error_code = BACKTRACE_UNWIND_NO_ERROR;
+ break;
+
+ case unwindstack::ERROR_MEMORY_INVALID:
+ error->error_code = BACKTRACE_UNWIND_ERROR_ACCESS_MEM_FAILED;
+ error->error_info.addr = unwinder.LastErrorAddress();
+ break;
+
+ case unwindstack::ERROR_UNWIND_INFO:
+ error->error_code = BACKTRACE_UNWIND_ERROR_UNWIND_INFO;
+ break;
+
+ case unwindstack::ERROR_UNSUPPORTED:
+ error->error_code = BACKTRACE_UNWIND_ERROR_UNSUPPORTED_OPERATION;
+ break;
+
+ case unwindstack::ERROR_INVALID_MAP:
+ error->error_code = BACKTRACE_UNWIND_ERROR_MAP_MISSING;
+ break;
+
+ case unwindstack::ERROR_MAX_FRAMES_EXCEEDED:
+ error->error_code = BACKTRACE_UNWIND_ERROR_EXCEED_MAX_FRAMES_LIMIT;
+ break;
+
+ case unwindstack::ERROR_REPEATED_FRAME:
+ error->error_code = BACKTRACE_UNWIND_ERROR_REPEATED_FRAME;
+ break;
+ }
+ }
if (num_ignore_frames >= unwinder.NumFrames()) {
frames->resize(0);
@@ -178,7 +209,7 @@ std::string UnwindStackCurrent::GetFunctionNameRaw(uint64_t pc, uint64_t* offset
return GetMap()->GetFunctionName(pc, offset);
}
-bool UnwindStackCurrent::UnwindFromContext(size_t num_ignore_frames, ucontext_t* ucontext) {
+bool UnwindStackCurrent::UnwindFromContext(size_t num_ignore_frames, void* ucontext) {
std::unique_ptr<unwindstack::Regs> regs;
if (ucontext == nullptr) {
regs.reset(unwindstack::Regs::CreateFromLocal());
@@ -189,9 +220,8 @@ bool UnwindStackCurrent::UnwindFromContext(size_t num_ignore_frames, ucontext_t*
regs.reset(unwindstack::Regs::CreateFromUcontext(unwindstack::Regs::CurrentArch(), ucontext));
}
- error_.error_code = BACKTRACE_UNWIND_NO_ERROR;
std::vector<std::string> skip_names{"libunwindstack.so", "libbacktrace.so"};
- return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, &skip_names);
+ return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, &skip_names, &error_);
}
UnwindStackPtrace::UnwindStackPtrace(pid_t pid, pid_t tid, BacktraceMap* map)
@@ -201,7 +231,7 @@ std::string UnwindStackPtrace::GetFunctionNameRaw(uint64_t pc, uint64_t* offset)
return GetMap()->GetFunctionName(pc, offset);
}
-bool UnwindStackPtrace::Unwind(size_t num_ignore_frames, ucontext_t* context) {
+bool UnwindStackPtrace::Unwind(size_t num_ignore_frames, void* context) {
std::unique_ptr<unwindstack::Regs> regs;
if (context == nullptr) {
regs.reset(unwindstack::Regs::RemoteGet(Tid()));
@@ -209,10 +239,77 @@ bool UnwindStackPtrace::Unwind(size_t num_ignore_frames, ucontext_t* context) {
regs.reset(unwindstack::Regs::CreateFromUcontext(unwindstack::Regs::CurrentArch(), context));
}
- error_.error_code = BACKTRACE_UNWIND_NO_ERROR;
- return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, nullptr);
+ return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, nullptr, &error_);
}
size_t UnwindStackPtrace::Read(uint64_t addr, uint8_t* buffer, size_t bytes) {
return memory_.Read(addr, buffer, bytes);
}
+
+UnwindStackOffline::UnwindStackOffline(ArchEnum arch, pid_t pid, pid_t tid, BacktraceMap* map,
+ bool map_shared)
+ : Backtrace(pid, tid, map), arch_(arch) {
+ map_shared_ = map_shared;
+}
+
+bool UnwindStackOffline::Unwind(size_t num_ignore_frames, void* ucontext) {
+ if (ucontext == nullptr) {
+ return false;
+ }
+
+ unwindstack::ArchEnum arch;
+ switch (arch_) {
+ case ARCH_ARM:
+ arch = unwindstack::ARCH_ARM;
+ break;
+ case ARCH_ARM64:
+ arch = unwindstack::ARCH_ARM64;
+ break;
+ case ARCH_X86:
+ arch = unwindstack::ARCH_X86;
+ break;
+ case ARCH_X86_64:
+ arch = unwindstack::ARCH_X86_64;
+ break;
+ default:
+ return false;
+ }
+
+ std::unique_ptr<unwindstack::Regs> regs(unwindstack::Regs::CreateFromUcontext(arch, ucontext));
+
+ return Backtrace::Unwind(regs.get(), GetMap(), &frames_, num_ignore_frames, nullptr, &error_);
+}
+
+std::string UnwindStackOffline::GetFunctionNameRaw(uint64_t, uint64_t*) {
+ return "";
+}
+
+size_t UnwindStackOffline::Read(uint64_t, uint8_t*, size_t) {
+ return 0;
+}
+
+bool UnwindStackOffline::ReadWord(uint64_t, word_t*) {
+ return false;
+}
+
+Backtrace* Backtrace::CreateOffline(ArchEnum arch, pid_t pid, pid_t tid,
+ const std::vector<backtrace_map_t>& maps,
+ const backtrace_stackinfo_t& stack) {
+ BacktraceMap* map = BacktraceMap::CreateOffline(pid, maps, stack);
+ if (map == nullptr) {
+ return nullptr;
+ }
+
+ return new UnwindStackOffline(arch, pid, tid, map, false);
+}
+
+Backtrace* Backtrace::CreateOffline(ArchEnum arch, pid_t pid, pid_t tid, BacktraceMap* map) {
+ if (map == nullptr) {
+ return nullptr;
+ }
+ return new UnwindStackOffline(arch, pid, tid, map, true);
+}
+
+void Backtrace::SetGlobalElfCache(bool enable) {
+ unwindstack::Elf::SetCachingEnabled(enable);
+}
diff --git a/libbacktrace/UnwindStack.h b/libbacktrace/UnwindStack.h
index 498ad4ef7..33c4282b2 100644
--- a/libbacktrace/UnwindStack.h
+++ b/libbacktrace/UnwindStack.h
@@ -34,7 +34,7 @@ class UnwindStackCurrent : public BacktraceCurrent {
std::string GetFunctionNameRaw(uint64_t pc, uint64_t* offset) override;
- bool UnwindFromContext(size_t num_ignore_frames, ucontext_t* ucontext) override;
+ bool UnwindFromContext(size_t num_ignore_frames, void* ucontext) override;
};
class UnwindStackPtrace : public BacktracePtrace {
@@ -42,9 +42,9 @@ class UnwindStackPtrace : public BacktracePtrace {
UnwindStackPtrace(pid_t pid, pid_t tid, BacktraceMap* map);
virtual ~UnwindStackPtrace() = default;
- bool Unwind(size_t num_ignore_frames, ucontext_t* context) override;
+ bool Unwind(size_t num_ignore_frames, void* context) override;
- std::string GetFunctionNameRaw(uint64_t pc, uint64_t* offset);
+ std::string GetFunctionNameRaw(uint64_t pc, uint64_t* offset) override;
size_t Read(uint64_t addr, uint8_t* buffer, size_t bytes) override;
@@ -52,4 +52,20 @@ class UnwindStackPtrace : public BacktracePtrace {
unwindstack::MemoryRemote memory_;
};
+class UnwindStackOffline : public Backtrace {
+ public:
+ UnwindStackOffline(ArchEnum arch, pid_t pid, pid_t tid, BacktraceMap* map, bool map_shared);
+
+ bool Unwind(size_t num_ignore_frames, void* context) override;
+
+ std::string GetFunctionNameRaw(uint64_t pc, uint64_t* offset);
+
+ size_t Read(uint64_t addr, uint8_t* buffer, size_t bytes) override;
+
+ bool ReadWord(uint64_t ptr, word_t* out_value) override;
+
+ private:
+ ArchEnum arch_;
+};
+
#endif // _LIBBACKTRACE_UNWIND_STACK_H
diff --git a/libbacktrace/UnwindStackMap.cpp b/libbacktrace/UnwindStackMap.cpp
index 11ff84a8b..97f8d782d 100644
--- a/libbacktrace/UnwindStackMap.cpp
+++ b/libbacktrace/UnwindStackMap.cpp
@@ -147,6 +147,43 @@ UnwindDexFile* UnwindStackMap::GetDexFile(uint64_t dex_file_offset, unwindstack:
}
#endif
+UnwindStackOfflineMap::UnwindStackOfflineMap(pid_t pid) : UnwindStackMap(pid) {}
+
+bool UnwindStackOfflineMap::Build() {
+ return false;
+}
+
+bool UnwindStackOfflineMap::Build(const std::vector<backtrace_map_t>& backtrace_maps,
+ const backtrace_stackinfo_t& stack) {
+ if (stack.start >= stack.end) {
+ return false;
+ }
+
+ for (const backtrace_map_t& map : backtrace_maps) {
+ maps_.push_back(map);
+ }
+
+ std::sort(maps_.begin(), maps_.end(),
+ [](const backtrace_map_t& a, const backtrace_map_t& b) { return a.start < b.start; });
+
+ unwindstack::Maps* maps = new unwindstack::Maps;
+ stack_maps_.reset(maps);
+ for (const backtrace_map_t& map : maps_) {
+ maps->Add(map.start, map.end, map.offset, map.flags, map.name, map.load_bias);
+ }
+
+ // Create the process memory from the stack data.
+ uint64_t size = stack.end - stack.start;
+ unwindstack::MemoryBuffer* memory = new unwindstack::MemoryBuffer;
+ memory->Resize(size);
+ memcpy(memory->GetPtr(0), stack.data, size);
+ std::shared_ptr<unwindstack::Memory> shared_memory(memory);
+
+ process_memory_.reset(new unwindstack::MemoryRange(shared_memory, 0, size, stack.start));
+
+ return true;
+}
+
//-------------------------------------------------------------------------
// BacktraceMap create function.
//-------------------------------------------------------------------------
@@ -167,3 +204,16 @@ BacktraceMap* BacktraceMap::Create(pid_t pid, bool uncached) {
}
return map;
}
+
+//-------------------------------------------------------------------------
+// BacktraceMap create offline function.
+//-------------------------------------------------------------------------
+BacktraceMap* BacktraceMap::CreateOffline(pid_t pid, const std::vector<backtrace_map_t>& maps,
+ const backtrace_stackinfo_t& stack) {
+ UnwindStackOfflineMap* map = new UnwindStackOfflineMap(pid);
+ if (!map->Build(maps, stack)) {
+ delete map;
+ return nullptr;
+ }
+ return map;
+}
diff --git a/libbacktrace/UnwindStackMap.h b/libbacktrace/UnwindStackMap.h
index a815aae71..be5c59e74 100644
--- a/libbacktrace/UnwindStackMap.h
+++ b/libbacktrace/UnwindStackMap.h
@@ -23,7 +23,9 @@
#include <memory>
#include <mutex>
#include <unordered_map>
+#include <vector>
+#include <backtrace/Backtrace.h>
#include <backtrace/BacktraceMap.h>
#include <unwindstack/JitDebug.h>
#include <unwindstack/Maps.h>
@@ -63,4 +65,14 @@ class UnwindStackMap : public BacktraceMap {
#endif
};
+class UnwindStackOfflineMap : public UnwindStackMap {
+ public:
+ UnwindStackOfflineMap(pid_t pid);
+ ~UnwindStackOfflineMap() = default;
+
+ bool Build() override;
+
+ bool Build(const std::vector<backtrace_map_t>& maps, const backtrace_stackinfo_t& stack);
+};
+
#endif // _LIBBACKTRACE_UNWINDSTACK_MAP_H
diff --git a/libbacktrace/backtrace_offline_test.cpp b/libbacktrace/backtrace_offline_test.cpp
index e2a744198..9877f2948 100644
--- a/libbacktrace/backtrace_offline_test.cpp
+++ b/libbacktrace/backtrace_offline_test.cpp
@@ -15,9 +15,9 @@
*/
#include <inttypes.h>
-#include <libunwind.h>
#include <pthread.h>
#include <stdint.h>
+#include <stdlib.h>
#include <string.h>
#include <functional>
@@ -44,33 +44,7 @@ int test_level_two(int, int, int, int, void (*)(void*), void*);
int test_level_three(int, int, int, int, void (*)(void*), void*);
int test_level_four(int, int, int, int, void (*)(void*), void*);
int test_recursive_call(int, void (*)(void*), void*);
-void test_get_context_and_wait(unw_context_t* unw_context, volatile int* exit_flag);
-}
-
-static ucontext_t GetUContextFromUnwContext(const unw_context_t& unw_context) {
- ucontext_t ucontext;
- memset(&ucontext, 0, sizeof(ucontext));
-#if defined(__arm__)
- ucontext.uc_mcontext.arm_r0 = unw_context.regs[0];
- ucontext.uc_mcontext.arm_r1 = unw_context.regs[1];
- ucontext.uc_mcontext.arm_r2 = unw_context.regs[2];
- ucontext.uc_mcontext.arm_r3 = unw_context.regs[3];
- ucontext.uc_mcontext.arm_r4 = unw_context.regs[4];
- ucontext.uc_mcontext.arm_r5 = unw_context.regs[5];
- ucontext.uc_mcontext.arm_r6 = unw_context.regs[6];
- ucontext.uc_mcontext.arm_r7 = unw_context.regs[7];
- ucontext.uc_mcontext.arm_r8 = unw_context.regs[8];
- ucontext.uc_mcontext.arm_r9 = unw_context.regs[9];
- ucontext.uc_mcontext.arm_r10 = unw_context.regs[10];
- ucontext.uc_mcontext.arm_fp = unw_context.regs[11];
- ucontext.uc_mcontext.arm_ip = unw_context.regs[12];
- ucontext.uc_mcontext.arm_sp = unw_context.regs[13];
- ucontext.uc_mcontext.arm_lr = unw_context.regs[14];
- ucontext.uc_mcontext.arm_pc = unw_context.regs[15];
-#else
- ucontext.uc_mcontext = unw_context.uc_mcontext;
-#endif
- return ucontext;
+void test_get_context_and_wait(void* context, volatile int* exit_flag);
}
struct FunctionSymbol {
@@ -108,18 +82,17 @@ static std::string RawDataToHexString(const void* data, size_t size) {
return s;
}
-static void HexStringToRawData(const char* s, void* data, size_t size) {
- uint8_t* p = static_cast<uint8_t*>(data);
+static void HexStringToRawData(const char* s, std::vector<uint8_t>* data, size_t size) {
for (size_t i = 0; i < size; ++i) {
int value;
sscanf(s, "%02x", &value);
- *p++ = static_cast<uint8_t>(value);
+ data->push_back(value);
s += 2;
}
}
struct OfflineThreadArg {
- unw_context_t unw_context;
+ std::vector<uint8_t> ucontext;
pid_t tid;
volatile int exit_flag;
};
@@ -127,12 +100,12 @@ struct OfflineThreadArg {
static void* OfflineThreadFunc(void* arg) {
OfflineThreadArg* fn_arg = reinterpret_cast<OfflineThreadArg*>(arg);
fn_arg->tid = gettid();
- test_get_context_and_wait(&fn_arg->unw_context, &fn_arg->exit_flag);
+ test_get_context_and_wait(&fn_arg->ucontext, &fn_arg->exit_flag);
return nullptr;
}
-std::string GetTestPath(std::string path) {
- return android::base::GetExecutableDirectory() + "/testdata/" + ABI_STRING + '/' + path;
+std::string GetTestPath(const std::string& arch, const std::string& path) {
+ return android::base::GetExecutableDirectory() + "/testdata/" + arch + '/' + path;
}
// This test is disable because it is for generating test data.
@@ -149,7 +122,7 @@ TEST(libbacktrace, DISABLED_generate_offline_testdata) {
OfflineThreadArg arg;
arg.exit_flag = 0;
ASSERT_EQ(0, pthread_create(&thread, &attr, OfflineThreadFunc, &arg));
- // Wait for the offline thread to generate the stack and unw_context information.
+ // Wait for the offline thread to generate the stack and context information.
sleep(1);
// Copy the stack information.
std::vector<uint8_t> stack_data(reinterpret_cast<uint8_t*>(stack),
@@ -179,9 +152,9 @@ TEST(libbacktrace, DISABLED_generate_offline_testdata) {
entry->start, entry->end, entry->offset, entry->load_bias,
entry->flags, entry->name.c_str());
}
- // 3. Dump registers
- testdata += android::base::StringPrintf("registers: %zu ", sizeof(arg.unw_context));
- testdata += RawDataToHexString(&arg.unw_context, sizeof(arg.unw_context));
+ // 3. Dump ucontext
+ testdata += android::base::StringPrintf("ucontext: %zu ", arg.ucontext.size());
+ testdata += RawDataToHexString(arg.ucontext.data(), arg.ucontext.size());
testdata.push_back('\n');
// 4. Dump stack
@@ -218,7 +191,7 @@ struct OfflineTestData {
int pid;
int tid;
std::vector<backtrace_map_t> maps;
- unw_context_t unw_context;
+ std::vector<uint8_t> ucontext;
backtrace_stackinfo_t stack_info;
std::vector<uint8_t> stack;
std::vector<FunctionSymbol> symbols;
@@ -231,7 +204,6 @@ bool ReadOfflineTestData(const std::string offline_testdata_path, OfflineTestDat
}
// Parse offline_testdata.
std::vector<std::string> lines = android::base::Split(s, "\n");
- memset(&testdata->unw_context, 0, sizeof(testdata->unw_context));
for (const auto& line : lines) {
if (android::base::StartsWith(line, "pid:")) {
sscanf(line.c_str(), "pid: %d tid: %d", &testdata->pid, &testdata->tid);
@@ -244,50 +216,12 @@ bool ReadOfflineTestData(const std::string offline_testdata_path, OfflineTestDat
" flags: %d name: %n",
&map.start, &map.end, &map.offset, &map.load_bias, &map.flags, &pos);
map.name = android::base::Trim(line.substr(pos));
- } else if (android::base::StartsWith(line, "registers:")) {
+ } else if (android::base::StartsWith(line, "ucontext:")) {
size_t size;
int pos;
- sscanf(line.c_str(), "registers: %zu %n", &size, &pos);
- if (sizeof(testdata->unw_context) != size) {
- return false;
- }
- HexStringToRawData(&line[pos], &testdata->unw_context, size);
- } else if (android::base::StartsWith(line, "regs:")) {
- std::vector<std::string> strs = android::base::Split(line.substr(6), " ");
- if (strs.size() % 2 != 0) {
- return false;
- }
- std::vector<std::pair<std::string, uint64_t>> items;
- for (size_t i = 0; i + 1 < strs.size(); i += 2) {
- if (!android::base::EndsWith(strs[i], ":")) {
- return false;
- }
- uint64_t value = std::stoul(strs[i + 1], nullptr, 16);
- items.push_back(std::make_pair(strs[i].substr(0, strs[i].size() - 1), value));
- }
-#if defined(__arm__)
- for (auto& item : items) {
- if (item.first == "sp") {
- testdata->unw_context.regs[13] = item.second;
- } else if (item.first == "pc") {
- testdata->unw_context.regs[15] = item.second;
- } else {
- return false;
- }
- }
-#elif defined(__aarch64__)
- for (auto& item : items) {
- if (item.first == "pc") {
- testdata->unw_context.uc_mcontext.pc = item.second;
- } else if (item.first == "sp") {
- testdata->unw_context.uc_mcontext.sp = item.second;
- } else if (item.first == "x29") {
- testdata->unw_context.uc_mcontext.regs[UNW_AARCH64_X29] = item.second;
- } else {
- return false;
- }
- }
-#endif
+ testdata->ucontext.clear();
+ sscanf(line.c_str(), "ucontext: %zu %n", &size, &pos);
+ HexStringToRawData(&line[pos], &testdata->ucontext, size);
} else if (android::base::StartsWith(line, "stack:")) {
size_t size;
int pos;
@@ -295,8 +229,8 @@ bool ReadOfflineTestData(const std::string offline_testdata_path, OfflineTestDat
"stack: start: %" SCNx64 " end: %" SCNx64 " size: %zu %n",
&testdata->stack_info.start, &testdata->stack_info.end, &size, &pos);
CHECK_EQ(testdata->stack_info.end - testdata->stack_info.start, size);
- testdata->stack.resize(size);
- HexStringToRawData(&line[pos], &testdata->stack[0], size);
+ testdata->stack.clear();
+ HexStringToRawData(&line[pos], &testdata->stack, size);
testdata->stack_info.data = testdata->stack.data();
} else if (android::base::StartsWith(line, "function:")) {
testdata->symbols.resize(testdata->symbols.size() + 1);
@@ -310,17 +244,11 @@ bool ReadOfflineTestData(const std::string offline_testdata_path, OfflineTestDat
return true;
}
-static void BacktraceOfflineTest(const char* arch, const std::string& testlib_name) {
- // TODO: For now, we can only run this on the same arch as the library arch.
- if (std::string(ABI_STRING) != arch) {
- GTEST_LOG_(INFO) << "Ignoring arch " << arch << " for lib " << testlib_name;
- return;
- }
-
- const std::string testlib_path(GetTestPath(testlib_name));
- const std::string offline_testdata_path(GetTestPath("offline_testdata"));
+static void BacktraceOfflineTest(std::string arch_str, const std::string& testlib_name) {
+ const std::string testlib_path(GetTestPath(arch_str, testlib_name));
+ const std::string offline_testdata_path(GetTestPath(arch_str, "offline_testdata"));
OfflineTestData testdata;
- ASSERT_TRUE(ReadOfflineTestData(offline_testdata_path, &testdata));
+ ASSERT_TRUE(ReadOfflineTestData(offline_testdata_path, &testdata)) << "Failed " << arch_str;
// Fix path of libbacktrace_testlib.so.
for (auto& map : testdata.maps) {
@@ -329,16 +257,24 @@ static void BacktraceOfflineTest(const char* arch, const std::string& testlib_na
}
}
- // Do offline backtrace.
- std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(testdata.pid, testdata.maps));
- ASSERT_TRUE(map != nullptr);
+ Backtrace::ArchEnum arch;
+ if (arch_str == "arm") {
+ arch = Backtrace::ARCH_ARM;
+ } else if (arch_str == "arm64") {
+ arch = Backtrace::ARCH_ARM64;
+ } else if (arch_str == "x86") {
+ arch = Backtrace::ARCH_X86;
+ } else if (arch_str == "x86_64") {
+ arch = Backtrace::ARCH_X86_64;
+ } else {
+ abort();
+ }
- std::unique_ptr<Backtrace> backtrace(
- Backtrace::CreateOffline(testdata.pid, testdata.tid, map.get(), testdata.stack_info));
- ASSERT_TRUE(backtrace != nullptr);
+ std::unique_ptr<Backtrace> backtrace(Backtrace::CreateOffline(
+ arch, testdata.pid, testdata.tid, testdata.maps, testdata.stack_info));
+ ASSERT_TRUE(backtrace != nullptr) << "Failed " << arch_str;
- ucontext_t ucontext = GetUContextFromUnwContext(testdata.unw_context);
- ASSERT_TRUE(backtrace->Unwind(0, &ucontext));
+ ASSERT_TRUE(backtrace->Unwind(0, testdata.ucontext.data())) << "Failed " << arch_str;
// Collect pc values of the call stack frames.
std::vector<uint64_t> pc_values;
@@ -354,14 +290,17 @@ static void BacktraceOfflineTest(const char* arch, const std::string& testlib_na
}
}
- ASSERT_GE(test_one_index, 3u);
- ASSERT_EQ("test_level_one", FunctionNameForAddress(pc_values[test_one_index], testdata.symbols));
- ASSERT_EQ("test_level_two", FunctionNameForAddress(pc_values[test_one_index - 1],
- testdata.symbols));
- ASSERT_EQ("test_level_three", FunctionNameForAddress(pc_values[test_one_index - 2],
- testdata.symbols));
- ASSERT_EQ("test_level_four", FunctionNameForAddress(pc_values[test_one_index - 3],
- testdata.symbols));
+ ASSERT_GE(test_one_index, 3u) << "Failed " << arch_str;
+ ASSERT_EQ("test_level_one", FunctionNameForAddress(pc_values[test_one_index], testdata.symbols))
+ << "Failed " << arch_str;
+ ASSERT_EQ("test_level_two", FunctionNameForAddress(pc_values[test_one_index - 1], testdata.symbols))
+ << "Failed " << arch_str;
+ ASSERT_EQ("test_level_three",
+ FunctionNameForAddress(pc_values[test_one_index - 2], testdata.symbols))
+ << "Failed " << arch_str;
+ ASSERT_EQ("test_level_four",
+ FunctionNameForAddress(pc_values[test_one_index - 3], testdata.symbols))
+ << "Failed " << arch_str;
}
// For now, these tests can only run on the given architectures.
@@ -384,18 +323,13 @@ TEST(libbacktrace, offline_arm_exidx) {
BacktraceOfflineTest("arm", "libbacktrace_test_arm_exidx.so");
}
-static void LibUnwindingTest(const std::string& arch, const std::string& testdata_name,
+static void LibUnwindingTest(const std::string& arch_str, const std::string& testdata_name,
const std::string& testlib_name) {
- if (std::string(ABI_STRING) != arch) {
- GTEST_LOG_(INFO) << "Skipping test since offline for arm on " << ABI_STRING
- << " isn't supported.";
- return;
- }
- const std::string testlib_path(GetTestPath(testlib_name));
+ const std::string testlib_path(GetTestPath(arch_str, testlib_name));
struct stat st;
ASSERT_EQ(0, stat(testlib_path.c_str(), &st)) << "can't find testlib " << testlib_path;
- const std::string offline_testdata_path(GetTestPath(testdata_name));
+ const std::string offline_testdata_path(GetTestPath(arch_str, testdata_name));
OfflineTestData testdata;
ASSERT_TRUE(ReadOfflineTestData(offline_testdata_path, &testdata));
@@ -406,26 +340,35 @@ static void LibUnwindingTest(const std::string& arch, const std::string& testdat
}
}
- // Do offline backtrace.
- std::unique_ptr<BacktraceMap> map(BacktraceMap::Create(testdata.pid, testdata.maps));
- ASSERT_TRUE(map != nullptr);
+ Backtrace::ArchEnum arch;
+ if (arch_str == "arm") {
+ arch = Backtrace::ARCH_ARM;
+ } else if (arch_str == "arm64") {
+ arch = Backtrace::ARCH_ARM64;
+ } else if (arch_str == "x86") {
+ arch = Backtrace::ARCH_X86;
+ } else if (arch_str == "x86_64") {
+ arch = Backtrace::ARCH_X86_64;
+ } else {
+ ASSERT_TRUE(false) << "Unsupported arch " << arch_str;
+ abort();
+ }
- std::unique_ptr<Backtrace> backtrace(
- Backtrace::CreateOffline(testdata.pid, testdata.tid, map.get(), testdata.stack_info));
+ // Do offline backtrace.
+ std::unique_ptr<Backtrace> backtrace(Backtrace::CreateOffline(
+ arch, testdata.pid, testdata.tid, testdata.maps, testdata.stack_info));
ASSERT_TRUE(backtrace != nullptr);
- ucontext_t ucontext = GetUContextFromUnwContext(testdata.unw_context);
- ASSERT_TRUE(backtrace->Unwind(0, &ucontext));
+ ASSERT_TRUE(backtrace->Unwind(0, testdata.ucontext.data()));
ASSERT_EQ(testdata.symbols.size(), backtrace->NumFrames());
for (size_t i = 0; i < backtrace->NumFrames(); ++i) {
- uint64_t vaddr_in_file =
- backtrace->GetFrame(i)->pc - testdata.maps[0].start + testdata.maps[0].load_bias;
- std::string name = FunctionNameForAddress(vaddr_in_file, testdata.symbols);
+ std::string name = FunctionNameForAddress(backtrace->GetFrame(i)->rel_pc, testdata.symbols);
ASSERT_EQ(name, testdata.symbols[i].name);
}
ASSERT_TRUE(backtrace->GetError().error_code == BACKTRACE_UNWIND_ERROR_ACCESS_MEM_FAILED ||
- backtrace->GetError().error_code == BACKTRACE_UNWIND_ERROR_MAP_MISSING);
+ backtrace->GetError().error_code == BACKTRACE_UNWIND_ERROR_MAP_MISSING ||
+ backtrace->GetError().error_code == BACKTRACE_UNWIND_ERROR_REPEATED_FRAME);
}
// This test tests the situation that ranges of functions covered by .eh_frame and .ARM.exidx
diff --git a/libbacktrace/backtrace_test.cpp b/libbacktrace/backtrace_test.cpp
index 10152f7ad..aab6db9de 100644
--- a/libbacktrace/backtrace_test.cpp
+++ b/libbacktrace/backtrace_test.cpp
@@ -31,6 +31,7 @@
#include <sys/types.h>
#include <sys/wait.h>
#include <time.h>
+#include <ucontext.h>
#include <unistd.h>
#include <algorithm>
@@ -143,6 +144,17 @@ static void FinishRemoteProcess(pid_t pid) {
ASSERT_EQ(waitpid(pid, nullptr, 0), pid);
}
+#if !defined(__ANDROID__) || defined(__arm__)
+// On host and arm target we aren't guaranteed that we will terminate cleanly.
+#define VERIFY_NO_ERROR(error_code) \
+ ASSERT_TRUE(error_code == BACKTRACE_UNWIND_NO_ERROR || \
+ error_code == BACKTRACE_UNWIND_ERROR_UNWIND_INFO || \
+ error_code == BACKTRACE_UNWIND_ERROR_MAP_MISSING) \
+ << "Unknown error code " << std::to_string(error_code);
+#else
+#define VERIFY_NO_ERROR(error_code) ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, error_code);
+#endif
+
static bool ReadyLevelBacktrace(Backtrace* backtrace) {
// See if test_level_four is in the backtrace.
bool found = false;
@@ -189,7 +201,7 @@ static void VerifyLevelBacktrace(void*) {
Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
VerifyLevelDump(backtrace.get());
}
@@ -211,7 +223,7 @@ static void VerifyMaxBacktrace(void*) {
Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ ASSERT_EQ(BACKTRACE_UNWIND_ERROR_EXCEED_MAX_FRAMES_LIMIT, backtrace->GetError().error_code);
VerifyMaxDump(backtrace.get());
}
@@ -241,7 +253,7 @@ TEST(libbacktrace, local_no_unwind_frames) {
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(getpid(), getpid()));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
ASSERT_TRUE(backtrace->NumFrames() != 0);
for (const auto& frame : *backtrace ) {
@@ -292,19 +304,19 @@ static void VerifyLevelIgnoreFrames(void*) {
Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD));
ASSERT_TRUE(all.get() != nullptr);
ASSERT_TRUE(all->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, all->GetError().error_code);
+ VERIFY_NO_ERROR(all->GetError().error_code);
std::unique_ptr<Backtrace> ign1(
Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD));
ASSERT_TRUE(ign1.get() != nullptr);
ASSERT_TRUE(ign1->Unwind(1));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, ign1->GetError().error_code);
+ VERIFY_NO_ERROR(ign1->GetError().error_code);
std::unique_ptr<Backtrace> ign2(
Backtrace::Create(BACKTRACE_CURRENT_PROCESS, BACKTRACE_CURRENT_THREAD));
ASSERT_TRUE(ign2.get() != nullptr);
ASSERT_TRUE(ign2->Unwind(2));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, ign2->GetError().error_code);
+ VERIFY_NO_ERROR(ign2->GetError().error_code);
VerifyIgnoreFrames(all.get(), ign1.get(), ign2.get(), "VerifyLevelIgnoreFrames");
}
@@ -340,7 +352,6 @@ static void VerifyProcTest(pid_t pid, pid_t tid, bool (*ReadyFunc)(Backtrace*),
std::unique_ptr<Backtrace> backtrace(create_func(pid, tid, map.get()));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
if (ReadyFunc(backtrace.get())) {
VerifyFunc(backtrace.get(), create_func, map_create_func);
verified = true;
@@ -389,12 +400,12 @@ static void VerifyProcessIgnoreFrames(Backtrace* bt_all, create_func_t create_fu
std::unique_ptr<Backtrace> ign1(create_func(bt_all->Pid(), BACKTRACE_CURRENT_THREAD, map.get()));
ASSERT_TRUE(ign1.get() != nullptr);
ASSERT_TRUE(ign1->Unwind(1));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, ign1->GetError().error_code);
+ VERIFY_NO_ERROR(ign1->GetError().error_code);
std::unique_ptr<Backtrace> ign2(create_func(bt_all->Pid(), BACKTRACE_CURRENT_THREAD, map.get()));
ASSERT_TRUE(ign2.get() != nullptr);
ASSERT_TRUE(ign2->Unwind(2));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, ign2->GetError().error_code);
+ VERIFY_NO_ERROR(ign2->GetError().error_code);
VerifyIgnoreFrames(bt_all, ign1.get(), ign2.get(), nullptr);
}
@@ -480,7 +491,7 @@ void VerifyLevelThread(void*) {
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(getpid(), gettid()));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
VerifyLevelDump(backtrace.get());
}
@@ -493,7 +504,7 @@ static void VerifyMaxThread(void*) {
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(getpid(), gettid()));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ ASSERT_EQ(BACKTRACE_UNWIND_ERROR_EXCEED_MAX_FRAMES_LIMIT, backtrace->GetError().error_code);
VerifyMaxDump(backtrace.get());
}
@@ -535,7 +546,7 @@ TEST(libbacktrace, thread_level_trace) {
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(getpid(), thread_data.tid));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
VerifyLevelDump(backtrace.get());
@@ -575,17 +586,17 @@ TEST(libbacktrace, thread_ignore_frames) {
std::unique_ptr<Backtrace> all(Backtrace::Create(getpid(), thread_data.tid));
ASSERT_TRUE(all.get() != nullptr);
ASSERT_TRUE(all->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, all->GetError().error_code);
+ VERIFY_NO_ERROR(all->GetError().error_code);
std::unique_ptr<Backtrace> ign1(Backtrace::Create(getpid(), thread_data.tid));
ASSERT_TRUE(ign1.get() != nullptr);
ASSERT_TRUE(ign1->Unwind(1));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, ign1->GetError().error_code);
+ VERIFY_NO_ERROR(ign1->GetError().error_code);
std::unique_ptr<Backtrace> ign2(Backtrace::Create(getpid(), thread_data.tid));
ASSERT_TRUE(ign2.get() != nullptr);
ASSERT_TRUE(ign2->Unwind(2));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, ign2->GetError().error_code);
+ VERIFY_NO_ERROR(ign2->GetError().error_code);
VerifyIgnoreFrames(all.get(), ign1.get(), ign2.get(), nullptr);
@@ -616,7 +627,7 @@ TEST(libbacktrace, thread_max_trace) {
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(getpid(), thread_data.tid));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ ASSERT_EQ(BACKTRACE_UNWIND_ERROR_EXCEED_MAX_FRAMES_LIMIT, backtrace->GetError().error_code);
VerifyMaxDump(backtrace.get());
@@ -713,21 +724,21 @@ TEST(libbacktrace, simultaneous_maps) {
Backtrace* back1 = Backtrace::Create(getpid(), BACKTRACE_CURRENT_THREAD, map1);
ASSERT_TRUE(back1 != nullptr);
EXPECT_TRUE(back1->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, back1->GetError().error_code);
+ VERIFY_NO_ERROR(back1->GetError().error_code);
delete back1;
delete map1;
Backtrace* back2 = Backtrace::Create(getpid(), BACKTRACE_CURRENT_THREAD, map2);
ASSERT_TRUE(back2 != nullptr);
EXPECT_TRUE(back2->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, back2->GetError().error_code);
+ VERIFY_NO_ERROR(back2->GetError().error_code);
delete back2;
delete map2;
Backtrace* back3 = Backtrace::Create(getpid(), BACKTRACE_CURRENT_THREAD, map3);
ASSERT_TRUE(back3 != nullptr);
EXPECT_TRUE(back3->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, back3->GetError().error_code);
+ VERIFY_NO_ERROR(back3->GetError().error_code);
delete back3;
delete map3;
}
@@ -991,7 +1002,7 @@ static void RunReadTest(Backtrace* backtrace, uint64_t read_addr) {
uint8_t* expected = new uint8_t[pagesize];
InitMemory(expected, pagesize);
- uint8_t* data = new uint8_t[2*pagesize];
+ uint8_t* data = new uint8_t[2 * pagesize];
// Verify that we can only read one page worth of data.
size_t bytes_read = backtrace->Read(read_addr, data, 2 * pagesize);
ASSERT_EQ(pagesize, bytes_read);
@@ -1042,8 +1053,10 @@ TEST(libbacktrace, thread_read) {
ASSERT_TRUE(WaitForNonZero(&thread_data.state, 10));
}
+// The code requires these variables are the same size.
volatile uint64_t g_ready = 0;
volatile uint64_t g_addr = 0;
+static_assert(sizeof(g_ready) == sizeof(g_addr), "g_ready/g_addr must be same size");
static void ForkedReadTest() {
// Create two map pages.
@@ -1091,13 +1104,13 @@ TEST(libbacktrace, process_read) {
uint64_t read_addr;
size_t bytes_read = backtrace->Read(reinterpret_cast<uint64_t>(&g_ready),
- reinterpret_cast<uint8_t*>(&read_addr), sizeof(uint64_t));
- ASSERT_EQ(sizeof(uint64_t), bytes_read);
+ reinterpret_cast<uint8_t*>(&read_addr), sizeof(g_ready));
+ ASSERT_EQ(sizeof(g_ready), bytes_read);
if (read_addr) {
// The forked process is ready to be read.
bytes_read = backtrace->Read(reinterpret_cast<uint64_t>(&g_addr),
- reinterpret_cast<uint8_t*>(&read_addr), sizeof(uint64_t));
- ASSERT_EQ(sizeof(uint64_t), bytes_read);
+ reinterpret_cast<uint8_t*>(&read_addr), sizeof(g_addr));
+ ASSERT_EQ(sizeof(g_addr), bytes_read);
RunReadTest(backtrace.get(), read_addr);
@@ -1176,7 +1189,7 @@ TEST(libbacktrace, check_unreadable_elf_local) {
int fd = open(tmp_so_name, O_RDONLY);
ASSERT_TRUE(fd != -1);
- void* map = mmap(NULL, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
+ void* map = mmap(nullptr, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
ASSERT_TRUE(map != MAP_FAILED);
close(fd);
ASSERT_TRUE(unlink(tmp_so_name) != -1);
@@ -1225,7 +1238,7 @@ TEST(libbacktrace, check_unreadable_elf_remote) {
exit(0);
}
- void* map = mmap(NULL, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
+ void* map = mmap(nullptr, map_size, PROT_READ | PROT_EXEC, MAP_PRIVATE, fd, 0);
if (map == MAP_FAILED) {
fprintf(stderr, "Failed to map in memory: %s\n", strerror(errno));
unlink(tmp_so_name);
@@ -1258,11 +1271,11 @@ TEST(libbacktrace, check_unreadable_elf_remote) {
ASSERT_TRUE(backtrace.get() != nullptr);
uint64_t read_addr;
- ASSERT_EQ(sizeof(uint64_t),
+ ASSERT_EQ(sizeof(g_ready),
backtrace->Read(reinterpret_cast<uint64_t>(&g_ready),
- reinterpret_cast<uint8_t*>(&read_addr), sizeof(uint64_t)));
+ reinterpret_cast<uint8_t*>(&read_addr), sizeof(g_ready)));
if (read_addr) {
- ASSERT_EQ(sizeof(uint64_t),
+ ASSERT_EQ(sizeof(g_addr),
backtrace->Read(reinterpret_cast<uint64_t>(&g_addr),
reinterpret_cast<uint8_t*>(&read_addr), sizeof(uint64_t)));
@@ -1328,15 +1341,16 @@ static void VerifyUnreadableElfFrame(Backtrace* backtrace, uint64_t test_func, s
}
static void VerifyUnreadableElfBacktrace(void* func) {
- uint64_t test_func = reinterpret_cast<uint64_t>(func);
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(BACKTRACE_CURRENT_PROCESS,
BACKTRACE_CURRENT_THREAD));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
size_t frame_num;
- ASSERT_TRUE(FindFuncFrameInBacktrace(backtrace.get(), test_func, &frame_num));
+ uint64_t test_func = reinterpret_cast<uint64_t>(func);
+ ASSERT_TRUE(FindFuncFrameInBacktrace(backtrace.get(), test_func, &frame_num))
+ << DumpFrames(backtrace.get());
VerifyUnreadableElfFrame(backtrace.get(), test_func, frame_num);
}
@@ -1390,7 +1404,7 @@ TEST(libbacktrace, unwind_through_unreadable_elf_remote) {
std::unique_ptr<Backtrace> backtrace(Backtrace::Create(pid, BACKTRACE_CURRENT_THREAD));
ASSERT_TRUE(backtrace.get() != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
size_t frame_num;
if (FindFuncFrameInBacktrace(backtrace.get(), reinterpret_cast<uint64_t>(test_func),
@@ -1786,7 +1800,7 @@ static void CheckForLeak(pid_t pid, pid_t tid) {
Backtrace* backtrace = Backtrace::Create(pid, tid, map.get());
ASSERT_TRUE(backtrace != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
delete backtrace;
}
size_t stable_pss = GetPssBytes();
@@ -1797,7 +1811,7 @@ static void CheckForLeak(pid_t pid, pid_t tid) {
Backtrace* backtrace = Backtrace::Create(pid, tid, map.get());
ASSERT_TRUE(backtrace != nullptr);
ASSERT_TRUE(backtrace->Unwind(0));
- ASSERT_EQ(BACKTRACE_UNWIND_NO_ERROR, backtrace->GetError().error_code);
+ VERIFY_NO_ERROR(backtrace->GetError().error_code);
delete backtrace;
}
size_t new_pss = GetPssBytes();
diff --git a/libbacktrace/backtrace_testlib.cpp b/libbacktrace/backtrace_testlib.cpp
index 3081d64aa..fec7d985b 100644
--- a/libbacktrace/backtrace_testlib.cpp
+++ b/libbacktrace/backtrace_testlib.cpp
@@ -14,9 +14,15 @@
* limitations under the License.
*/
-#include <libunwind.h>
#include <signal.h>
#include <stdio.h>
+#include <unistd.h>
+
+#include <memory>
+#include <vector>
+
+#include <unwindstack/Regs.h>
+#include <unwindstack/RegsGetLocal.h>
#include "backtrace_testlib.h"
@@ -66,21 +72,70 @@ int test_recursive_call(int level, void (*callback_func)(void*), void* data) {
}
typedef struct {
- unw_context_t* unw_context;
+ std::vector<uint8_t>* ucontext;
volatile int* exit_flag;
} GetContextArg;
static void GetContextAndExit(void* data) {
- GetContextArg* arg = (GetContextArg*)data;
- unw_getcontext(arg->unw_context);
+ GetContextArg* arg = reinterpret_cast<GetContextArg*>(data);
+
+ std::unique_ptr<unwindstack::Regs> regs(unwindstack::Regs::CreateFromLocal());
+ unwindstack::RegsGetLocal(regs.get());
+
+ ucontext_t ucontext;
+ memset(&ucontext, 0, sizeof(ucontext));
+#if defined(__arm__)
+ memcpy(&ucontext.uc_mcontext, regs->RawData(), sizeof(uint32_t) * 16);
+#elif defined(__aarch64__)
+ memcpy(&ucontext.uc_mcontext, regs->RawData(), sizeof(uint64_t) * 33);
+#elif defined(__i386__)
+ uint32_t* reg_data = reinterpret_cast<uint32_t*>(regs->RawData());
+ ucontext.uc_mcontext.gregs[0] = reg_data[15];
+ ucontext.uc_mcontext.gregs[1] = reg_data[14];
+ ucontext.uc_mcontext.gregs[2] = reg_data[13];
+ ucontext.uc_mcontext.gregs[3] = reg_data[12];
+ ucontext.uc_mcontext.gregs[4] = reg_data[7];
+ ucontext.uc_mcontext.gregs[5] = reg_data[6];
+ ucontext.uc_mcontext.gregs[6] = reg_data[5];
+ ucontext.uc_mcontext.gregs[7] = reg_data[4];
+ ucontext.uc_mcontext.gregs[8] = reg_data[3];
+ ucontext.uc_mcontext.gregs[9] = reg_data[2];
+ ucontext.uc_mcontext.gregs[10] = reg_data[1];
+ ucontext.uc_mcontext.gregs[11] = reg_data[0];
+ ucontext.uc_mcontext.gregs[14] = reg_data[8];
+ ucontext.uc_mcontext.gregs[15] = reg_data[10];
+#elif defined(__x86_64__)
+ uint64_t* reg_data = reinterpret_cast<uint64_t*>(regs->RawData());
+ ucontext.uc_mcontext.gregs[0] = reg_data[8];
+ ucontext.uc_mcontext.gregs[1] = reg_data[9];
+ ucontext.uc_mcontext.gregs[2] = reg_data[10];
+ ucontext.uc_mcontext.gregs[3] = reg_data[11];
+ ucontext.uc_mcontext.gregs[4] = reg_data[12];
+ ucontext.uc_mcontext.gregs[5] = reg_data[13];
+ ucontext.uc_mcontext.gregs[6] = reg_data[14];
+ ucontext.uc_mcontext.gregs[7] = reg_data[15];
+ ucontext.uc_mcontext.gregs[8] = reg_data[5];
+ ucontext.uc_mcontext.gregs[9] = reg_data[4];
+ ucontext.uc_mcontext.gregs[10] = reg_data[6];
+ ucontext.uc_mcontext.gregs[11] = reg_data[3];
+ ucontext.uc_mcontext.gregs[12] = reg_data[1];
+ ucontext.uc_mcontext.gregs[13] = reg_data[0];
+ ucontext.uc_mcontext.gregs[14] = reg_data[2];
+ ucontext.uc_mcontext.gregs[15] = reg_data[7];
+ ucontext.uc_mcontext.gregs[16] = reg_data[16];
+#endif
+
+ arg->ucontext->resize(sizeof(ucontext));
+ memcpy(arg->ucontext->data(), &ucontext, sizeof(ucontext));
+
// Don't touch the stack anymore.
while (*arg->exit_flag == 0) {
}
}
-void test_get_context_and_wait(unw_context_t* unw_context, volatile int* exit_flag) {
+void test_get_context_and_wait(void* ucontext, volatile int* exit_flag) {
GetContextArg arg;
- arg.unw_context = unw_context;
+ arg.ucontext = reinterpret_cast<std::vector<uint8_t>*>(ucontext);
arg.exit_flag = exit_flag;
test_level_one(1, 2, 3, 4, GetContextAndExit, &arg);
}
diff --git a/libbacktrace/backtrace_testlib.h b/libbacktrace/backtrace_testlib.h
index 16fedc436..9b55e56d4 100644
--- a/libbacktrace/backtrace_testlib.h
+++ b/libbacktrace/backtrace_testlib.h
@@ -19,8 +19,6 @@
#include <sys/cdefs.h>
-#include <libunwind.h>
-
__BEGIN_DECLS
void test_loop_forever();
@@ -31,7 +29,7 @@ int test_level_three(int, int, int, int, void (*)(void*), void*);
int test_level_two(int, int, int, int, void (*)(void*), void*);
int test_level_one(int, int, int, int, void (*)(void*), void*);
int test_recursive_call(int, void (*)(void*), void*);
-void test_get_context_and_wait(unw_context_t*, volatile int*);
+void test_get_context_and_wait(void*, volatile int*);
__END_DECLS
diff --git a/libbacktrace/include/backtrace/Backtrace.h b/libbacktrace/include/backtrace/Backtrace.h
index 18e9f61e8..7a37015d6 100644
--- a/libbacktrace/include/backtrace/Backtrace.h
+++ b/libbacktrace/include/backtrace/Backtrace.h
@@ -60,6 +60,10 @@ enum BacktraceUnwindErrorCode : uint32_t {
BACKTRACE_UNWIND_ERROR_FIND_PROC_INFO_FAILED,
// Failed to execute dwarf instructions in debug sections.
BACKTRACE_UNWIND_ERROR_EXECUTE_DWARF_INSTRUCTION_FAILED,
+ // Unwind information is incorrect.
+ BACKTRACE_UNWIND_ERROR_UNWIND_INFO,
+ // Unwind information stopped due to sp/pc repeating.
+ BACKTRACE_UNWIND_ERROR_REPEATED_FRAME,
};
struct BacktraceUnwindError {
@@ -87,14 +91,6 @@ struct backtrace_frame_data_t {
// NULL.
};
-#if defined(__APPLE__)
-struct __darwin_ucontext;
-typedef __darwin_ucontext ucontext_t;
-#else
-struct ucontext;
-typedef ucontext ucontext_t;
-#endif
-
struct backtrace_stackinfo_t {
uint64_t start;
uint64_t end;
@@ -106,7 +102,16 @@ class Regs;
}
class Backtrace {
-public:
+ public:
+ enum ArchEnum : uint8_t {
+ ARCH_ARM,
+ ARCH_ARM64,
+ ARCH_X86,
+ ARCH_X86_64,
+ };
+
+ static void SetGlobalElfCache(bool enable);
+
// Create the correct Backtrace object based on what is to be unwound.
// If pid < 0 or equals the current pid, then the Backtrace object
// corresponds to the current process.
@@ -120,6 +125,16 @@ public:
static Backtrace* Create(pid_t pid, pid_t tid, BacktraceMap* map = NULL);
// Create an offline Backtrace object that can be used to do an unwind without a process
+ // that is still running. By default, information is only cached in the map
+ // file. If the calling code creates the map, data can be cached between
+ // unwinds. If not, all cached data will be destroyed when the Backtrace
+ // object is destroyed.
+ static Backtrace* CreateOffline(ArchEnum arch, pid_t pid, pid_t tid,
+ const std::vector<backtrace_map_t>& maps,
+ const backtrace_stackinfo_t& stack);
+ static Backtrace* CreateOffline(ArchEnum arch, pid_t pid, pid_t tid, BacktraceMap* map);
+
+ // Create an offline Backtrace object that can be used to do an unwind without a process
// that is still running. If cache_file is set to true, then elf information will be cached
// for this call. The cached information survives until the calling process ends. This means
// that subsequent calls to create offline Backtrace objects will continue to use the same
@@ -130,11 +145,11 @@ public:
virtual ~Backtrace();
// Get the current stack trace and store in the backtrace_ structure.
- virtual bool Unwind(size_t num_ignore_frames, ucontext_t* context = NULL) = 0;
+ virtual bool Unwind(size_t num_ignore_frames, void* context = NULL) = 0;
static bool Unwind(unwindstack::Regs* regs, BacktraceMap* back_map,
std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames,
- std::vector<std::string>* skip_names);
+ std::vector<std::string>* skip_names, BacktraceUnwindError* error = nullptr);
// Get the function name and offset into the function given the pc.
// If the string is empty, then no valid function name was found,
@@ -184,7 +199,7 @@ public:
std::string GetErrorString(BacktraceUnwindError error);
-protected:
+ protected:
Backtrace(pid_t pid, pid_t tid, BacktraceMap* map);
// The name returned is not demangled, GetFunctionName() takes care of
diff --git a/libbacktrace/include/backtrace/BacktraceMap.h b/libbacktrace/include/backtrace/BacktraceMap.h
index 4d020e6ad..e19c41396 100644
--- a/libbacktrace/include/backtrace/BacktraceMap.h
+++ b/libbacktrace/include/backtrace/BacktraceMap.h
@@ -34,6 +34,9 @@
#include <string>
#include <vector>
+// Forward declaration.
+struct backtrace_stackinfo_t;
+
// Special flag to indicate a map is in /dev/. However, a map in
// /dev/ashmem/... does not set this flag.
static constexpr int PROT_DEVICE_MAP = 0x8000;
@@ -58,7 +61,8 @@ public:
// is unsupported.
static BacktraceMap* Create(pid_t pid, bool uncached = false);
- static BacktraceMap* Create(pid_t pid, const std::vector<backtrace_map_t>& maps);
+ static BacktraceMap* CreateOffline(pid_t pid, const std::vector<backtrace_map_t>& maps,
+ const backtrace_stackinfo_t& stack);
virtual ~BacktraceMap();
diff --git a/libbacktrace/testdata/arm/offline_testdata b/libbacktrace/testdata/arm/offline_testdata
index 6acea2999..d5b8f4718 100644
--- a/libbacktrace/testdata/arm/offline_testdata
+++ b/libbacktrace/testdata/arm/offline_testdata
@@ -93,7 +93,7 @@ map: start: e8812000 end: e8813000 offset: 0 load_bias: 0 flags: 1 name:
map: start: e8813000 end: e8815000 offset: 0 load_bias: 0 flags: 3 name:
map: start: ff886000 end: ff8a9000 offset: 0 load_bias: 0 flags: 3 name: [stack]
map: start: ffff0000 end: ffff1000 offset: 0 load_bias: 0 flags: 5 name: [vectors]
-registers: 64 34868affdc8871e8150000001c0000001c000000150000000e00000007000000e08771e834868aff2354d2aa24f9ffffdc8871e88c8771e875b86ee778ba6ee7
+ucontext: 104 000000000000000000000000000000000000000000000000000000000000000034868affdc8871e8150000001c0000001c000000150000000e00000007000000e08771e834868aff2354d2aa24f9ffffdc8871e88c8771e875b86ee778ba6ee70000000000000000
stack: start: e8715000 end: e8719000 size: 16384 000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000dc8871e87dba6ee734868affdc8871e8dc8871e85dba6ee7070000000e000000150000001c000000dc8871e85dba6ee71c000000150000000e00000007000000100000000c0000000800000004000000ddb86ee75dba6ee7dc8871e804000000080000000c00000010000000dc8871e85dba6ee7100000000c000000080000000400000008000000060000000400000002000000288871e835b96ee75dba6ee7dc8871e802000000040000000600000008000000dc8871e85dba6ee70800000006000000040000000200000004000000030000000200000001000000708871e88db96ee75dba6ee7dc8871e801000000020000000300000004000000dc8871e85dba6ee70400000003000000020000000100000004000000208971e8208971e878000000e87d00003dba6ee75dba6ee7dc8871e878000000c5807ce7fc7183e734868aff78868aff78868aff34868aff34868aff78868affe0879437208971e84154d2aa0020000034868aff34868aff34868aff78000000c9b87ee7b1b87ee7a3f47be7288971e8b1b87ee7208971e800000000f83481e800000000e97d0000e87d000000000000005071e82039000000100000000000000000000000000000000000002354d2aa34868aff00000000002071e801000000000000000000000000000000708971e8208971e8000000000000000000000000e0879437000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
function: start: 0 end: e76eb835 name: unknown_start
function: start: e76eb835 end: e76eb88d name: test_level_four
diff --git a/libbacktrace/testdata/arm/offline_testdata_for_libGLESv2_adreno b/libbacktrace/testdata/arm/offline_testdata_for_libGLESv2_adreno
index 1f96834fa..d7c186e6f 100644
--- a/libbacktrace/testdata/arm/offline_testdata_for_libGLESv2_adreno
+++ b/libbacktrace/testdata/arm/offline_testdata_for_libGLESv2_adreno
@@ -1,6 +1,6 @@
pid: 7288 tid: 31656
-regs: pc: cc416235 sp: cc17f000
+ucontext: 104 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f017cc00000000356241cc0000000000000000
map: start: cc361000 end: cc758000 offset: 0 load_bias: 9000 flags: 5 name: /vendor/lib/egl/libGLESv2_adreno.so
-stack: start: cc17f254 end: cc17f258 size: 4 b36141cc
+stack: start: cc17f234 end: cc17f258 size: 36 0000000000000000000000000000000000000000000000000000000000000000b36141cc
function: start: be1f0 end: be304 name: EsxContext::Clear(unsigned int, unsigned int, unsigned int, EsxClearValues*)
function: start: be058 end: be1f0 name: EsxContext::ClearBuffersForDebug()
diff --git a/libbacktrace/testdata/arm/offline_testdata_for_libandroid_runtime b/libbacktrace/testdata/arm/offline_testdata_for_libandroid_runtime
index a12bc3c5b..54f352520 100644
--- a/libbacktrace/testdata/arm/offline_testdata_for_libandroid_runtime
+++ b/libbacktrace/testdata/arm/offline_testdata_for_libandroid_runtime
@@ -1,6 +1,6 @@
pid: 7288 tid: 31656
-regs: pc: f1f6dc49 sp: d8fe6930
+ucontext: 104 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003069fed80000000049dcf6f10000000000000000
map: start: f1f10000 end: f2049000 offset: 0 load_bias: 10000 flags: 5 name: /system/lib/libandroid_runtime.so
-stack: start: d8fe6954 end: d8fe6958 size: 4 e7dcf6f1
+stack: start: d8fe6948 end: d8fe6958 size: 16 000000000000000000000000e7dcf6f1
function: start: 6dbf9 end: 6dce5 name: android::AndroidRuntime::javaThreadShell
function: start: 6dce5 end: 6dd79 name: android::AndroidRuntime::javaCreateThreadEtc
diff --git a/libbacktrace/testdata/arm/offline_testdata_for_libart b/libbacktrace/testdata/arm/offline_testdata_for_libart
index db9bf8d8c..c1369ff6c 100644
--- a/libbacktrace/testdata/arm/offline_testdata_for_libart
+++ b/libbacktrace/testdata/arm/offline_testdata_for_libart
@@ -1,5 +1,5 @@
pid: 32232 tid: 32233
-registers: 64 000000000000000000000000000000006473602451b3e2e700000000d82fd1ff5600000000908eec00000000d42dd1ff00000000c02dd1ff617171e9617171e9
+ucontext: 104 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006473602451b3e2e700000000d82fd1ff5600000000908eec00000000d42dd1ff00000000c02dd1ff617171e9617171e90000000000000000
map: start: e9380000 end: e9766000 offset: 0 load_bias: b000 flags: 5 name: /system/lib/libart.so
stack: start: ffd12dc0 end: ffd1306c size: 684 00000000000c5024070000000300000005070a0a0100000051b3e2e700000000d82fd1ff560000004c2ed1ff000000000000000081b771e9d82fd1ff000000004c2ed1ff0c2ed1ff40a8d27024bf76e900908eec000000000834d1ff0000000000000000000000000d000000050000000000000000000000080000000101d1ff44b8bfeb4b0000000000000000000000e8b8952400000000fc2ed1ff4fb3e2e7bc49ac6f00908eecb02ed1ffd82fd1ff040000008c908eec942fd1ffd5c141e9d82fd1ff4fb3e2e7542fd1ff336c68e940000000400000007030d1fff031d1ff00000000bc49ac6f5c30d1ff942fd1ff842fd1ffd82fd1ff00000000b8f1786f4fb3e2e7610d67e9d82fd1ff4fb3e2e77880adeb7980adeb7a80adeb7b80adeb7c80adeb7d80adeb7e80adeb7f80adeb000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000007430d1ff02000000e8b89524e8d895240200000000908eec5c30d1ffbc49ac6f4fb3e2e74030d1ffe8d8952400000000b8f1786fbc49ac6f332367e94fb3e2e701000000637171e9637171e9000000005c30d1ff8430d1ffe0c08bec882fd1ff4fb3e2e70200000004000000942fd1ffe8b8952400908eec58d8952458d895247fbd69e90500000000400fe40100000000908eec58d89524060000009c86bd6f6b876fe900908eece0c08bec00008eec0000000000000000000000000000000044b8bfeb4b000000009be86f040000000038d1ff01000000c8e7446f060000000000000000908eec30d89524e8b895249c86bd6f7893476f00908eec00000000358c6fe970400fe4116e71e9a0285a6fa4d49c6f4489bd6f30d8952458d89524e8d8952400908eeca431d1ff2c31d1ffb75861e90100000000908eec30528bec409181e958d89524
function: start: 3a2121 end: 3a217a name: art_quick_invoke_stub_internal
diff --git a/libbacktrace/testdata/arm64/offline_testdata b/libbacktrace/testdata/arm64/offline_testdata
index 75a2f12d1..cee9f7202 100644
--- a/libbacktrace/testdata/arm64/offline_testdata
+++ b/libbacktrace/testdata/arm64/offline_testdata
@@ -95,7 +95,7 @@ map: start: 70160e1000 end: 70160e4000 offset: 0 load_bias: 0 flags: 3 name:
map: start: 70160e4000 end: 70160e5000 offset: 0 load_bias: 0 flags: 1 name:
map: start: 70160e5000 end: 70160e8000 offset: 0 load_bias: 0 flags: 3 name:
map: start: 7fd8baf000 end: 7fd8be6000 offset: 0 load_bias: 0 flags: 3 name: [stack]
-registers: 4560 679a0b1670000000f3eb6d705500000090f56e7055000000000000000000000000206f705500000014e0677055000000d038bed87f0000004cde67705500000041000000000000001900000000000000c00f241470000000d3aec914588f4bcd0400000000000000e493af157000000090f56e7055000000060000000000000023c00b1670000000b1d1fd15700000003039bed87f000000c898041670000000304cbed87f000000b8130e1670000000303cbed87f000000f838bed87f0000000e0000000000000015000000000000001c00000000000000ec59cf1570000000b863fd15700000005064fd15700000000000000000000000ec59cf15700000000200000000000000b863fd1570000000144abed87f0000006064fd15700000005064fd157000000000010000000000005826bed87f000000d86fcf15700000006057cf157000000000000000000000005064fd15700000005064fd15700000005064fd1570000000b67e00000000000040fd677055000000d064fd15700000000030fd157000000002000000000000000100000000000000fcb58a56000000000063fd15700000009857cf1570000000c062fd15700000001c5acf157000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000003003167000000001000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000033000000000000000300000000000000003303167000000008330316700000000000000006000000f8320316700000005839bed87f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000300000000000000c84cbed87f000000e84cbed87f000000984dbed87f00000078170e167000000002fd0000000000001400000000000000ff8100000100000000000000000000000000000000000000000000000000000078145700000000000010000000000000902b000000000000bdd04058000000000000000000000000bdd04058000000000000000000000000ccb58a560000000042487408000000000000000000000000cc57041670000000004704167000000010c0fd157000000010c0fd157000000090c0fd15700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000010000000000000002f48bed87f000000d3aec914588f4bcd2045bed87f0000002045bed87f0000002f48bed87f00000001000000000000002f000080000000005045bed87f0000000045bed87f000000c0a0c315700000006045bed87f0000006045bed87f000000010000000000000001000000000000000344bed87f00000001000000100000009c3fbed87f0000009b3fbed87f0000000344bed87f0000009a3fbed87f0000000100000000000000953fbed87f0000004344bed80100000001000000010000002c48bed87f0000000444bed87f0000004344bed80100000000000000000000000100000000000000b03fbed87f000000000000000200000000000000000000000000000000000000d3aec914588f4bcd000000000100000000000000000000000100000000000000f03fbed87f000000000000000200000000000000000000000000000000000000d3aec914588f4bcd00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a03fbed87f0000000000000000000000000000000000000000000000000000000000000000000000d3aec914588f4bcd08226f70550000000000000000000000000000000000000000000000000000001048bed87f0000008047bed87f0000006047bed87f000000e0ffffff80ffffff03000000000000000000000000000000891d6e7055000000d3aec914588f4bcd5047bed87f0000005047bed87f000000861d6e705500000003000000000000002f00008000000000f0a6ca15700000004047bed87f000000c0a0c31570000000891d6e7055000000d3aec914000000000100000000000000a047bed800000000f9006e70550000000100000000000000dc41bed87f000000db41bed87f0000004346bed87f000000da41bed87f0000000100000000000000d541bed87f00000001000000010000000100000001000000861d6e70550000004446bed87f0000002c42bed80300000000000000000000000100000000000000f041bed87f0000009b1e6e700100000000000000000000000000000000000000d3aec914588f4bcd8e1e6e70550000000d000000000000002f00008000000000f0a6ca15700000003048bed87f000000c0a0c31570000000661e6e700100000000000000000000002f000000000000001000000000000000e21e6e7055000000d3aec914588f4bcdb048bed87f000000b048bed87f000000e21e6e70550000002f000000000000002f00008000000000f0a6ca1570000000a048bed87f000000c0a0c315700000008e1e6e7055000000000000000000000022000000000000000000000000000000205827147000000022000000000000003c43bed87f0000003b43bed87f000000a347bed87f0000003a43bed87f00000001000000000000003543bed87f000000f048bed8010000000100000001000000dd1e6e7055000000a447bed87f0000008c43bed82f000000000000000000000001000000000000005043bed87f000000861d6e700300000000000000000000000000000000000000d3aec914588f4bcd721e6e7055000000f447bed87f000000981123141800000000000000000000000100000000000000a043bed87f000000861d6e70030000000000000000000000d042bed87f0000000000000000000000981123147000000098112314700000009811231470000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000504abed87f000000b049bed87f0000008049bed87f00000000000000000000004043bed87f0000000000000000000000991123147000000000000000000000008e1e6e70550000000d00000000000000a04abed87f000000000000000000000000000000000000000000000000000000504abed87f000000e049bed87f000000a049bed87f000000c8ffffff80ffffff591e6e70550000000d0000000000000098112314700000000000000000000000df1e6e7055000000010000000000000020582714700000002200000000000000f049bed87f000000c8ffffff80ffffff9811231470000000980023147000000098112314700000009811231470000000741e6e7055000000060000000000000009f12914700000000c00000000000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b149bed87f000000b149bed87f000000f049be317f000000f049bed87f000000f049bed87f000000b149bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000b049bed87f000000f149bed87f000000f049bed87f000000d3aec914588f4bcdfcb58a56000000006cbb687055000000160000000000000098112314700000009911231470000000991123147000000098112314700000009911231470000000fcb58a5600000000010000000000000000000000000000000100000000000000604a050000000000e845bed87f0000006048bed87f000000a046bed87f00000017000000000000002c48bed87f0000009046bed87f000000ac73c515700000009911231470000000d3aec914588f4bcd1048bed87f0000008047bed87f0000006047bed87f000000e8ffffff80ffffffffffffffffffffff99112314700000006148bed87f000000981123141500000008020000ffffffff6048bed87f000000160000000000000058112314700000001700000000000000a849bed87f0000000000000000000000284abed87f0000001700000000000000284abed87f000000284abed87f000000d249bed87f00000001000000000000009a112314700000001600000000000000284abed87f000000ffffffffffffffff284abed87f000000284abed87f000000284abed87f000000284abed87f0000001700000000000000ffffffffffffffff284abed87f000000284abed87f000000ff49bed87f000000284abed87f00000000000000000000000000000000000000d049bed87f000000d049bed87f000000004abed87f000000d049bed87f0000000100000000000000d049bed87f000000d049bed87f000000d049bed87f00000017000000000000000100000000000000ffffffffffffffff991123147000000001000000000000003448bed87f0000009911231470000000b0ca687055000000ffffffffffffffff010000000000000099112314700000007047bed87f000000d3aec914588f4bcdfcb58a56000000000100000000000000000000000000000050226f70550000000000000000000000b44b05000000000000102a1470000000861d6e70550000000300000000000000f0a6ca1570000000a047bed87f0000006c79c31570000000f048bed87f0000008048bed87f0000004048bed87f000000c8ffffff80ffffff0000000000000000d3aec914588f4bcdf849bed87f000000f0a6ca15700000000200000000000000085b0e1670000000e048bed87f0000002c6fc515700000009048bed87f000000d3aec914588f4bcd0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a89912314700000000000000000000000e9216f70550000008991231470000000e449bed87f0000008991231470000000000000000000000000000000000000008891231470000000899123147000000089912314700000008891231470000000170000000000000088912314700000008891231470000000d3aec914588f4bcd899123147000000016000000000000000000000000000000e9216f705500000088912314700000008891231470000000889123147000000088912314700000008891231470000000f0a6ca15700000000049bed87f0000006c79c31570000000889123147000000088912314700000008891231470000000889123147000000088912314700000008891231470000000889123147000000089912314700000008991231470000000085b0e1670000000404abed87f0000002c6fc51570000000c80a6f7055000000d3aec914588f4bcd0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a0a3b3325736d001b5b6d002c20776865726520002573203d202573000a526570650000000000000000000000000000000000000000000000008891231470000000000000000000000088912314700000008891231470000000889123147000000088912314700000000000000000000000889123147000000088912314700000008891231470000000470000000000000000502a1470000000d3aec914588f4bcdf05727147000000000b2221470000000604abed87f0000005c716c7055000000fcb58a56000000007c706c7055000000fcb58a5600000000ea4b050000000000
+ucontext: 464 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f838bed87f0000000e0000000000000015000000000000001c00000000000000ec59cf1570000000b863fd15700000005064fd15700000000000000000000000ec59cf15700000000200000000000000b863fd1570000000144abed87f0000006064fd15700000005064fd157000000000010000000000005826bed87f000000d86fcf15700000006057cf157000000000000000000000005064fd15700000005064fd15700000005064fd1570000000b67e00000000000040fd677055000000d064fd15700000000030fd157000000002000000000000000100000000000000fcb58a56000000000063fd15700000009857cf1570000000c062fd15700000001c5acf157000000000000000000000000000000000000000
stack: start: 7015fd3000 end: 7015fd7000 size: 16384 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000f838bed87f0000004038bed87f000000b863fd1570000000b863fd1570000000b863fd1570000000ec59cf15700000001c000000150000000e000000070000003063fd15700000001c58cf1570000000b863fd1570000000ec59cf1570000000100000000c00000008000000040000006063fd15700000007c58cf1570000000b863fd1570000000ec59cf1570000000080000000600000004000000020000009063fd1570000000dc58cf1570000000b863fd1570000000ec59cf157000000004000000030000000200000001000000d063fd1570000000c459cf15700000000100000000000000144abed87f0000004038bed87f0000004038bed87f000000144abed87f000000d3aec914588f4bcd1064fd157000000074fd6770550000004038bed87f0000004038bed87f000000ec84c41570000000e484c41570000000c484c4157000000000000000000000004064fd15700000004015c01570000000b67e0000000000000000000000000000705a0e1670000000185b0e167000000000000000000000000000000000000000705a0e16700000000000000000000000b77e0000b67e000000000000550000000030fd157000000050340000000000000010000000000000000000000000000000b222147000000000102a14700000000000000000000000000000000000000040fd6770550000004038bed87f000000000000000000000000a0fa1570000000010000000000000000000000000000000000000000000000e864fd15700000005064fd1570000000000000000000000000000000000000000000000000000000d3aec914588f4bcd0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
function: start: 0 end: 7015cf5760 name: unknown_start
function: start: 7015cf5760 end: 7015cf57cc name: test_level_four
diff --git a/libbacktrace/testdata/arm64/offline_testdata_for_eglSubDriverAndroid b/libbacktrace/testdata/arm64/offline_testdata_for_eglSubDriverAndroid
index dfad1725c..673e30e1d 100644
--- a/libbacktrace/testdata/arm64/offline_testdata_for_eglSubDriverAndroid
+++ b/libbacktrace/testdata/arm64/offline_testdata_for_eglSubDriverAndroid
@@ -1,6 +1,6 @@
pid: 12276 tid: 12303
-regs: pc: 7b8c027f64 sp: 7b8c157010 x29: 7b8c157040
map: start: 7b8c01e000 end: 7b8c030000 offset: 0 load_bias: 0 flags: 5 name: /vendor/lib64/egl/eglSubDriverAndroid.so
-stack: start: 7b8c157048 end: 7b8c157050 size: 8 547e028c7b000000
+ucontext: 464 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004070158c7b00000000000000000000001070158c7b000000647f028c7b00000000000000000000000000000000000000
+stack: start: 7b8c157020 end: 7b8c157050 size: 48 00000000000000000000000000000000000000000000000000000000000000000000000000000000547e028c7b000000
function: start: 9ed8 end: a1b0 name: EglAndroidWindowSurface::Initialize(EglAndroidConfig*, int const*)
function: start: 9dcc end: 9ed8 name: EglAndroidWindowSurface::Create(ANativeWindow*, EglAndroidConfig*, EglAndroidWindowSurface**, int const*)
diff --git a/libbacktrace/testdata/arm64/offline_testdata_for_libskia b/libbacktrace/testdata/arm64/offline_testdata_for_libskia
index 1027c5573..da820c0bd 100644
--- a/libbacktrace/testdata/arm64/offline_testdata_for_libskia
+++ b/libbacktrace/testdata/arm64/offline_testdata_for_libskia
@@ -1,6 +1,6 @@
pid: 32232 tid: 32233
-regs: pc: 7c25189a0c sp: 7b8c154b50 x29: 7b8c154bb0
map: start: 7c24c80000 end: 7c25413000 offset: 0 load_bias: 5f000 flags: 5 name: /system/lib64/libskia.so
-stack: start: 7b8c154bb8 end: 7b8c154bc0 size: 8 ec43f2247c000000
+ucontext: 464 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b04b158c7b0000000000000000000000504b158c7b0000000c9a18257c00000000000000000000000000000000000000
+stack: start: 7b8c154b80 end: 7b8c154bc0 size: 64 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ec43f2247c000000
function: start: 568970 end: 568c08 name: SkScalerContext_FreeType::generateImage(SkGlyph const&)
function: start: 30330c end: 3044b0 name: SkScalerContext::getImage(SkGlyph const&)
diff --git a/libbacktrace/testdata/x86/offline_testdata b/libbacktrace/testdata/x86/offline_testdata
index e8b7a9937..920b3385b 100644
--- a/libbacktrace/testdata/x86/offline_testdata
+++ b/libbacktrace/testdata/x86/offline_testdata
@@ -70,7 +70,7 @@ map: start: f77d4000 end: f77d5000 offset: 320000 load_bias: 0 flags: 3 name: /s
map: start: f77d5000 end: f77d6000 offset: 0 load_bias: 0 flags: 3 name:
map: start: f7ec6000 end: f7ee7000 offset: 0 load_bias: 0 flags: 3 name: [heap]
map: start: ffe4e000 end: ffe70000 offset: 0 load_bias: 0 flags: 3 name: [stack]
-registers: 348 00000000abdae6fff83b7df704000000a6ec77f7abdae6ff00000000afdae6ff78dae6ff150000001c000000b8f132f7a0f132f7d0df48f7a0ca48f728d9e6ff000000008c8decf78c8decf7ceca48f7a8dae6ff8d8decf70a0000000000000014dae6ff8c8decf78c8decf78c8decf78c8decf78c8decf7a9dae6ff06000000c03a23f78c8decf78c8decf78c8decf78c8decf78c8decf78c8decf78c8decf78d8decf78d8decf7c03a23f7543b23f7000033f75f5f0ff7c03a23f7503423f77000000098000000020000000f2700006c0000000e00000080000000000000008c8decf7000000008c8decf77f03ffff0000ffffffffffff0000000000000000000000000000ffff040000000f27000008000000003023f78d8decf7f069ec000046bdaa308decf715537df7f83b7df78c8decf74c1c71f78c8decf715537df70000000000000000f069ecf7f83b7df75064ecf792e671f7f069ecf7
+ucontext: 96 0000000000000000000000000000000000000000abdae6ff00000000afdae6ff78dae6ff150000001c000000b8f132f7a0f132f7d0df48f7a0ca48f728d9e6ff000000000000000000000000ceca48f7a8dae6ff000000000000000000000000
stack: start: f732c000 end: f7330000 size: 16384 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000009d9d49f761b009f71e382ff7000000000000000000000000000000000000000002000000f6372ff704c82bf70000000000204bf7f0a908f7ceca48f728d9e6fff4a449f70000000020f332f720f332f7d0df48f7f8f132f794c748f720f332f70c144205978142a8d4be08f7d0df48f720f332f7a0ca48f71c000000150000000e000000070000001c000000a0ca48f7d0df48f748f232f739c848f7070000000e000000150000001c000000a0ca48f720f332f70000000000000000d0df48f720f332f7a0ca48f7100000000c000000080000000400000010000000a0ca48f7d0df48f798f232f7c9c848f704000000080000000c00000010000000a0ca48f720f332f70000000000000000d0df48f720f332f7a0ca48f70800000006000000040000000200000008000000a0ca48f7d0df48f7e8f232f759c948f702000000040000000600000008000000a0ca48f720f332f70000000000000000d0df48f720f332f7a0ca48f7040000000300000002000000010000000046bdaa00000000d0df48f738f332f77cca48f701000000020000000300000004000000a0ca48f720f332f700000000f83b7df7696d4df7d0df48f788dae6ff28d9e6ff28d9e6ff88dae6ff58f332f70046bdaa40fb32f7f83b7df758f332f78d6d4df728d9e6ff88dae6fff83b7df728d9e6ff28d9e6ff009030f728f432f7726f2ff728d9e6ff40fb32f740fb32f740fb32f790f332f700000000000000000000000000000000000000000000000000000000009030f740fb32f7000f3d0028f432f703b12c75032f144e0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a06e2ff700000000000f3d00000000008e3f17f740fb32f7000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a03823f7c4fd32f700000000e0341df7e02e1df7e03d1df70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000040fb32f7188eecf740fb32f70100000030647cf70046bdaa28658876000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000060a705f7a4b130f7f2860000f1860000b0fb32f7ecffffff000000000000000090f332f7000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000ccfb32f70000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000c2638cfa7f3e1d0000000000000000000000000000000000406d4df728d9e6ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c032f7004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
function: start: 0 end: f748c740 name: unknown_start
function: start: f748c740 end: f748c7c0 name: test_level_four
diff --git a/libbacktrace/testdata/x86_64/offline_testdata b/libbacktrace/testdata/x86_64/offline_testdata
index f8d0dc0a0..c6bb24161 100644
--- a/libbacktrace/testdata/x86_64/offline_testdata
+++ b/libbacktrace/testdata/x86_64/offline_testdata
@@ -81,7 +81,7 @@ map: start: 7fd5ad54e000 end: 7fd5ad56f000 offset: 0 load_bias: 0 flags: 3 name:
map: start: 7ffcf47ed000 end: 7ffcf480f000 offset: 0 load_bias: 0 flags: 3 name: [stack]
map: start: 7ffcf48d5000 end: 7ffcf48d7000 offset: 0 load_bias: ffffffffff700000 flags: 5 name: [vdso]
map: start: ffffffffff600000 end: ffffffffff601000 offset: 0 load_bias: 0 flags: 5 name: [vsyscall]
-registers: 936 010000000000000028b480f4fc7f000028b480f4fc7f000028b480f4fc7f0000b92455add57f0000b07bcfabd57f000098deb6abd57f0000b82455add57f0000010000000000000000000000000000000000000000000000c0e354add57f000000e7b6abd57f0000c8b080f4fc7f00000e0000000000000080ddb6abd57f000000000000000000001500000000000000b07bcfabd57f00001c0000000000000060ddb6abd57f0000d07bcfabd57f0000a0b180f4fc7f000028b480f4fc7f000028b480f4fc7f000028b480f4fc7f000078b480f4fc7f000078b480f4fc7f00007f03ffff0000ffffffffffff000000000000000000000000801f0000fc7f000078b480f4fc7f000060b280f4fc7f000000006a80f3f73cf110b480f4fc7f0000de66d6abd57f00000000000000000000000000000000000000006a80f3f73cf128b480f4fc7f0000782455add57f0000fd96d6abd57f0000092555add57f0000000000000000000057b480f4fc7f0000092555add57f000060b480f4fc7f00006994d6abd57f0000b0e0c6abd57f000071b280f4fc7f000070b280f4fc7f0000256c640000000000a8b180f4fc7f000090b480f4fc7f0000082555add57f0000092555add57f0000092555add57f0000082555add57f00001700000000000000082555add57f0000082555add57f0000f93cfcabd57f0000092555add57f000016000000000000000000000000000000090c07acd57f0000082555add57f0000082555add57f0000082555add57f0000082555add57f0000082555add57f000010b380f4fc7f000078b480f4fc7f00000000000000000000082555add57f0000082555add57f0000082555add57f0000082555add57f0000082555add57f0000082555add57f0000082555add57f0000092555add57f0000092555add57f0000b92455add57f000028b480f4fc7f0000c800000000000000014c7f0b0380ffff0d000000fc7f0000030000000000000033000000d57f000000b480f4fc7f00000000000000000000a0e154ad5b000000000000000000000000000000000000006e000000770000000000000000000000082555add57f00000000000000000000082555add57f0000082555add57f0000082555add57f0000082555add57f00000000000000000000082555add57f0000082555add57f0000082555add57f00006027b4aad57f0000c800000000000000a0e154add57f0000c0e354add57f0000092555add57f000000006a80f3f73cf1e0e054add57f0000e0e554add57f0000d14df6abd57f0000
+ucontext: 224 00000000000000000000000000000000000000000000000000000000000000000000000000000000b07bcfabd57f000098deb6abd57f0000b82455add57f0000010000000000000000000000000000000000000000000000c0e354add57f000000e7b6abd57f0000c8b080f4fc7f00000e0000000000000080ddb6abd57f000000000000000000001500000000000000b07bcfabd57f00001c0000000000000060ddb6abd57f0000d07bcfabd57f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
stack: start: 7fd5abb6b000 end: 7fd5abb6f000 size: 16384 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006c4eaeabd57f00000000000000000000978142a8000000000f0000000000000012000000000000003888b4abd57f0000e657aeabd57f00000000000000000000a0dcb6abd57f0000307d78aad57f0000b0ddb6abd57f000028d978aad57f0000060aa10200000000a0ddb6abd57f0000000000000000000000000000000000002091b1abd57f0000e094b4abd57f000017008cabd57f0000c84d79aad57f000028e28babd57f00000000000005000000d503000001000000000000000000000068deb6abd57f000040deb6abd57f00002091b1abd57f00000100000000000000e0f3c6abd57f000088f0c6abd57f00006159aeabd57f000000000000000000002091b1abd57f000005000000000000000000000000000000010000000000000088f0c6abd57f00000000000000000000d07bcfabd57f00000000000000000000000000000000000098deb6abd57f000098deb6abd57f0000b0ddb6abd57f00006179cfabd57f000098deb6abd57f0000b07bcfabd57f00001c000000150000000e00000007000000f0ddb6abd57f0000e179cfabd57f00000000000000000000150000001c00000098deb6abd57f0000b07bcfabd57f0000100000000c000000080000000400000030deb6abd57f0000417acfabd57f000000000000000000000c0000001000000098deb6abd57f0000b07bcfabd57f00000800000006000000040000000200000070deb6abd57f0000a17acfabd57f00000000000000000000060000000800000098deb6abd57f0000b07bcfabd57f000004000000030000000200000001000000b0deb6abd57f0000817bcfabd57f0000000000000000000074b480f4fc7f0000c8b080f4fc7f0000c8b080f4fc7f000074b480f4fc7f000000006a80f3f73cf1d0deb6abd57f00002a52d5abd57f0000c8b080f4fc7f0000c8b080f4fc7f0000000000000000000084518cabd57f0000000000000000000000e7b6abd57f000000e7b6abd57f00008f990b1e3bad5a6700000000000000000000000000000000c0e354add57f000000e7b6abd57f00008f99cba356faf1988f9991bc23faf1980000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e7b6abd57f00007de387aad57f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000006030b4aad57f0000b8edb6abd57f00000000000000000000000000000000000080b88eaad57f0000000000000000000080b28eaad57f0000000000000000000080c18eaad57f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e7b6abd57f0000402555add57f000000e7b6abd57f00000100000000000000000000000000000000006a80f3f73cf1058f9d56adb3c7cc000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000407ab1abd57f000030a3adabd57f00005c64000053640000e0e9b6abd57f0000e0e9b6abd57f0000e0ffffffffffffff00000000000000000000000000000000f0deb6abd57f00000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010eab6abd57f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000c46ad90f52391d00000000000000000000000000000000000000000000000000f051d5abd57f0000c8b080f4fc7f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b0b6abd57f000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
function: start: 0 end: 7fd5abcf7930 name: unknown_start
function: start: 7fd5abcf7930 end: 7fd5abcf7990 name: test_level_four