From 5dc92e796291992dd81567cf5cb58624f58d0e43 Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Sat, 21 Mar 2020 20:18:19 +0300 Subject: CallStack: overhaul the API --- include/pdb/call_stack.hpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'include') diff --git a/include/pdb/call_stack.hpp b/include/pdb/call_stack.hpp index 968b1b8..f0e13af 100644 --- a/include/pdb/call_stack.hpp +++ b/include/pdb/call_stack.hpp @@ -14,6 +14,8 @@ #include #include +#include +#include #include namespace pdb { @@ -31,6 +33,13 @@ public: static CallStack capture(); + using AddressCallback = std::function; + bool for_each_address(const AddressCallback& callback) const; + + static std::string pretty_print_address(const DbgHelp& dbghelp, Address addr); + + void dump(std::ostream& os, const DbgHelp&) const; + const std::array frames; const std::size_t length; @@ -38,9 +47,4 @@ private: CallStack() = default; }; -namespace call_stack { - -std::string pretty_print_address(const DbgHelp& dbghelp, Address addr); - -} // namespace call_stack } // namespace pdb -- cgit v1.2.3