From ed597441678604f6bf44513532ad282e4d5593be Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Mon, 14 Sep 2020 04:51:52 +0300 Subject: unit_tests: more call stack tests --- include/pdb/address.hpp | 4 ++++ include/pdb/call_stack.hpp | 5 +++++ 2 files changed, 9 insertions(+) (limited to 'include/pdb') diff --git a/include/pdb/address.hpp b/include/pdb/address.hpp index fa692ad..f7a7239 100644 --- a/include/pdb/address.hpp +++ b/include/pdb/address.hpp @@ -20,6 +20,10 @@ inline std::string format_address(Address address) { return oss.str(); } +inline std::string format_address(void* address) { + return format_address(reinterpret_cast
(address)); +} + inline bool parse_address(Address& dest, const std::string& src) { std::istringstream iss{src}; iss >> std::hex; diff --git a/include/pdb/call_stack.hpp b/include/pdb/call_stack.hpp index f0e13af..ef4c119 100644 --- a/include/pdb/call_stack.hpp +++ b/include/pdb/call_stack.hpp @@ -43,6 +43,11 @@ public: const std::array frames; const std::size_t length; + const Address* begin() const { return frames.data(); } + const Address* cbegin() const { return begin(); } + const Address* end() const { return begin() + length; } + const Address* cend() const { return end(); } + private: CallStack() = default; }; -- cgit v1.2.3