From 66000c76d2c192df515d7a06af605587462d60be Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 8 Feb 2025 01:38:42 +0100 Subject: feat: disassembly --- src/debugger/debugger.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/debugger/debugger.h') diff --git a/src/debugger/debugger.h b/src/debugger/debugger.h index a62a9bd..04b5e61 100644 --- a/src/debugger/debugger.h +++ b/src/debugger/debugger.h @@ -40,6 +40,7 @@ namespace Hsdbg auto add_breakpoint(const std::filesystem::path& file, uint32_t line) -> uint32_t; auto add_function_breakpoint(std::string_view function) -> uint32_t; + auto add_address_breakpoint(uint64_t file_address) -> uint32_t; auto remove_breakpoint(uint32_t id) -> bool; auto set_breakpoint_enabled(uint32_t id, bool enabled) -> bool; auto set_breakpoint_condition(uint32_t id, std::string_view condition) -> bool; @@ -52,14 +53,19 @@ namespace Hsdbg auto call_stack() const -> std::span { return m_call_stack; } auto locals() const -> std::span { return m_locals; } auto registers() const -> std::span { return m_registers; } + auto symbols() const -> std::span { return m_symbols; } + auto disassembly() const -> std::span { return m_disassembly; } + auto disassembly_name() const -> std::string_view { return m_disassembly_name; } auto evaluate(std::string_view expression) -> Result; auto read_memory(uint64_t address, size_t size) -> Result>; auto console_output() const -> std::span { return m_console_output; } auto select_thread(uint64_t thread_id) -> bool; auto select_frame(uint32_t frame_index) -> bool; + auto select_symbol(uint64_t file_address) -> bool; auto selected_thread() const -> uint64_t { return m_selected_thread; } auto selected_frame() const -> uint32_t { return m_selected_frame; } + auto selected_symbol() const -> uint64_t { return m_selected_symbol; } auto update() -> void; @@ -90,6 +96,9 @@ namespace Hsdbg auto on_exited() -> void; auto refresh_call_stack() -> void; auto refresh_frame_data() -> void; + auto refresh_symbols() -> void; + auto refresh_disassembly() -> void; + auto load_disassembly(uint64_t file_address) -> void; std::unique_ptr m_session; @@ -106,10 +115,14 @@ namespace Hsdbg std::vector m_call_stack; std::vector m_locals; std::vector m_registers; + std::vector m_symbols; + std::vector m_disassembly; + std::string m_disassembly_name; std::vector m_console_output; uint64_t m_selected_thread = 0; uint32_t m_selected_frame = 0; + uint64_t m_selected_symbol = 0; uint64_t m_stop_count = 0; }; } -- cgit v1.3