-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Hex/Binary display of debug variables in C++ #557
Comments
@nilanjan I'll add it to the backlog but in the meantime you can use the gdb-mi command: This is the same request as #319 |
Does it work for lldb too? |
@nilanjan I don't have my MacBook with me but I can try it tomorrow and let you know. |
Tried this on MacBook, but this does not work. Got following message. Driver. Received command '45-exec -var-set-format hex'. It was not handled. Command 'exec' not in Command Factory (from exec -var-set-format hex)_ |
Any update on this? This is significantly affecting productivity. Can you point where to add this feature? |
How do I specify the variable name with the below command in the debug console? If I use the above command while on a breakpoint (using gbg) I always get the error "msg: Variable object not found" but adding the variable name to the watch window works. |
@Numinel Are you doing this on Mac or Linux? So the format of I enabled
So for instance, my variable here is |
I use Linux. The log show that my variable is mapped to the internal name "var29" and when using the command '-exec -var-set-format "var29" hex' the output will be shown as hexadecimal. Adding a variable to the watch window with ",h" is way better though. |
Is there any timeline for this feature implementation? |
@nilanjan Not at this time. If you feel like it is something you would like to contribute we welcome community support. You can find source code at: https://github.com/Microsoft/MIEngine. |
This feature has been on the backlog for a while now, any plans to resurrect this feature request from the dead? |
When I enabled the logging to decipher the transposed variable name the out on the Debug Console shows me the value in hex, but the Variable in the Debug tab still remains as decimal -exec -var-set-format var158.param1 hexadecimal From this particular experiment this is not a viable long term work around |
@EmbeddedBacon That is the expected behavior. If you change the var-set-format, it will change it for all future calls but existing data is not updated as the UI hasn't requested to refresh yet. We don't have a gesture in the UI to change the value and I haven't had time to investigate if VS Code's extensibility contains the ability to add this feature. |
@pieandcakes Thanks for the info, but I still couldn't get it to work. This will not work with Locals under Variables since I don't control those. I did try this in the Watch panel, but this doesn't seem to work correctly. I also noticed the translated variable is always changing. In one case the varible "pFsaCmd" was initially var39, then var40, then var42, then var43, then etc. If I didn't have pFasCmd in the Watch panel, then after trying to set its format. I tried setting the format to pFasCmd and pFasCmd.param1, but unfortunately neither worked for me. I am not sure what I am doing wrong. Here is the output from the Debug Console. If I were to look into this, what area of the code base would I look at? MI Log
|
@EmbeddedBacon if you are trying to view just a few items as hex for Every time a As a reference, here is the documentation for variables through Depending if they make it a global or per variable flag, we would need to do work to let the Eval call know that we want something other than the |
For watch variables and natvis you can use format specifiers. See microsoft/MIEngine#1031. |
microsoft/vscode#70377 |
https://code.visualstudio.com/updates/v1_49#_contributable-context-menu-for-variables-view |
You should link to it instead of posting a screenshot: microsoft/vscode#28025 (comment) |
Fix for StopAtEntry when using gdbserver
Today I had this problem too. 'b'(binary) and 'o'(octal) both work, but, 'x' or 'h' dosen't work, |
I'm also seeing that ,x and ,h don't work but the rest of them do work. |
Which version of gdb are you using? "logging": {
"engineLogging": true
}, |
@Trass3r My gdb version: 7.3.1. I'll try that "engineLogging" option tomorrow. |
Indeed, it may not support the format specifier. |
I can also try the logging when j get a chance. Note that doing ,b does work and I see the variable in binary. I'm also able to just use the debug console to print my variable in hex with -exec p/x <var_name>. |
Well binary wasn't implemented before so it looks like my https://github.com/microsoft/MIEngine/pull/1031/files got silently integrated by now. I can only imagine your gdb version not supporting |
Yeah -exec p/z doesn't work on my GDB. Does this mean your changes actually always use p/z (var,z) even if we only specify ,x which is supported as p/x? |
There is no |
Well that's not my decision. But I personally wouldn't support those old versions. I had to work with gdb 7 last year and it was unusably slow at loading symbols and had annoying bugs. So I manually compiled gdb 10 and never looked back. |
@Trass3r @danielbee I figure it out now after reading you two's discuss, Thanks a lot ! Time to upgrade my GDB. |
Make it happen, please! |
GPT4: 在 GitHub issue 上发表评论,提供详细的需求说明和使用场景,以便微软团队更好地理解您的需求。 Providing feedback or feature requests to Microsoft is a great approach, as they usually pay attention to the community's input. In this case, the issue has already been submitted in the vscode-cpptools repository on GitHub and has gained some attention. To try to get Microsoft employees to implement this feature more quickly, you can do the following: Comment on the GitHub issue, providing a detailed explanation of your requirements and use cases, so that the Microsoft team can better understand your needs. |
This would be a great feature to have especially for cpp/c developer, and since vscode provide the menu option, could you please take a look on this feature again? |
Is there any new/progress? It seems to be an essential feature for C++. ESP32 has moved into VSC from eclipse IDE. |
Duplicate of #319 |
OS - Linux and Mac
Hex (Octal, Binary etc.) display of variables in watch or variable window in debug is not available. This is absolutely imperative for the C++ developers.
Please provide support.
The text was updated successfully, but these errors were encountered: