Set Value Format Property to Hex#208
Set Value Format Property to Hex#208omarArm wants to merge 14 commits intoeclipse-cdt-cloud:mainfrom
Conversation
|
Sorry, I had to convert to draft because of debug session breaking for an unknown reason Edit: ready for review |
|
From a quick glance, it looks like this would interfere with any debugger, not just ones based on cdt-gdb-adapter. Do we want that? There may be programming languages in which a One would expect that if DAP defines a |
|
I think the Discarding the |
|
@cwalther I forgot about the I refactored the code and made it easier to add new debug types. However, I am not sure I entirely get what you mean with adding it to the official API of the extension? do you mean adding some sort of command so users can provide a string to do so? or is there something that I am missing? if so please point me to a documentation that shows what I am missing |
|
Regarding extension API: Does this help?
Regarding the code: I’m not sure how registering for both I would like to be able to do something like this in my extension’s const GdbDebugTracker = vscode.extensions.getExtension('eclipse-cdt.cdt-gdb-vscode').exports.GdbDebugTracker;
context.subscriptions.push(vscode.debug.registerDebugAdapterTrackerFactory("inos", new
GdbDebugTracker()));or const GdbDebugTracker = vscode.extensions.getExtension('eclipse-cdt.cdt-gdb-vscode').exports.GdbDebugTracker;
context.subscriptions.push(new GdbDebugTracker().register("inos"));or context.subscriptions.push(vscode.extensions.getExtension('eclipse-cdt.cdt-gdb-vscode').exports.registerDebugTracker("inos"));or maybe we can come up with a better API. |
|
done. However, I don't have any way to test this, so please let me know how it goes on your setup |
cwalther
left a comment
There was a problem hiding this comment.
Sure, I will give it a try once it stabilizes.
We are getting closer, but I don’t think this will work as intended yet because it adds the Disposable to the subscriptions of the cdt-gdb-vscode extension and not of the calling extension.
|
Done, sorry for taking so long. It is my first exposure to the idea of providing extension APIs |
|
No worries, we are all learning together! (It generally seems like cdt-gdb-vscode/cdt-gdb-adapter were not specifically designed with extenders like what I am currently trying in mind, but we can pave the way as we go.) You are still discarding the disposable, just one step further. Returning it from the |
|
Done |
|
TBF: I am not overly happy with passing the entire tracker object through the extension API and giving direct access to disposables which should be owned by the CDT GDB Adapter. Feels a bit unsafe. An alternative could be to expose the supported types as a VS Code extension setting. But that is probably not as convenient for reusing the extension. @cwalther , may I ask how you reuse this for your own type? Do you use this extension off-the-shelf and only have a customized version of the adapter? |
That is a good question, and is in fact something I have meant to discuss for a while. This detail discussion here is probably not the right place for that, so I have opened an new issue for it: #209. Maybe that already addresses your concerns, otherwise I am happy to go into more detail on why I think what you propose wouldn’t work. |
|
Thanks for sharing more details, @cwalther . This is indeed a discussion we should have rather sooner than later to avoid designing ourselves into a corner. Note that we at Arm use a managed launch.json/tasks.json approach in CMSIS Solution/CMSIS Debugger and expect only expert users to look at the JSON files themselves (we had a similar but not the same approach like you in the beginning where we registered a For this PR, I would suggest to keep the extension API out for the time being and limit to |
That is fine with me. |
|
@cwalther @jreineckearm if so, I will revert the changes for adding to the extension API |
Yes, please. Let's finish this increment here and take a bit of time to think the entire adoption story through, first. |
jonahgraham
left a comment
There was a problem hiding this comment.
I don't understand why the logic should be in the extension and not in the adapter. i.e. in evaluateRequest in the adapter parse out the ,x in a similar way that > is handled. In otherwords, is there some strong reason we should implement this in the extenion?
|
@jonahgraham So I have two reasons for doing it through the extension and not the adapter.
|
|
I am not sure the logic to set Also, what about messages that already contain a |
|
After offline discussions with @jreineckearm, we decided to close this PR and switch the implementation to the adapter's side. Please refer to eclipse-cdt-cloud/cdt-gdb-adapter#506 |
Almost implements #206
After investigations, it turns out that most widely used C/C++ extensions just append expressions in the watch window with a
,xto view values in hex. This has been implemented here as well, instead of a context menu entry.