Skip to content

lipk/rust-gdb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

rust-gdb is a WIP library for controlling GDB from Rust programs. At the moment, it can launch a GDB process, pass commands, and parse gdb's responses. rust-gdb uses GDB's Machine Interface.

Missing features:

  • Handle asynchronous output from GDB (currently it's ignored)
  • Better interface for executing commands
  • Proper documentation

Usage

Launching the debugger

use gdb;

let debugger = gdb::Debugger::start().unwrap();

The library will look for the gdb binary in your path.

Executing commands

use gdb;

let mut debugger = gdb::Debugger::start().unwrap();
let response = debugger.send_cmd_raw("your-command-here\n").unwrap();

send_cmd_raw currently blocks until it gets a result record from GDB, so don't use async commands :)

Response format

Currently only result records are returned by send_cmd_raw. GDB/MI output structure is described here, rust-gdb practically transforms this into a syntax tree, as described in msg.rs.

About

A small Rust library for controlling GDB.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages