class Cradare2::DSL::Debugger

Overview

High-level debugger DSL for controlling execution, breakpoints, registers, memory maps, and crash reports.

Defined in:

cradare2/dsl/debugger.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(client : Client) #

[View source]

Instance Method Detail

def analyze_registers(regs : Model::Registers | Nil = nil) : Analysis::RegisterAnalysis #

Performs deep structural analysis on current CPU registers and memory boundaries.


[View source]
def attach(pid : Int32) : self #

Attaches to a running process by PID.


[View source]
def backtrace : Array(Model::StackFrame) #

Returns the call stack / backtrace frames (dbtj).


[View source]
def backtrace_symbols : Array(String) #

Returns list of demangled backtrace function symbols.


[View source]
def breakpoint(target : UInt64 | Int32 | Int64 | String) : self #

Sets a software breakpoint at the given address or symbol (db).


[View source]
def breakpoints : Array(Model::Breakpoint) #

Returns list of active breakpoints as typed models.


[View source]
def classify_memory(address : UInt64) : Analysis::ClassifiedAddress #

Classifies an arbitrary pointer against the debugged process memory maps.


[View source]
def clear_breakpoints : self #

Removes all breakpoints (db-*).


[View source]
def continue : self #

Continues execution of the debugged process (dc).


[View source]
def crash_report(regs : Model::Registers | Nil = nil, bt : Array(Model::StackFrame) | Nil = nil) : String #

Generates a detailed, demangled native crash diagnostic report. Includes crash instruction pointer, active function, faulting memory region, registers dump, and demangled call stack.


[View source]
def detach : self #

Detaches from current process.


[View source]
def diagnose_crash(regs : Model::Registers | Nil = nil, bt : Array(Model::StackFrame) | Nil = nil) : Model::CrashDiagnosis #

Generates a structured crash diagnosis with root-cause pattern analysis and remediation steps.


[View source]
def kill : self #

Sends SIGKILL or terminates the debugged process.


[View source]
def maps : Array(Model::MemoryMap) #

Returns the loaded memory maps / regions (dmj).


[View source]
def memory_classifier : Analysis::MemoryClassifier #

Returns a memory classifier configured with the currently loaded memory maps.


[View source]
def pid : Int32 | Nil #

Returns current process ID if debugging.


[View source]
def registers : Model::Registers #

Returns current CPU registers as a strongly typed Registers model.


[View source]
def remove_breakpoint(target : UInt64 | Int32 | Int64 | String) : self #

Removes a breakpoint at the given address or symbol (db-).


[View source]
def running? : Bool #

Checks if the debugged process is currently active/attached.


[View source]
def set_register(name : String, value : UInt64) : self #

Sets a register to a specific value (e.g. set_register("rax", 0x1234)).


[View source]
def status : String #

Returns debugger execution status text.


[View source]
def step : self #

Steps one single machine instruction (ds).


[View source]
def step_over : self #

Steps over calls or compound instructions (dso).


[View source]
def step_until(address : UInt64 | Int32 | Int64 | String) : self #

Continues execution until reaching the specified target address (dsu).


[View source]
def threads : Array(Model::Thread) #

Returns active threads in the process (dptj).


[View source]