rtic-scope / cargo-rtic-scope

Non-intrusive ITM tracing/replay toolset for RTIC programs with nanosecond timestamp accuracy.
16 stars 4 forks source link

Emit warning on DWT watch address read #95

Closed tmplt closed 2 years ago

tmplt commented 2 years ago

In recovery.rs:

                TracePacket::DataTraceValue {
                    comparator,
                    access_type,
                    value,
                } if *access_type == MemoryAccessType::Write => ...,
                _ => events.push(EventType::Unknown(packet.clone())),

A DWT comparator match on a read is thus treated as unknown, even though it could indicate an error of some kind. While the action is not defined in the context of RTIC Scope, warning the user that an unexpected read occurred to a variable hidden from the user (indicative of something going very wrong) is a good idea. The packet should still be treated as unknown for replay purposes.

tmplt commented 2 years ago

We mustn't forward the event: itm structures are spooled to file, not API structures. But the content of the read may be of interest, anyhow.