1 use super::prelude::*;
2 
3 #[derive(Debug)]
4 pub struct Z<'a> {
5     pub type_: u8,
6     pub addr: &'a [u8],
7     /// architecture dependent
8     pub kind: u8,
9     // TODO: Add support for breakpoint 'conds', 'persist', and 'cmds' feature
10 }
11 
12 impl<'a> ParseCommand<'a> for Z<'a> {
from_packet(buf: PacketBuf<'a>) -> Option<Self>13     fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
14         let body = buf.into_body();
15         let mut body = body.split_mut(|&b| b == b',');
16         let type_ = decode_hex(body.next()?).ok()?;
17         let addr = decode_hex_buf(body.next()?).ok()?;
18         let kind = decode_hex(body.next()?).ok()?;
19 
20         // TODO: properly parse 'conds', 'persist', and 'cmds' fields in 'Z' packets
21 
22         Some(Z { type_, addr, kind })
23     }
24 }
25