hachem.wtf
aboutsummaryrefslogtreecommitdiff
path: root/src/debugger/debugger.h
diff options
context:
space:
mode:
authorhachem <im@hachem.wtf>2025-02-08 01:38:42 +0100
committerhachem <im@hachem.wtf>2025-02-08 01:38:42 +0100
commit66000c76d2c192df515d7a06af605587462d60be (patch)
treea7c8e9febd00cd859e8389e0bb4770df4d6d72a7 /src/debugger/debugger.h
parentad5f458d31d45a09d3888f83a4f8a54eea20c996 (diff)
feat: disassembly
Diffstat (limited to 'src/debugger/debugger.h')
-rw-r--r--src/debugger/debugger.h13
1 files changed, 13 insertions, 0 deletions
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<const StackFrame> { return m_call_stack; }
auto locals() const -> std::span<const Variable> { return m_locals; }
auto registers() const -> std::span<const Register> { return m_registers; }
+ auto symbols() const -> std::span<const Symbol> { return m_symbols; }
+ auto disassembly() const -> std::span<const Instruction> { return m_disassembly; }
+ auto disassembly_name() const -> std::string_view { return m_disassembly_name; }
auto evaluate(std::string_view expression) -> Result<std::string>;
auto read_memory(uint64_t address, size_t size) -> Result<std::vector<uint8_t>>;
auto console_output() const -> std::span<const std::string> { 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<Session> m_session;
@@ -106,10 +115,14 @@ namespace Hsdbg
std::vector<StackFrame> m_call_stack;
std::vector<Variable> m_locals;
std::vector<Register> m_registers;
+ std::vector<Symbol> m_symbols;
+ std::vector<Instruction> m_disassembly;
+ std::string m_disassembly_name;
std::vector<std::string> 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;
};
}