gdbstub/protocol/commands/_qAttached.rs
1use super::prelude::*;
2use crate::common::Pid;
3
4#[derive(Debug)]
5pub struct qAttached {
6 pub pid: Option<Pid>,
7}
8
9impl<'a> ParseCommand<'a> for qAttached {
10 #[inline(always)]
11 fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
12 let body = buf.into_body();
13 let pid = match body {
14 [b':', pid @ ..] => Some(Pid::new(decode_hex(pid).ok()?)?),
15 _ => None,
16 };
17 Some(qAttached { pid })
18 }
19}