Support GDB Agent Expressions [for conditional breakpoints, breakpoint commands, tracepoints, etc...] #40
Labels
design-required
Getting this right will require some thought
new-protocol-extension
New feature or request
See https://sourceware.org/gdb/current/onlinedocs/gdb/Agent-Expressions.html#Agent-Expressions
One notable application of Agent Expressions not included in this overview is that breakpoint packets support specifying conditions and/or commands as bytecode expressions to be executed directly on the device. This enables significantly faster conditional breakpoints, as the target does not have to stop execution, communicate with the remote GDB client, and wait for the client to execute the condition.
There are several considerations to keep in mind while working on this feature and designing its API:
gdbstub
should parse packets with bytecode expressions and extract the bytecode expression slices, but should not decide how they are stored / retrieved.BytecodeStorage
trait, which users provide the implementation of.gdbstub
must include at least one "batteries included" implementation to make it as easy as possible to get up and running with the feature. e.g: if thestd
feature is enabled, provide aHashMap
-based implementation.gdbstub
should not lock users into a single bytecode interpreter. Users should have the flexibility to decide how/when bytecode expressions are be executed.BytecodeExecutor
trait, which users provide the implementation of.gdbstub
should offer a "batteries included" interpreter for those that just want to get up and running quickly (but this wouldn't be a feature blocker)Some final things of note:
BytecodeExecutor
implementation that can be used to validate the feature is working as intended!gdbstub
included an "in-house" Agent Bytecode executor (withno_std
support), but that's not a feature blockerThe text was updated successfully, but these errors were encountered: