• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 use super::prelude::*;
2 
3 #[derive(Debug)]
4 pub struct R;
5 
6 impl<'a> ParseCommand<'a> for R {
7     #[inline(always)]
from_packet(buf: PacketBuf<'a>) -> Option<Self>8     fn from_packet(buf: PacketBuf<'a>) -> Option<Self> {
9         crate::__dead_code_marker!("R", "from_packet");
10 
11         // Technically speaking, the `R` packet does include a hex-encoded byte as well,
12         // but even the GDB docs mention that it's unused (heck, the source-level
13         // comments in the GDB client suggest no-one really knows what it's used for).
14         //
15         // We'll pay some lip-service to this requirement by checking the body's length,
16         // but we won't actually parse the number.
17         let body = buf.into_body();
18         if body.len() != 2 {
19             None
20         } else {
21             Some(R)
22         }
23     }
24 }
25