diff --git a/examples/armv4t/gdb/tracepoints.rs b/examples/armv4t/gdb/tracepoints.rs index 84a5408..7133f0a 100644 --- a/examples/armv4t/gdb/tracepoints.rs +++ b/examples/armv4t/gdb/tracepoints.rs @@ -6,7 +6,7 @@ use gdbstub::target::ext::tracepoints::ExperimentStatus; use gdbstub::target::ext::tracepoints::FrameDescription; use gdbstub::target::ext::tracepoints::FrameRequest; use gdbstub::target::ext::tracepoints::NewTracepoint; -use gdbstub::target::ext::tracepoints::TraceBuffer; +use gdbstub::target::ext::tracepoints::TraceBufferConfig; use gdbstub::target::ext::tracepoints::Tracepoint; use gdbstub::target::ext::tracepoints::TracepointAction; use gdbstub::target::ext::tracepoints::TracepointItem; @@ -96,7 +96,7 @@ impl target::ext::tracepoints::Tracepoints for Emu { } } - fn trace_buffer_configure(&mut self, _tb: TraceBuffer) -> TargetResult<(), Self> { + fn trace_buffer_configure(&mut self, _config: TraceBufferConfig) -> TargetResult<(), Self> { // we don't collect a "real" trace buffer, so just ignore configuration // attempts. Ok(()) diff --git a/src/protocol/commands/_QTBuffer.rs b/src/protocol/commands/_QTBuffer.rs index 50d0226..f190e38 100644 --- a/src/protocol/commands/_QTBuffer.rs +++ b/src/protocol/commands/_QTBuffer.rs @@ -1,8 +1,8 @@ use super::prelude::*; -use crate::target::ext::tracepoints::{BufferShape, TraceBuffer}; +use crate::target::ext::tracepoints::{BufferShape, TraceBufferConfig}; #[derive(Debug)] -pub struct QTBuffer(pub TraceBuffer); +pub struct QTBuffer(pub TraceBufferConfig); impl ParseCommand<'_> for QTBuffer { #[inline(always)] @@ -14,7 +14,7 @@ impl ParseCommand<'_> for QTBuffer { match opt.as_ref() { b"circular" => { let shape = s.next()?; - Some(QTBuffer(TraceBuffer::Shape(match shape { + Some(QTBuffer(TraceBufferConfig::Shape(match shape { [b'1'] => Some(BufferShape::Circular), [b'0'] => Some(BufferShape::Linear), _ => None, @@ -22,7 +22,7 @@ impl ParseCommand<'_> for QTBuffer { }, b"size" => { let size = s.next()?; - Some(QTBuffer(TraceBuffer::Size(match size { + Some(QTBuffer(TraceBufferConfig::Size(match size { [b'-', b'1'] => None, i => Some(decode_hex(i).ok()?) }))) diff --git a/src/protocol/commands/_QTDP.rs b/src/protocol/commands/_QTDP.rs index f681151..12433b9 100644 --- a/src/protocol/commands/_QTDP.rs +++ b/src/protocol/commands/_QTDP.rs @@ -33,7 +33,7 @@ impl<'a> ParseCommand<'a> for QTDP<'a> { let body = buf.into_body(); match body { [b':', b'-', actions @ ..] => { - let mut params = actions.splitn_mut(4, |b| matches!(*b, b':')); + let mut params = actions.splitn_mut(4, |b| *b == b':'); let number = Tracepoint(decode_hex(params.next()?).ok()?); let addr = decode_hex_buf(params.next()?).ok()?; let actions = params.next()?; diff --git a/src/target/ext/tracepoints.rs b/src/target/ext/tracepoints.rs index 272cc96..e59b4d2 100644 --- a/src/target/ext/tracepoints.rs +++ b/src/target/ext/tracepoints.rs @@ -411,7 +411,7 @@ pub enum BufferShape { /// Configuration for the trace buffer. #[derive(Debug)] -pub enum TraceBuffer { +pub enum TraceBufferConfig { /// Set the buffer's shape. Shape(BufferShape), /// Set the buffer's size in bytes. If None, the target should use whatever @@ -502,7 +502,7 @@ pub trait Tracepoints: Target { ) -> TargetResult::Usize>>, Self>; /// Reconfigure the trace buffer to include or modify an attribute. - fn trace_buffer_configure(&mut self, tb: TraceBuffer) -> TargetResult<(), Self>; + fn trace_buffer_configure(&mut self, config: TraceBufferConfig) -> TargetResult<(), Self>; /// Return up to `len` bytes from the trace buffer, starting at `offset`. /// The trace buffer is treated as a contiguous collection of traceframes,