aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/pdb
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2020-03-21 20:18:19 +0300
committerEgor Tensin <Egor.Tensin@gmail.com>2020-03-21 20:19:38 +0300
commit5dc92e796291992dd81567cf5cb58624f58d0e43 (patch)
treee67905a908486d1aa55fefc15df40b40f43346e6 /include/pdb
parenttest: foobar -> symbols (diff)
downloadwinapi-debug-5dc92e796291992dd81567cf5cb58624f58d0e43.tar.gz
winapi-debug-5dc92e796291992dd81567cf5cb58624f58d0e43.zip
CallStack: overhaul the API
Diffstat (limited to 'include/pdb')
-rw-r--r--include/pdb/call_stack.hpp14
1 files changed, 9 insertions, 5 deletions
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 <array>
#include <cstddef>
+#include <functional>
+#include <ostream>
#include <string>
namespace pdb {
@@ -31,6 +33,13 @@ public:
static CallStack capture();
+ using AddressCallback = std::function<bool(Address)>;
+ 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<Address, max_length> 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