0.5.0
0.5.0
While the overall structure of the API has remained the same, 0.5.0
does introduce a few breaking API changes that require some attention. That being said, it should not be a difficult migration, and updating to 0.5.0
from 0.4
shouldn't take more than 10 mins of refactoring.
Check out transition_guide.md
for guidance on upgrading from 0.4.x
to 0.5
.
New Features
- Implement Run-Length-Encoding (RLE) on outgoing packets
- This significantly cuts down on the data being transferred over the wire when reading from registers/memory
- Add target-specific
kind: Arch::BreakpointKind
parameters to the Breakpoint API- While emulated systems typically implement breakpoints by pausing execution once the PC hits a certain value, "real" systems typically need to patch the instruction stream with a breakpoint instruction. On systems with variable-sized instructions, this
kind
parameter specifies the size of the instruction that should be injected.
- While emulated systems typically implement breakpoints by pausing execution once the PC hits a certain value, "real" systems typically need to patch the instruction stream with a breakpoint instruction. On systems with variable-sized instructions, this
- Implement
ResumeAction::{Step,Continue}WithSignal
- Added the
Exited(u8)
,Terminated(u8)
, andReplayLog("begin"|"end")
stop reasons. - Added
DisconnectReason::Exited(u8)
andDisconnectReason::Terminated(u8)
. - Reworked the
MultiThreadOps::resume
API to be significantly more ergonomic and efficient- See the transition guide for more details.
New Protocol Extensions
{Single,Multi}ThreadReverse{Step,Continue}
- Support for reverse-step and reverse-continue. #48 (DrChat){Single,Multi}ThreadRangeStepping
- Optional optimized range stepping support.
Breaking Arch Changes
gdbstub::arch
has been moved into a separategdbstub_arch
crate- See #45 for details on why this was done.
- (x86) Break GPRs & SRs into individual fields/variants #34
Breaking API Changes
- Base Protocol Refactors
- Reworked the
MultiThreadOps::resume
API - Added a wrapper around the raw
check_gdb_interrupt
callback, hiding the underlying implementation details - Extracted base protocol single-register access methods (
{read,write}_register
) into separateSingleRegisterAccess
trait- These are optional GDB protocol methods, and as such, should be modeled as IDETs
- Reworked the
- Protocol Extension Refactors
- Consolidated the
{Hw,Sw}Breakpoints/Watchpoints
IDETs under a singleBreakpoints
IDET + sub-IDETs - Added new arch-specific
kind: Arch::BreakpointKind
parameter toadd_{hw,sw}_breakpoint
methods - Renamed
target::ext::extended_mod::ConfigureASLR{Ops}
toConfigureAslr{Ops}
(clippy::upper_case_acronyms)
- Consolidated the
- Added
{Step,Continue}WithSignal
variants totarget::ext::base::ResumeAction
- Trait Changes
arch::Arch
: Addedtype BreakpointKind
. Required to support arch-specific breakpoint kindsarch::Arch
: (very minor) Addednum_traits::FromPrimitive
bound toArch::Usize
arch::Registers
: Addedtype ProgramCounter
and associatedfn pc(&self) -> Self::ProgramCounter
method. Added preemptively in anticipation of future GDB Agent support
- Removed the
Halted
stop reason (more accurate to simply return{Exited|Terminated}(SIGSTOP)
instead). - Removed the
Halted
disconnect reason (replaced with theExited
andTerminated
stop reasons instead). - Removed the implicit
ExtendedMode
attached PID tracking whenalloc
was available. See23b56038
rationale behind this change.
Internal Improvements
- Split monolithic
GdbStubImpl
implementation into separate files (by protocol extension) - Finally rewrite + optimize
GdbStubImpl::do_vcont
, along with streamlining its interactions with the legacys
andc
packets - Sprinkle more IDET-based dead code elimination hints (notably wrt. stop reasons)
- Remove the default
self.current_mem_tid
hack, replacing it with a much more elegant solution - Packet Parser improvements
- Remove last remaining bit of UTF-8 related code
- Eliminate as much panicking bounds-checking code as possible
- support efficient parsing of packets that are parsed differently depending on active protocol extension (namely, the breakpoint packets)
- (currently unused) Zero-cost support for parsing
Z
andz
packets with embedded agent bytecode expressions
- Use intra-doc links whenever possible