Skip to content

Commit

Permalink
remove frames before main method
Browse files Browse the repository at this point in the history
  • Loading branch information
gammasoft71 committed Oct 22, 2024
1 parent cfcce23 commit 3cd69a7
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ namespace {
private:
void OnCallstackEntry(CallstackEntryType type, CallstackEntry& entry) override {
StackWalker::OnCallstackEntry(type, entry);
if (need_file_info_) frames_.push_back(make_tuple(entry.lineFileName, entry.lineNumber, entry.offsetFromLine, entry.name, static_cast<size_t>(entry.offsetFromSmybol)));
else frames_.push_back(make_tuple("", 0, 0, entry.name, 0));
if (!need_file_info_) frames_.push_back(make_tuple("", 0, 0, entry.name, 0));
else frames_.push_back(make_tuple(entry.lineFileName, entry.lineNumber, entry.offsetFromLine, entry.name, static_cast<size_t>(entry.offsetFromSmybol)));
}

private:
Expand All @@ -47,8 +47,9 @@ stack_trace::frames stack_trace::get_frames(size_t skip_frames, bool need_file_i
auto result = stack_trace::frames {};
auto frames = sw.get_frames();
for (auto index = skip_frames + native_offset; index < frames.size(); ++index) {
if (get<3>(frames[index]) == "invoke_main") break;
if (get<3>(frames[index]) == "start") break;
result.push_back(frames[index]);
if (get<3>(frames[index]) == "main") break;
}
return result;
}

0 comments on commit 3cd69a7

Please sign in to comment.