gdb_mi

Crates.iogdb_mi
lib.rsgdb_mi
version0.1.3
sourcesrc
created_at2017-09-14 01:31:51.385083
updated_at2017-11-07 21:49:47.924899
descriptiongdb Machine Interface (MI) parser and session manager
homepagehttps://github.com/autozimu/gdb_mi
repositoryhttps://github.com/autozimu/gdb_mi
max_upload_size
id31665
size25,322
Junfeng Li (autozimu)

documentation

README

gdb_mi

A gdb Machine Interface (MI) output parser and session manager.

Example

extern crate gdb_mi;
use gdb_mi::*;

let mut session = SessionBuilder::new().finish().unwrap();
session.send("-file-exec-and-symbols tests/main\n").unwrap();
session.send("-break-insert main\n").unwrap();

// Skip first 3 outputs.
for _ in 0..3 {
    session.receive().unwrap();
}

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 = serde_json::to_string(&output).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"}}}
Commit count: 0

cargo fmt