-
Notifications
You must be signed in to change notification settings - Fork 3
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
Support for dumping variables using 'printf' for testing scenarios where std is not avalible. #3
base: master
Are you sure you want to change the base?
Conversation
…is not toglable, needs cleanup).
A question: Is there an upper bound on tuple element count? If so, what is it? |
Have to say I'm flattered that my code is readable enough for someone else to work on it 😛
12: https://doc.rust-lang.org/std/primitive.tuple.html#trait-implementations-1 |
arg!(-d --debug "generate a program where values are printed instead of hashed (slow)"), | ||
arg!(-p --printf_debug "generate a program where values are printed using the C 'printf' function instead of hashed (slow)"), |
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.
CLI stability is not a concern. So you could replace -d
with a single enum flag with 3 options, defaulting to HashDumper
mir/src/syntax.rs
Outdated
fn printf(fmt: *const c_char, ...) -> c_int; | ||
} | ||
trait PrintFDebug{ | ||
fn printf_debug(&self); |
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.
Could you make it unsafe fn
here and in the implementations instead of using unsafe blocks?
…it for all tuples up to 12 elements
… Fixed issues with printing struct members
I was interested in using this project to detect bugs in my experimental codegen backend. I don't have support for Rust formatting yet, so I tried to get
rustlantis
to work without using the standard Rust lib.This pull request adds the ability to dump variables using
printf
instead of the standard Rust formatter, when the--printf_debug
option is specified.