-
-
Notifications
You must be signed in to change notification settings - Fork 75
stackdump integration for better backtraces #322
Comments
I made a branch with some initial changes here: https://github.com/tweedegolf/stackdump/tree/probe |
So, I made an implementation that works for my CLI, see the stackdump PR above. But even if that gets merged, that won't be in an official release until probe-rs 0.13. |
@diondokter nice! re: fpu registers, I think it's fine if they are not read and |
That is great news! 🎉 Firstly, I agree with Jorge, that having non-float arguments being reported is already a good addition which is worth integrating. Secondly, speaking from past experience, it might take some time until the next probe-rs version releases, so I think we can move on without float support and add that as soon as the next probe-rs gets released. |
I have released I've got my own CLI as well and this is the usage: https://github.com/tweedegolf/stackdump/blob/master/cli/src/probe.rs Printing is done like here: https://github.com/tweedegolf/stackdump/blob/master/cli/src/main.rs#L123-L163 |
the set of stackdump crates provide a mechanism to dump the contents of a device's memory (
stackdump-capture
) and analyze those stack dumps (stackdump-trace
). thetrace
crate, in particular, can produce stack backtraces more complete thanprobe-run
's as they include information about function arguments (see #62)we'd like to make use of the
trace
crate to improveprobe-run
's backtraces but we'd like to avoid copying the whole stack memory from the device to the host as that's rather slow (see--measure-stack
feature in early v0.3.x), which is the mechanism provided by thecapture
crate.the integration work would consist of two parts
implementing the
RegisterData
andMemoryRegion
traits for theprobe_rs
API. I suggest using a newtype over&mut probe_rs::Core
, e.g.pub Stackdump<'a>(pub &'a mut probe_rs::Core)
. rationale: some of theprobe-rs
API uses theMutex<Session>
(e.g.gdb-server
); a newtype over the value is not compatible with such API. as this is a reusable component it may be better for it to reside outside ofprobe-run
as a libraryreplacing
probe-runs
's backtrace implementation withstackdump-trace
's API. the API is generic; it needs to be instantiated with the newtype implemented in (1)potential integration problems
RegisterData
andMemoryRegion
are infallible. aprobe_rs
implementation can fail due to IO errors but there's no proper way to bubble up the result so one can map the result intoNone
orunwrap
all internalResult
s'static
bound instackdump_core::DeviceMemory::add_memory_region
may be incompatible with the newtype over a reference; see (1)The text was updated successfully, but these errors were encountered: