Crates.io | gdb_mi |
lib.rs | gdb_mi |
version | 0.1.3 |
source | src |
created_at | 2017-09-14 01:31:51.385083 |
updated_at | 2017-11-07 21:49:47.924899 |
description | gdb Machine Interface (MI) parser and session manager |
homepage | https://github.com/autozimu/gdb_mi |
repository | https://github.com/autozimu/gdb_mi |
max_upload_size | |
id | 31665 |
size | 25,322 |
A gdb Machine Interface (MI) output parser and session manager.
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"}}}