diff options
| author | hachem <im@hachem.wtf> | 2025-09-26 16:58:48 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-09-26 16:58:48 +0200 |
| commit | 7e53abd75355caa817532c71a935b6a231b3cd9e (patch) | |
| tree | 61538f78ffa156bea4a85163eb604b4553856424 /src/debugger/debugger.h | |
| parent | 049e7e2aa15debb1ed112494681d7b3e28765679 (diff) | |
feat: attempt to add a profiler...didn't work
Diffstat (limited to 'src/debugger/debugger.h')
| -rw-r--r-- | src/debugger/debugger.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/debugger/debugger.h b/src/debugger/debugger.h index 06b6ae9..5e154b2 100644 --- a/src/debugger/debugger.h +++ b/src/debugger/debugger.h @@ -3,6 +3,7 @@ #include "core/result.h" #include "debugger/types.h" +#include <chrono> #include <cstdint> #include <filesystem> #include <memory> @@ -49,6 +50,11 @@ namespace Hsdbg auto find_breakpoint(uint32_t id) -> Breakpoint*; auto breakpoints() const -> std::span<const Breakpoint> { return m_breakpoints; } + auto add_trace(std::string_view function) -> uint32_t; + auto remove_trace(uint32_t id) -> bool; + auto clear_traces() -> void; + auto traces() const -> std::span<const FunctionTrace> { return m_traces; } + auto threads() const -> std::span<const Thread> { return m_threads; } auto call_stack() const -> std::span<const StackFrame> { return m_call_stack; } auto locals() const -> std::span<const Variable> { return m_locals; } @@ -61,6 +67,8 @@ namespace Hsdbg 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 resident_memory() const -> uint64_t { return m_resident_memory; } + auto select_thread(uint64_t thread_id) -> bool; auto select_frame(uint32_t frame_index) -> bool; auto select_symbol(uint64_t file_address) -> bool; @@ -101,6 +109,12 @@ namespace Hsdbg auto refresh_source_files() -> void; auto refresh_disassembly() -> void; auto load_disassembly(uint64_t file_address) -> void; + auto sample_process_stats() -> void; + + auto resolve_trace(FunctionTrace& trace) -> void; + + auto handle_trace_stop() -> bool; + auto trace_now() const -> double; std::unique_ptr<Session> m_session; @@ -113,6 +127,9 @@ namespace Hsdbg std::vector<Breakpoint> m_breakpoints; uint32_t m_next_breakpoint_id = 1; + std::vector<FunctionTrace> m_traces; + uint32_t m_next_trace_id = 1; + std::vector<Thread> m_threads; std::vector<StackFrame> m_call_stack; std::vector<Variable> m_locals; @@ -127,5 +144,8 @@ namespace Hsdbg uint32_t m_selected_frame = 0; uint64_t m_selected_symbol = 0; uint64_t m_stop_count = 0; + uint64_t m_resident_memory = 0; + + std::chrono::steady_clock::time_point m_trace_epoch = std::chrono::steady_clock::now(); }; } |
