Skip to content
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

Format variables output when debugging #319

Open
josesimoes opened this issue Oct 31, 2016 · 9 comments
Open

Format variables output when debugging #319

josesimoes opened this issue Oct 31, 2016 · 9 comments

Comments

@josesimoes
Copy link

It would be nice to be able to choose the format of the variables when in debug.
Right now the output seems to be fixed as decimal. Sometimes is convenient to see the value in hexa or binary.
(this is applicable for both the variables list output and for the "mouse over" display)

@jacdavis
Copy link

Are you debugging with the windows debugger, gdb, or lldb? If it is the windows debugger, you can use a format specifier to change the format. For example, to see the value in binary, use "value,b" in the watch window. For lldb and gdb, this is currently only supported in the debug console with -exec.

@josesimoes
Copy link
Author

@jacdavis I'm using gdb. Could you please add this as a suggestion for future enhancement?

@jacdavis
Copy link

It turns out, gdb has a few format specifiers of its own. They are 'h', (or 'x') for hex and 'o' for octal.

@josesimoes
Copy link
Author

Got you.
Question: isn't easier to 'just' format the output (according to the user preference) when actually outputting to the screen rather then having to go and config gdb to output the variable with this or that format?

@nilanjan
Copy link

Any update on this? Can you guys move it to the higher priority list?

@staffann
Copy link

I filed a suggestion with vscode but was told that it was something that was related to the extension. This issue seems to cover my request, but I enclose my original text:

I'd like to be able to select in which format I see the values of local and watched variables in the debugger. It would be preferred to have a generic setting but be able to change it per variable.

The way that it is now I often need to use a exteral dec-to-hex converter and copy the values from VS Code. Being able to see them in hex directly in the debugger would be a great help!

I mostly debug C/C++ programs but I imagine that this is generic for all languages.

VSCode Version: 1.12.2
OS Version: Linux Ubuntu 16.04 LTS

Steps to Reproduce:
Start debugging
Add a watched variable or two.
Set a breakpoint and run
When stopping at the breakpoint, take a look at the values of the watched and local variables. They are all given in decimal values (except pointers that are hex).

@nilanjan
Copy link

Is there any timeline for this feature implementation in GUI local var display?

@aenima1891
Copy link

"watch" variables binary representation would be very useful

asialasr pushed a commit to asialasr/vscode-cpptools that referenced this issue Mar 12, 2021
Query debugger for target architecture instead of relying on launch o…
@mrx23dot
Copy link

mrx23dot commented Jul 9, 2024

In professional tools when I right click on watch item I can set formats:

image

So that would be nice.
I believe this issue has enough upvotes.

For point and show just install extension "HexInspector"
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants