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
Comprehensive Debug-impls for all structs #49
Comprehensive Debug-impls for all structs #49
Conversation
Hi, Yes I like this thanks for improving the debug output! It seems it also sometimes prints the private struct members (eax, ebx etc.) which wouldn't be accessible by the user of the library and I'm not sure if this will be confusing or beneficial (beneficial since it could help a user figure out why some value is like it is, or validating if there is a bug)? Any particular other reason why we should include them? CI seems to fail because of cargo fmt, it does a |
Ah I see, I formatted everything, now it seems to be fine @gz I'm not sure about eax/ebx/ecx etc. Probably you are right. As long as there is no getter for it nor the member is public, this is an irrelevant information. Should I remove it and then we are ready to go? |
Yes let's remove it and then we merge it. IMO if someone wants the register values he can just do cpuid!(). |
With this commit I add missing debug formatting for a few structs I missed first + all iterators. Raw register values are not debug-formatted now, when there are more valuable getter functions.
Some register values are reserved for future used and currently not used, since they are no longer in the debug output.
@gz I removed the debug-format for register values at all places (except CpuIdResult). Furthermore I found out that I missed the output of some fields/methods, because they are created by macros - I fixed it. I'm confident that the debug-formatting includes now all important fields+methods. Furthermore the debug-fmt of Iterators works now. Current debug-fmt output of
|
Merged thanks for all the work on this! |
Released as 9.1.1 |
Hi! In my opinion this crate missed comprehensive debug impls for all structs. I changed all outputs for eax, ebx etc. to hex-based outputs and invoke all important methods for each struct and would like to propose you this MR.
ONLY BLOCKER SO FAR: Similar to the std vector,
vec::iter()
should print all elements of the iterator when debug-formatted. This is currently not possible, because I didn't found a nice way to solve this in code.Example debug output of
CpuId::new()
on my system with the new code:What do you think? I think this would be pretty useful. I typically like to debug-format structs to see what I can get from them. I think others will benefit from this as well.
PS: I don't know why CI is failing?!