From ba64bcc9c38c04bd48e79ac59788b946454f4acb Mon Sep 17 00:00:00 2001 From: hachem Date: Sat, 29 Aug 2026 01:38:42 +0200 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 82a993a..175683e 100644 --- a/src/debugger/debugger.h +++ b/src/debugger/debugger.h @@ -43,6 +43,7 @@ namespace Hsdbg // breakpoints, the only part that keeps real state for now 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; @@ -56,6 +57,9 @@ 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; } @@ -63,8 +67,10 @@ namespace Hsdbg // selection, what the ui is currently looking at 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; } // pumps whatever the debug session has to say, called once per frame auto update() -> void; @@ -99,6 +105,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; @@ -115,10 +124,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