-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
feat(chisel): rawstack
/ rs
command
#3982
feat(chisel): rawstack
/ rs
command
#3982
Conversation
fireee |
how/does this work w/ memory types like strings or packed structs? |
For memory types, it'll just give you the memory pointer (which is the corresponding stack value for any memory var). bytes32 __raw__;
assembly {
// if `to_inspect` is a memory var, it will equal the pointer to the var's data in memory
__raw__ := to_inspect
} Included that piece in the help menu for anyone unfamiliar w/ how that works 😄 |
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.
codewise lgtm, pending approval @transmissions11
chisel/src/dispatcher.rs
Outdated
DispatchResult::CommandFailed(String::from( | ||
"Variable must exist within `run()` function.", | ||
)) |
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.
nit:
DispatchResult::CommandFailed(String::from( | |
"Variable must exist within `run()` function.", | |
)) | |
DispatchResult::CommandFailed( | |
"Variable must exist within `run()` function.".to_string()) |
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.
There's definitely some inconsistencies across chisel w/ String::from(...)
/ .to_owned()
/ .to_string()
. Is to_string()
what you guys normally go w/ ?
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.
they are all the same, but to_string
is preferable because it is immediately clear what it does
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.
Got it- changed this one for now, can go through and change others when I get back home 👍
9ff6668
to
9f2e7a0
Compare
there are apparently conflicts, but github doesn't display which files are affected -.- @clabby could you please merge master and resolve conflicts |
Done 👍 |
Overview
Adds a new
!rawstack
/!rs
command to chisel that displays the raw value of a variable's stack allocation.Motivation
Feature requested by @transmissions11
Solution
run()
function, whereto_inspect
is the argument supplied to!rawstack
__raw__
variable.Usage