diff options
Diffstat (limited to 'include/winapi/debug/symbol.hpp')
| -rw-r--r-- | include/winapi/debug/symbol.hpp | 52 |
1 files changed, 40 insertions, 12 deletions
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; |
