BugStalker icon indicating copy to clipboard operation
BugStalker copied to clipboard

Inspect using the Debug trait

Open gustavo-hms opened this issue 1 year ago • 1 comments

Hi!

First of all, thanks for this amazing work.

I'd like to propose to display values (when, say, you use the var command or on the TUI interface) using the information available in the Debug trait for the types that implement it instead of displaying the raw data. It would be much easier to inspect and navigate the data if we saw the data as it was meant to be displayed in a debug context. This visualization could eventually be made togglable if the user needs to see the raw data.

gustavo-hms avatar Oct 03 '24 15:10 gustavo-hms

Thanks for your rating!

This is definitely a great idea. But at the moment I don't know how to implement it, there are too many questions. For example, in which process should we execute the Debug::fmt function (in debugger or in debugee), or what if the Debug::fmt function has side effects.

I will definitely look into these questions, but unfortunately not in the near future.

godzie44 avatar Oct 06 '24 19:10 godzie44

Nice!!! I'm gonna try it as soon as I have some time.

Thank you!

gustavo-hms avatar Apr 29 '25 17:04 gustavo-hms

You're welcome! Please note that there is one limitation: the implementation of the Debug::fmt trait must exist in the code generated by the compiler. In other words, if you have a Foo structure that implements Debug, there should be one or more places in the program where it's actually used (or the compiler will remove this code).

godzie44 avatar Apr 29 '25 18:04 godzie44