-
Notifications
You must be signed in to change notification settings - Fork 14
Track dbg! calls #293
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track dbg! calls #293
Conversation
d466ab0
to
7c43d07
Compare
In 7c43d07: Rather than feature-gating it, can you add a new trait method Also sorry for the late review -- I assumed from the name that this PR was much bigger than it was! |
7c43d07
to
2806157
Compare
Done! Haha no worries, minimised footprint was the goal :) |
|
||
fn is_track_debug_enabled(&self) -> bool { | ||
// Set flag to test frame decoding in unit tests | ||
cfg!(test) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not ideal, but I don't have a better idea
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, I think it's ok. Agree that it looks pretty weird, but the nice thing is that cfg(test)
is only ever set within this project, so we don't need to worry about this weirdness somehow being exposed to our dependencies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess the "right" way to do it is to add a whole nother Tracker
type for use in tests. But I think this is fine for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK 2806157; successfully ran local tests
This PR extends the
ExecTracker
trait to support tracking debug calls (identity nodes generated bydbg!
macro in Simfony). It is enabled by featuredebug
to avoid the decoding overhead by default.Ported from https://github.com/uncomputable/simfony-webide/blob/adb60d4e60c0d6b019ea13f64b1a166da3467d8d/src/function.rs#L144
Example of usage: https://github.com/keep-starknet-strange/stark-symphony/blob/37b0a1892c69ea3b0f2d1c8088563e7fae7c3825/simfony-cli/src/tracker.rs#L65
Sample output
