gdb_mi
A gdb Machine Interface (MI) output parser and session manager.
- Crate: https://crates.io/crates/gdb_mi
- Documentation: https://docs.rs/gdb_mi
Example
extern crate gdb_mi;
use *;
let mut session = new.finish.unwrap;
session.send.unwrap;
session.send.unwrap;
// Skip first 3 outputs.
for _ in 0..3
let output = session.receive.unwrap;
// Output {
// token: None,
// record_type: Result,
// output_type: Result,
// result_class: Done,
// value: Some(
// Tuple(
// {
// "bkpt": Tuple(
// {
// "thread-groups": List(
// [
// Const(
// "i1"
// )
// ]
// ),
// "line": Const(
// "4"
// ),
// "disp": Const(
// "keep"
// ),
// "number": Const(
// "1"
// ),
// "file": Const(
// "tests/main.c"
// ),
// "original-location": Const(
// "main"
// ),
// "enabled": Const(
// "y"
// ),
// "addr": Const(
// "0x0000000100000f9d"
// ),
// "func": Const(
// "main"
// ),
// "fullname": Const(
// "$HOME/repo/gdb_mi/tests/main.c"
// ),
// "times": Const(
// "0"
// ),
// "type": Const(
// "breakpoint"
// )
// }
// )
// }
// )
// )
// }
let json = to_string.unwrap;
// {"token":null,"record_type":"Result","output_type":"Result","result_class":"Done","value":{"bkpt":{"disp":"keep","file":"tests/main.c","number":"1","line":"4","times":"0","enabled":"y","thread-groups":["i1"],"fullname":"/Users/lijunfen/repo/LLDBNvim/gdb_mi/tests/main.c","func":"main","original-location":"main","type":"breakpoint","addr":"0x0000000100000f9d"}}}