| Crates.io | gdbc |
| lib.rs | gdbc |
| version | 0.1.0 |
| created_at | 2025-05-18 23:39:59.631081+00 |
| updated_at | 2025-05-18 23:39:59.631081+00 |
| description | comprehensive terminal-based GDB client |
| homepage | |
| repository | https://github.com/sammwyy/gdbc |
| max_upload_size | |
| id | 1679020 |
| size | 63,460 |
GDBC is a comprehensive terminal-based GDB client written in Rust for connecting to GDB servers and performing remote debugging operations.
Ensure you have Rust and Cargo installed, then:
# Clone the repository
git clone https://github.com/sammwyy/gdbc.git
cd gdbc
# Build the project
cargo build --release
# Run the client
./target/release/gdbc
cargo install gdbc
USAGE:
gdbc [OPTIONS]
OPTIONS:
-h, --host <HOST> Host to connect to [default: localhost]
-p, --port <PORT> Port to connect to [default: 1234]
-i, --instruction <INSTRUCTION> Single instruction to execute
--no-color Disable colored output
-d, --debug Enable debug output
--help Show this help message
--version Show version information
Launch GDBC without the -i flag to enter interactive mode:
gdbc -h target-host -p 1234
This starts an interactive shell where you can input commands.
Execute a single command and exit:
gdbc -h target-host -p 1234 -i "readmem 0x1000 64"
This executes the specified instruction and returns the result.
| Command | Aliases | Description |
|---|---|---|
connect HOST[:PORT] |
Connect to GDB server (default port 1234) | |
disconnect |
Disconnect from server | |
reconnect |
Reconnect to the last server | |
readmem ADDR SIZE [MODE] [ENDIAN] |
rm | Read memory |
writemem ADDR DATA |
wm | Write memory (DATA as hex, string, or bytes) |
break ADDR |
b | Set breakpoint |
delete ADDR |
d | Remove breakpoint |
continue |
c | Continue execution |
step |
s | Single step |
registers |
regs | Read registers |
help |
h, ? | Show help |
quit |
exit, q | Exit the program |
When reading memory, you can specify the format:
hex (default): Display as hexadecimal bytes with ASCII representationascii/str: Display as ASCII stringint16: Display as 16-bit integersint32: Display as 32-bit integersint64: Display as 64-bit integersYou can also specify endianness:
little (default): Little-endian formatbig: Big-endian formatgdb> connect localhost:1234
gdb> readmem 0x1000 64
gdb> rm 0x1000 16 str
gdb> rm 0x1000 8 int32 big
gdb> writemem 0x1000 "Hello, world!"
gdb> wm 0x2000 0x01020304
gdb> break 0x1500
gdb> continue
gdb> step
gdb> registers
The client is divided into two main components:
Core Library (src/lib.rs)
client.rs: GDB protocol implementationcommands.rs: Command parsing and executiondisplay.rs: Output formatting and colorserror.rs: Error handlingCLI Interface (src/main.rs)
GDBC implements the GDB Remote Serial Protocol (RSP) for communicating with a GDB server. The protocol uses a packet-based mechanism with checksums for reliability. Key packet types supported:
m (read), M (write)Z0 (set), z0 (clear)c (continue), s (step)g (read all)clap: Command-line argument parsingrustyline: Interactive line editing and historycolored: Terminal color supportthiserror: Error handlingbyteorder: Endianness conversionregex: Command parsingenv_logger: Logging backenddirs: User configuration directory detectioncargo build
cargo test
This project is licensed under the MIT License - see the LICENSE file for details.
Contributions are welcome! Please feel free to submit a Pull Request.
git checkout -b feature/amazing-feature)git commit -m 'Add some amazing feature')git push origin feature/amazing-feature)