1 parent
e7186f17f0
commit
f0825fbd1a
13 files changed
+105
-36
No files matched your search
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <ostream>
|
||||
|
||||
namespace Void::Stacktrace {
|
||||
struct StackFrame {
|
||||
std::string function_name;
|
||||
std::string source_file;
|
||||
int source_line{0};
|
||||
std::string source_snippet;
|
||||
};
|
||||
|
||||
std::vector<StackFrame> capture_stacktrace(unsigned skip_frames = 0, unsigned max_frames = 32);
|
||||
std::string read_source_snippet(const std::string& file, int line, int context_lines = 3);
|
||||
std::string format_stacktrace(const std::vector<StackFrame>& frames);
|
||||
void print_stacktrace(std::ostream& os, const std::vector<StackFrame>& frames);
|
||||
} // namespace Void::Stacktrace
|
||||
Reference in new issue
Block a user