gdbstub
An implementation of the GDB Remote Serial Protocol in Rust
0.7.10
5.1M downloads/mo
#4502 most downloaded on crates.io
daniel5151/gdbstub
What this package is like to depend on
Last release 5 months ago
10 Mar 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 27 of 30 stable releases
2 versions withdrawn
withdrawn after publishing
6 years old
32 releases · first in 2020
3 releases in the last 12 months
see the full history below
Release timeline
32 releases · Mar 2020 to Mar 2026Releases
latest 32-
0.7.1010 Mar 2026Release notes
Open source →New Features
GdbStubStateMachineInner::report_stop_with_regs- new API to pass expedited register values in the stop reply T-packet. #189 (cfallin)
New Protocol Extensions
Wasm- (LLDB extension) Wasm-specific actions (i.e: reading Wasm call stack, and global/local/stack vars). #188 (cfallin)ProcessInfo+HostInfo- (LLDB extension) Report key/value metadata about the host / process being debugged. #190 (cfallin)
Internal Improvements
Release notes
Open source →New Features
GdbStubStateMachineInner::report_stop_with_regs- new API to pass expedited register values in the stop reply T-packet. #189 (cfallin)
New Protocol Extensions
Wasm- (LLDB extension) Wasm-specific actions (i.e: reading Wasm call stack, and global/local/stack vars). #188 (cfallin)ProcessInfo+HostInfo- (LLDB extension) Report key/value metadata about the host / process being debugged. #190 (cfallin)
Internal Improvements
-
0.7.924 Jan 2026Release notes
Open source →New Protocol Extensions
MultiThreadSchedulerLocking- Support running in Scheduler Locking mode. #179 (Satar07)Libraries- List a target's loaded libraries. #183 (mrexodia)- Note: This is a platform-agnostic version of the existing System-V/Unix-specific
LibrariesSvr4feature, which landed in0.7.1
- Note: This is a platform-agnostic version of the existing System-V/Unix-specific
Bugfixes
Release notes
Open source →New Protocol Extensions
MultiThreadSchedulerLocking- Support running in Scheduler Locking mode. #179 (Satar07)Libraries- List a target's loaded libraries. #183 (mrexodia)- Note: This is a platform-agnostic version of the existing System-V/Unix-specific
LibrariesSvr4feature, which landed in0.7.1
- Note: This is a platform-agnostic version of the existing System-V/Unix-specific
Bugfixes
-
0.7.810 Oct 2025Release notes
Open source →Release notes
Open source → -
0.7.715 Aug 2025Release notes
Open source →Bugfixes
- Add missing
alloc::borrow::ToOwnedimport when buildingno_stdwithalloc. #174 (AdamKMeller)
Release notes
Open source →Bugfixes
- Add missing
alloc::borrow::ToOwnedimport when buildingno_stdwithalloc. #174 (AdamKMeller)
- Add missing
-
0.7.612 Jun 2025Release notes
Open source →New Protocol Extensions
Flash- Support for GDB flash commands (e.g:load). #172 (eulerdisk)
This release also coincides with the release of
gdbstub_arch0.3.2:Release notes
Open source →New Protocol Extensions
Flash- Support for GDB flash commands (e.g:load). #172 (eulerdisk)
-
0.7.503 Mar 2025Release notes
Open source →New Protocol Extensions
Tracepoints- Basic tracepoint extension support. #160 (cczetier)- Note: Most fundamental tracepoint operations are supported, but there quite a few packets / APIs that are not yet implemented. Please see the module documentation for additional details.
Bugfixes
- Fixed case-insensitive filename collision issue #166 introduced in
0.7.4
Release notes
Open source →New Protocol Extensions
Tracepoints- Basic tracepoint extension support. #160 (cczetier)- Note: Most fundamental tracepoint operations are supported, but there quite a few packets / APIs that are not yet implemented. Please see the module documentation for additional details.
Bugfixes
- Fixed case-insensitive filename collision issue #166 introduced in
0.7.4
-
0.7.403 Mar 2025 withdrawnRelease notes
Open source →This version was yanked, as it introduced two files -
qTBuffer.rsandQTBuffer.rs- that resulted in filename collisions when cloninggdbstubon case-insensitive filesystems.Release notes
Open source →This version was yanked, as it introduced two files -
qTBuffer.rsandQTBuffer.rs- that resulted in filename collisions when cloninggdbstubon case-insensitive filesystems. -
0.7.324 Oct 2024Release notes
Open source →New Features
- Add new
core_errorfeature, to haveGdbStubErrorimplcore::error::Error. #154 (ultimaweapon)- Note: Out of an abundance of caution, this has been put behind a
feature-flag, as whilegdbstubdoesn't claim a strict MSRV at this time,
it seemed unwise to have a PATCH release break folks stuck on a pre-1.81
Rust toolchain.
- Note: Out of an abundance of caution, this has been put behind a
Release notes
Open source →New Features
- Add new
core_errorfeature, to haveGdbStubErrorimplcore::error::Error. #154 (ultimaweapon)- Note: Out of an abundance of caution, this has been put behind a
feature-flag, as while
gdbstubdoesn't claim a strict MSRV at this time, it seemed unwise to have a PATCH release break folks stuck on a pre-1.81 Rust toolchain.
- Note: Out of an abundance of caution, this has been put behind a
feature-flag, as while
- Add new
-
0.7.217 Aug 2024Release notes
Open source →Bugfixes
- Add workaround for vCont packets that specify a '0' (Any) thread-id
- For more context, see
e9a5296c
- For more context, see
Internal Improvements
- Various README tweaks
- Various clippy lint fixes
- Fix incorrect valid-addr check in armv4t example
Release notes
Open source →Bugfixes
- Add workaround for vCont packets that specify a '0' (Any) thread-id
- For more context, see
e9a5296c
- For more context, see
Internal Improvements
- Various README tweaks
- Various clippy lint fixes
- Fix incorrect valid-addr check in armv4t example
- Add workaround for vCont packets that specify a '0' (Any) thread-id
-
0.7.106 Jan 2024Release notes
Open source →New Protocol Extensions
LibrariesSvr4- List an SVR4 (System-V/Unix) target's libraries. #142 (alexcrichton)
Release notes
Open source →New Protocol Extensions
LibrariesSvr4- List an SVR4 (System-V/Unix) target's libraries. #142 (alexcrichton)
-
0.7.024 Nov 2023Release notes
Open source →Breaking API Changes
stub::GdbStubErroris now an opaquestructwith a handful of methods to extract user-defined context (as opposed to being anenumthat directly exposed all error internals to the user).- This change will enable future versions of
gdbstubto fearlessly improve error messages and infrastructure without making semver breaking changes. See #112 for more.
- This change will enable future versions of
common::Signalis not longer anenum, and is instead astructwith a singlepub u8field + a collection of associated constants.- As a result, yet another instance of
unsafecould be removed from the codebase!
- As a result, yet another instance of
ArchAPI:- Entirely removed
single_step_behavior. See #132 for details and rationale
- Entirely removed
TargetAPIs:SingleThreadBase/MultiThreadBaseread_addrsnow returns ausizeinstead of a(), allowing implementations to report cases where only a subset of memory could be read. #115 (geigerzaehler)
HostIo
Internal Improvements
- Reformatted codebase with nightly rustfmt using
imports_granularity = "Item"
-
0.6.613 Apr 2023 -
0.6.506 Apr 2023Release notes
Open source →New Protocol Extensions
ExtendedMode > CurrentActivePid- Support reporting a non-default active PID #133- Required to fix
vAttachbehavior (see Bugfixes section below)
- Required to fix
Bugfixes
-
0.6.425 Feb 2023Release notes
Open source →Bugfixes
Internal Improvements
- Various README tweaks
- Remove some
unsafecode - CI improvements
- Run no-panic checks on
example_no_std - Run CI on docs
- Run no-panic checks on
-
0.6.317 Aug 2022Release notes
Open source → -
0.6.213 Jun 2022Release notes
Open source →New Protocol Extensions
MultiThreadBase > ThreadExtraInfo- Provide extra information per-thread. #106 (thefaxman)LldbRegisterInfo- (LLDB specific) Report register information in the LLDB format. #103 (jawilk)- This information can be statically included as part of the
Archimplemention, or dynamically reported via theLldbRegisterInfoOverrideIDET.
- This information can be statically included as part of the
Bugfixes
Internal Improvements
- Tweak enabled clippy lints
- Added a light dusting of
#[inline]across the packet parsing code, crunching the code down even further - Expanded on "no-panic guarantee" docs
-
0.6.123 Feb 2022 -
0.6.020 Jan 2022Release notes
Open source →After over a half-year of development,
gdbstub0.6 has finally been released!This massive release delivers a slew of new protocol extensions, internal improvements, and key API improvements. Some highlights include:
- A new non-blocking
GdbStubStateMachineAPI, enablinggdbstubto integrate nicely with async event loops!- Moreover, on
no_stdplatforms, this new API enablesgdbstubto be driven directly via breakpoint/serial interrupt handlers! - This API is already being used in several Rust kernel projects, such as
vmware-labs/node-replicated-kernelandbetrusted-io/xous-coreto enable bare-metal, in-kernel debugging.
- Moreover, on
gdbstubis now entirely panic free in release builds!- * subject to
rustc's compiler optimizations - This was a pretty painstaking effort, but the end result is a substantial reduction in binary size on
no_stdplatforms.
- * subject to
- Tons of new and exciting protocol extensions, including but not limited to:
- Support for remote file I/O (reading/writing files to the debug target)
- Fetching remote memory maps
- Catching + reporting syscall entry/exit conditions
- ...and many more!
- A new license:
gdbstubis licensed under MIT OR Apache-2.0
See the changelog for a comprehensive rundown of all the new features.
While this release does come with quite a few breaking changes, the core IDET-based
TargetAPI has remained much the same, which should make porting code over from 0.5.x to 0.6 pretty mechanical. See thetransition_guide.mdfor guidance on upgrading from0.5.xto0.6.And as always, a huge shoutout to the folks who contributed PRs, Issues, and ideas to
gdbstub- this release wouldn't have been possible without you! Special shoutouts to gz and xobs for helping me test and iterate on the new bare-metal state machine API, and bet4it for pointing out and implementing many useful API improvements and internal refactors.Cheers!
New Features
- The new
GdbStubStateMachineAPI gives users the power and flexibility to integrategdbstubinto their project-specific event loop infrastructure.- e.g: A global instance of
GdbStubStateMachinecan be driven directly from bare-metal interrupt handlers inno_stdenvironments - e.g: A project using
async/awaitcan wrapGdbStubStateMachinein a task, yielding execution while waiting for the target to resume / new data to arrive down theConnection
- e.g: A global instance of
- Removed all panicking code from
gdbstub- See the commit message for more details on how this was achieved.
- Introduced strongly-typed enum for protocol defined signal numbers (instead of using bare
u8s) - Added basic feature negotiation to support clients that don't support
multiprocess+extensions. - Relicensed
gdbstubunder MIT OR Apache-2.0 #68 - Added several new "guard rails" to avoid common integration footguns:
Target::guard_rail_implicit_sw_breakpoints- guards against the GDB client silently overriding target instructions with breakpoints ifSwBreakpointshasn't been implemented.Target::guard_rail_single_step_gdb_behavior- guards against a GDB client bug where support for single step may be required / ignored on certain platforms (e.g: required on x86, ignored on MIPS)
- Added several new "toggle switches" to enable/disable parts of the protocol (all default to
true)Target::use_x_upcase_packet- toggle support for the more efficientXmemory write packetTarget::use_resume_stub- togglegdbstub's built-in "stub" resume handler that returnsSIGRAPif a target doesn't implement support for resumptionTarget::use_rle- toggle whether outgoing packets are Run Length Encoded (RLE)
New Protocol Extensions
MemoryMap- Get memory map XML file from the target. #54 (Tiwalun)CatchSyscalls- Enable and disable catching syscalls from the inferior process. #57 (mchesser)HostIo- Perform I/O operations on host. #66 (bet4it)- Support for all Host I/O operations:
open,close,pread,pwrite,fstat,unlink,readlink,setfs
- Support for all Host I/O operations:
ExecFile- Get full absolute path of the file that was executed to create a process running on the remote system. #69 (bet4it)Auxv- Access the target’s auxiliary vector. #86 (bet4it)- Implement
Xpacket - More efficient bulk-write to memory (superceding theMpacket). #82 (gz)
Breaking API Changes
ConnectionAPI:- Removed the
readandpeekmethods fromConnection- These have been moved to the new
ConnectionExttrait, which is used in the newGdbStub::run_blockingAPI
- These have been moved to the new
- Removed the
ArchAPI:TargetAPIs:- prefix all IDET methods with
support_- _makes it far easier to tell at-a-glance whether a method is an IDET, or an actual handler method.
- Introduce strongly-typed enum for protocol defined signal numbers (instead of using bare
u8s) BaseAPI:- Make single-stepping optional #92
- Remove
GdbInterrupttype (interrupt handling lifted to higher-level APIs) - Remove
ResumeActiontype (in favor of separate methods for various resume types)
BreakpointsAPI:HwWatchpoint: Plumb watchpointlengthparameter to public API
TargetXmlAPI:- Support for
<xi:include>in target.xml, which required including theannexparameter in the handler method. annexis set tob"target.xml"on the fist call, though it may be set to other values in subsequent calls if<xi:include>is being used.
- Support for
- Pass
PacketBuf-backed&mut [u8]as a response buffer to various APIs #72 (bet4it)- Improvement over the callback-based approach.
- This change is possible thanks to a clause in the GDB spec that specifies that responses will never exceed the size of the
PacketBuf. - Also see #70, which tracks some other methods that might be refactored to use this approach in the future.
- prefix all IDET methods with
Internal Improvements
- A new non-blocking
-
0.5.022 May 2021Release notes
Open source →While the overall structure of the API has remained the same,
0.5.0does introduce a few breaking API changes that require some attention. That being said, it should not be a difficult migration, and updating to0.5.0from0.4shouldn't take more than 10 mins of refactoring.Check out
transition_guide.mdfor guidance on upgrading from0.4.xto0.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::BreakpointKindparameters 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
kindparameter 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::resumeAPI 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::archhas been moved into a separategdbstub_archcrate- 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::resumeAPI - Added a wrapper around the raw
check_gdb_interruptcallback, hiding the underlying implementation details - Extracted base protocol single-register access methods (
{read,write}_register) into separateSingleRegisterAccesstrait- These are optional GDB protocol methods, and as such, should be modeled as IDETs
- Reworked the
- Protocol Extension Refactors
- Consolidated the
{Hw,Sw}Breakpoints/WatchpointsIDETs under a singleBreakpointsIDET + sub-IDETs - Added new arch-specific
kind: Arch::BreakpointKindparameter toadd_{hw,sw}_breakpointmethods - Renamed
target::ext::extended_mod::ConfigureASLR{Ops}toConfigureAslr{Ops}(clippy::upper_case_acronyms)
- Consolidated the
- Added
{Step,Continue}WithSignalvariants totarget::ext::base::ResumeAction - Trait Changes
arch::Arch: Addedtype BreakpointKind. Required to support arch-specific breakpoint kindsarch::Arch: (very minor) Addednum_traits::FromPrimitivebound toArch::Usizearch::Registers: Addedtype ProgramCounterand associatedfn pc(&self) -> Self::ProgramCountermethod. Added preemptively in anticipation of future GDB Agent support
- Removed the
Haltedstop reason (more accurate to simply return{Exited|Terminated}(SIGSTOP)instead). - Removed the
Halteddisconnect reason (replaced with theExitedandTerminatedstop reasons instead). - Removed the implicit
ExtendedModeattached PID tracking whenallocwas available. See23b56038rationale behind this change.
Internal Improvements
- Split monolithic
GdbStubImplimplementation into separate files (by protocol extension) - Finally rewrite + optimize
GdbStubImpl::do_vcont, along with streamlining its interactions with the legacysandcpackets - Sprinkle more IDET-based dead code elimination hints (notably wrt. stop reasons)
- Remove the default
self.current_mem_tidhack, 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
Zandzpackets with embedded agent bytecode expressions
- Use intra-doc links whenever possible
Bugfixes
- Implement Run-Length-Encoding (RLE) on outgoing packets
-
0.4.519 Mar 2021 -
0.4.407 Mar 2021 -
0.4.309 Jan 2021Release notes
Open source →New Arch Implementations
- Implement
RegIdfor Mips/Mips64 #38 (starfleetcadet75) - Implement
RegIdfor MSP430 #38 (starfleetcadet75)
- Implement
-
0.4.206 Nov 2020 -
0.4.129 Oct 2020Release notes
Open source →New Arch Implementations
Bugfixes
- Switch fatal error signal from
T06toS05, - specify cfg-if 0.1.10 or later #33 (keiichiw)
cargo buildfails if cfg-if is 0.1.9 or older
Internal Improvements
- Don't hard-code u64 when parsing packets (use big-endian byte arrays + late conversion to
Target::Arch::Usize).
- Switch fatal error signal from
-
0.4.010 Oct 2020Release notes
Open source →This version includes a major API overhaul, alongside a slew of new features and general improvements. While updating to
0.4.0will require some substantial code modifications, it's well worth the effort, as0.4.0is the safest, leanest, and most featureful release ofgdbstubyet!Fun fact: Even after adding a bunch of new features and bug-fixes, the in-tree
example_no_stdhas remained just as small! The example on thesemver-fix-0.2.2branch is20251bytes, while the example on0.4.0is20246bytes.Breaking API Changes
- Rewrite the
TargetAPI in terms of "Inlineable Dyn Extension Traits" (IDETs)- By breaking up
Targetinto smaller pieces which can be mixed-and-matched, it not only makes it easier to get up-and-running withgdbstub, but it also unlocks a lot of awesome internal optimizations:- Substantially reduces binary-size footprint by guaranteeing dead-code-elimination of parsing/handling unimplemented GDB protocol features.
- Compile-time enforcement that certain groups of methods are implemented in-tandem (e.g:
add_sw_breakpointandremove_sw_breakpoint).
- By breaking up
- Update the
TargetAPI with support for non-fatal error handling.- The old approach of only allowing *fatal* errors was woefully inadequate when dealing with potentially fallible operations such as reading from unauthorized memory (which GDB likes to do a bunch), or handling non-fatal
std::io::Errorthat occur as a result ofExtendedModeoperations. The newTargetResult/TargetErrorresult is much more robust, and opens to door to supporting additional error handling extensions (such as LLDB's ASCII Errors).
- The old approach of only allowing *fatal* errors was woefully inadequate when dealing with potentially fallible operations such as reading from unauthorized memory (which GDB likes to do a bunch), or handling non-fatal
- Update the
Connectiontrait with new methods (flush- required,write_all,on_session_start) - Lift
Registers::RegIdtoArch::RegId, and introduce new temporaryRegIdImplsolution for avoiding breaking API changes due to newRegIdimplementations (see #29) - Mark various
RegIdenums as#[non_exhaustive], allowing more registers to be added if need be. - Error types are now marked as
#[non_exhaustive].
New Protocol Extensions
ExtendedMode- Allow targets to run new processes / attach to existing processes / restart execution.- Includes support for
set disable-randomization,set environment,set startup-with-shell, andset cwdandcd.
- Includes support for
SectionOffsets- Get section/segment relocation offsets from the target. #30 (mchesser)- Uses the
qOffsetspacket under-the-hood.
- Uses the
Bugfixes
- Fix issues related to selecting the incorrect thread after hitting a breakpoint in multi-threaded targets.
- Ensure that
set_nodelayis set when using aTcpStreamas aConnection(via the newConnection::on_session_startAPI)- This should result in a noticeable performance improvement when debugging over TCP.
Internal Improvements
- Removed
btoudependency. - Removed all
UTF-8awarestrhandling code.- GDB uses a pure ASCII protocol, so including code to deal with UTF-8 resulted in unnecessary binary bloat.
- Rewrite the
-
0.3.011 Sep 2020Release notes
Open source →This version contains a few minor breaking changes from
0.2.1. These are only surface-level changes, and can be fixed with minimal effort.Version
0.3.0is identical to the yanked version0.2.2, except that it adheres tocargo's modified SemVer rule which states that the pre-0.x.ybreaking changes should still bump the minor version.Thanks to h33p for reporting this issue (#27)
Breaking API Changes
- Update
Target::resumeAPI to replace raw&mut dyn Iteratorwith a functionally identical concreteActionsiterator. - Mark the
StopReasonenum as#[non_exhaustive], allowing further types to be added without being considered as an API breaking change.
New Protocol Extensions
- Add
Target::read/write_registersupport (to support single register accesses) #22 (thomashk0) - Add
StopReason::Signal(u8)variant, to send arbitrary signal codes #19 (mchesser)
New Arch Implementations
- Update
-
0.2.209 Sep 2020 withdrawnNothing published for this version
-
0.2.123 Aug 2020Release notes
Open source →New Arch Implementations
- Add x86_64 support #11 (jamcleod)
- Add Mips and Mips64 support #13 (starfleetcadet75)
Internal Improvements
- Documentation improvements
- Document PC adjustment requirements in
Target::resume - Add docs on handling non-fatal invalid memory reads/writes in
Target::read/write_addrs.
- Document PC adjustment requirements in
-
0.2.012 Jul 2020 -
0.1.206 Apr 2020Nothing published for this version
-
0.1.129 Mar 2020Nothing published for this version
-
0.1.029 Mar 2020Nothing published for this version