Support for dumping variables using 'printf' for testing scenarios where std is not avalible.#3
Open
FractalFir wants to merge 22 commits intocbeuw:masterfrom
Open
Support for dumping variables using 'printf' for testing scenarios where std is not avalible.#3FractalFir wants to merge 22 commits intocbeuw:masterfrom
FractalFir wants to merge 22 commits intocbeuw:masterfrom
Conversation
…is not toglable, needs cleanup).
Author
|
A question: Is there an upper bound on tuple element count? If so, what is it? |
Owner
|
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 |
cbeuw
reviewed
Jan 31, 2024
Comment on lines
29
to
30
| 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)"), |
Owner
There was a problem hiding this comment.
CLI stability is not a concern. So you could replace -d with a single enum flag with 3 options, defaulting to HashDumper
cbeuw
reviewed
Jan 31, 2024
mir/src/syntax.rs
Outdated
| fn printf(fmt: *const c_char, ...) -> c_int; | ||
| } | ||
| trait PrintFDebug{ | ||
| fn printf_debug(&self); |
Owner
There was a problem hiding this comment.
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
f62f4da to
0bf9128
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
rustlantisto work without using the standard Rust lib.This pull request adds the ability to dump variables using
printfinstead of the standard Rust formatter, when the--printf_debugoption is specified.