summaryrefslogtreecommitdiff
path: root/libunwindstack/Unwinder.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libunwindstack/Unwinder.cpp')
-rw-r--r--libunwindstack/Unwinder.cpp21
1 files changed, 14 insertions, 7 deletions
diff --git a/libunwindstack/Unwinder.cpp b/libunwindstack/Unwinder.cpp
index f6def23..facff86 100644
--- a/libunwindstack/Unwinder.cpp
+++ b/libunwindstack/Unwinder.cpp
@@ -145,6 +145,7 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
uint64_t step_pc;
uint64_t rel_pc;
Elf* elf;
+ bool ignore_frame = false;
if (map_info == nullptr) {
step_pc = regs_->pc();
rel_pc = step_pc;
@@ -155,7 +156,11 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
}
elf = nullptr;
} else {
- if (ShouldStop(map_suffixes_to_ignore, map_info->name())) {
+ ignore_frame =
+ initial_map_names_to_skip != nullptr &&
+ std::find(initial_map_names_to_skip->begin(), initial_map_names_to_skip->end(),
+ android::base::Basename(map_info->name())) != initial_map_names_to_skip->end();
+ if (!ignore_frame && ShouldStop(map_suffixes_to_ignore, map_info->name())) {
break;
}
elf = map_info->GetElf(process_memory_, arch_);
@@ -186,9 +191,7 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
}
FrameData* frame = nullptr;
- if (map_info == nullptr || initial_map_names_to_skip == nullptr ||
- std::find(initial_map_names_to_skip->begin(), initial_map_names_to_skip->end(),
- android::base::Basename(map_info->name())) == initial_map_names_to_skip->end()) {
+ if (!ignore_frame) {
if (regs_->dex_pc() != 0) {
// Add a frame to represent the dex file.
FillInDexFrame();
@@ -296,8 +299,12 @@ void Unwinder::Unwind(const std::vector<std::string>* initial_map_names_to_skip,
}
std::string Unwinder::FormatFrame(const FrameData& frame) const {
+ return FormatFrame(arch_, frame, display_build_id_);
+}
+
+std::string Unwinder::FormatFrame(ArchEnum arch, const FrameData& frame, bool display_build_id) {
std::string data;
- if (ArchIs32Bit(arch_)) {
+ if (ArchIs32Bit(arch)) {
data += android::base::StringPrintf(" #%02zu pc %08" PRIx64, frame.num, frame.rel_pc);
} else {
data += android::base::StringPrintf(" #%02zu pc %016" PRIx64, frame.num, frame.rel_pc);
@@ -334,7 +341,7 @@ std::string Unwinder::FormatFrame(const FrameData& frame) const {
data += ')';
}
- if (map_info != nullptr && display_build_id_) {
+ if (map_info != nullptr && display_build_id) {
std::string build_id = map_info->GetPrintableBuildID();
if (!build_id.empty()) {
data += " (BuildId: " + build_id + ')';
@@ -347,7 +354,7 @@ std::string Unwinder::FormatFrame(size_t frame_num) const {
if (frame_num >= frames_.size()) {
return "";
}
- return FormatFrame(frames_[frame_num]);
+ return FormatFrame(arch_, frames_[frame_num], display_build_id_);
}
void Unwinder::SetJitDebug(JitDebug* jit_debug) {