diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-12 22:59:04 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-12 22:59:04 +0200 |
| commit | eba873815bbb803fb298e3fb07502d22e3c5df6e (patch) | |
| tree | 47794c27c6a4c1245b6ae14024dcf0f068605209 /include/winapi/debug | |
| parent | cmake: use CONFIGURE_DEPENDS (diff) | |
| download | winapi-debug-eba873815bbb803fb298e3fb07502d22e3c5df6e.tar.gz winapi-debug-eba873815bbb803fb298e3fb07502d22e3c5df6e.zip | |
unify my .clang-format files
Diffstat (limited to '')
| -rw-r--r-- | include/winapi/debug/call_stack.hpp | 23 | ||||
| -rw-r--r-- | include/winapi/debug/dbghelp.hpp | 9 | ||||
| -rw-r--r-- | include/winapi/debug/module.hpp | 17 | ||||
| -rw-r--r-- | include/winapi/debug/symbol.hpp | 52 |
4 files changed, 78 insertions, 23 deletions
diff --git a/include/winapi/debug/call_stack.hpp b/include/winapi/debug/call_stack.hpp index a9a9d43..caa9226 100644 --- a/include/winapi/debug/call_stack.hpp +++ b/include/winapi/debug/call_stack.hpp @@ -38,12 +38,25 @@ public: void dump(std::ostream& os, const DbgHelp&) const; - std::size_t length() const { return _length; } + std::size_t length() const { + return _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(); } + 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; diff --git a/include/winapi/debug/dbghelp.hpp b/include/winapi/debug/dbghelp.hpp index 8fc2cda..907c705 100644 --- a/include/winapi/debug/dbghelp.hpp +++ b/include/winapi/debug/dbghelp.hpp @@ -18,8 +18,13 @@ namespace winapi { class DbgHelp { public: - static DbgHelp current_process() { return DbgHelp{true}; } - static DbgHelp post_mortem() { return DbgHelp{false}; } + static DbgHelp current_process() { + return DbgHelp{true}; + } + + static DbgHelp post_mortem() { + return DbgHelp{false}; + } void swap(DbgHelp& other) noexcept; diff --git a/include/winapi/debug/module.hpp b/include/winapi/debug/module.hpp index 0437ddb..591bcb5 100644 --- a/include/winapi/debug/module.hpp +++ b/include/winapi/debug/module.hpp @@ -21,10 +21,17 @@ public: ModuleInfo(); explicit ModuleInfo(const Impl& impl); - explicit operator Impl&() { return impl; } - explicit operator const Impl&() const { return impl; } + explicit operator Impl&() { + return impl; + } - Address get_offline_base() const { return impl.BaseOfImage; } + explicit operator const Impl&() const { + return impl; + } + + Address get_offline_base() const { + return impl.BaseOfImage; + } std::string get_name() const; @@ -39,7 +46,9 @@ public: Module(Address online_base, const ModuleInfo& info) : ModuleInfo{info}, online_base{online_base} {} - Address get_online_base() const { return online_base; } + Address get_online_base() const { + return online_base; + } Address translate_offline_address(Address offline) const; Address translate_online_address(Address online) const; diff --git a/include/winapi/debug/symbol.hpp b/include/winapi/debug/symbol.hpp index 828a040..cefb6c2 100644 --- a/include/winapi/debug/symbol.hpp +++ b/include/winapi/debug/symbol.hpp @@ -39,27 +39,48 @@ public: SymbolInfo(); explicit SymbolInfo(const Impl& impl); - explicit operator Impl&() { return get_impl(); } - explicit operator const Impl&() const { return get_impl(); } + explicit operator Impl&() { + return get_impl(); + } - Address get_displacement() const { return displacement; } - void set_displacement(Address new_value) { displacement = new_value; } + explicit operator const Impl&() const { + return get_impl(); + } + + Address get_displacement() const { + return displacement; + } + + void set_displacement(Address new_value) { + displacement = new_value; + } std::string get_name() const; - Address get_offline_base() const { return get_impl().ModBase; } - Address get_offline_address() const { return get_impl().Address; } + Address get_offline_base() const { + return get_impl().ModBase; + } - symbol::Tag get_tag() const { return get_impl().Tag; } + Address get_offline_address() const { + return get_impl().Address; + } + + symbol::Tag get_tag() const { + return get_impl().Tag; + } enum class Type : symbol::Tag { Function = symbol::SYM_TAG_FUNCTION, RESERVED = ULONG_MAX, }; - Type get_type() const { return static_cast<Type>(get_tag()); } + Type get_type() const { + return static_cast<Type>(get_tag()); + } - bool is_function() const { return get_type() == Type::Function; } + bool is_function() const { + return get_type() == Type::Function; + } private: static constexpr std::size_t char_size = sizeof(std::remove_extent<decltype(Impl::Name)>::type); @@ -69,8 +90,13 @@ private: std::array<unsigned char, max_buffer_size> buffer; Address displacement = 0; - const Impl& get_impl() const { return *reinterpret_cast<const Impl*>(buffer.data()); } - Impl& get_impl() { return *reinterpret_cast<Impl*>(buffer.data()); } + const Impl& get_impl() const { + return *reinterpret_cast<const Impl*>(buffer.data()); + } + + Impl& get_impl() { + return *reinterpret_cast<Impl*>(buffer.data()); + } }; class Symbol : public SymbolInfo { @@ -78,7 +104,9 @@ public: Symbol(Address online_address, const SymbolInfo& info) : SymbolInfo{info}, online_address{online_address} {} - Address get_online_address() const { return online_address; } + Address get_online_address() const { + return online_address; + } private: const Address online_address; |
