1 use super::prelude::*; 2 use crate::target::ext::tracepoints::Tracepoint; 3 4 #[derive(Debug)] 5 pub struct qTP<'a> { 6 pub tracepoint: Tracepoint, 7 pub addr: &'a [u8], 8 } 9 10 impl<'a> ParseCommand<'a> for qTP<'a> { 11 #[inline(always)] from_packet(buf: PacketBuf<'a>) -> Option<Self>12 fn from_packet(buf: PacketBuf<'a>) -> Option<Self> { 13 let body = buf.into_body(); 14 match body { 15 [b':', body @ ..] => { 16 let mut s = body.split_mut(|b| *b == b':'); 17 let tracepoint = Tracepoint(decode_hex(s.next()?).ok()?); 18 let addr = decode_hex_buf(s.next()?).ok()?; 19 Some(qTP { tracepoint, addr }) 20 } 21 _ => None, 22 } 23 } 24 } 25