You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
xisui-MSFT yes, but can you clarify, what is the actual issue? Elements should not automatically horizontally scroll as far as I know and there is no programatic way to control horizontal scrolling.
Isidor Nikolic (@isidorn) Yes. In the original PR we talked about changing the table to a list, to support horizontal scrolling. However, I wasn't able to find a way to fix the breakpoint column (or elements, since we don't have a column concept in list anymore) from scrolling horizontally. Original discussion: #125737 (comment)
Also another question, we would like to implement show/hide source code function, so the source lines (zero or more) can be shown above the corresponding disassembly lines or hidden. I.e., switching between
...
disassembly 1
disassembly 2
disassembly 3
...
and
...
source A
source B
disassembly 1
source C
disassembly 2
disassembly 3
..
I'm not sure we can do this easily using list? Also looked at trees, doesn't seem to be what we want since this is not a one-to-many map but more like a many-to-many one... It would be great if you could provide some suggestions. Thanks!
Aha, so you want to be able to horizontally scroll while still having the breakpoint visible. I suggest to create a new issue and we continue the discussion there. I am not 100% sure how to achieve this but CSS tricks should be possible.
For show / hide source function. I would add a context menu action Show Source Function / Hide Source Function. Once that action is triggered you would splice the whole table and your model should be aware that it now needs to feed in the source lines to the tableDataSource. For source lines you would introduce a new renderer and that is it. So should be possible and not hard.
Hi Isidor Nikolic (@isidorn), I am looking to adding Show Source Code. From the disassembly, it provides URI and line number.
I see that ITextModel has getLineContent() but I am not sure how to get TextModel. Maybe use NativeTextFileService to open the stream to new TextModel? Another concern is caching, I want to limit open and closing the same file. Are there existing tool for this?
Thanks.
Isidor Nikolic (@isidorn), here is the view in VS. The source code of cpp has is intereved between disassembly.
The disassemble response contains "Source" information such as filepath, start/end line and column. The viewer needs to render the file content. It is like a simpler "peek" view. Showing "colorization" is an added benefit that is not required. A link to open the file should the user decide to make edits is possible.
Yue (Felix) Huang (@yuehuang010) ok great, so you would handle the rendering in your table by having special elements that are actually representing the source lines, that way it would be inter-mingled. You will not have colorisation here easily.
Context menu -> "Open Source in Editor" -> use the editor service to open the URI as I suggested in the comment above.
I was wondering how hard it would be to get a working Disassembly view for other languages that can be debugged through GDB or LLDB? Basically we would like to get the Disassembly view working for the Ada language, but since the view is only available for C/C++ files, I can't get it work.
Does someone have ideas on how could this work? Also, let me know if this discussion should occur on a separate issue, I can open one if needed!
The disassembly support is not dependent on the language or even the debugger like gdb/lldb. Your debug adapters (interface between gdb/lldb and VSCode) have to support it and even they do not much care (in many instances) what language is being used.
Not clear what debug adapter (or extension) you are using to debug your ADA program today...and this request would belong to that extension to support the protocols required by the VSCode disassembler (documented in the Debug Adapter Protocol).
If you can debug via gdb/lldb however, then you can even use existing debuggers (cppdbg from cpptools) to debug your executable. For instance, you can debug a program written in Rust because the compiler produces and ELF file that can be debugged via GDB/LLDB
When you setup your launch.json for cppdbg just make sure you are using your elf file if you have one and then you should be able to use it just like C/C++/Rust programmers do.
I can say this because I author a debug adapter extension that supports disassembly and any language is fine with us so long as we can debug with GDB.
Currently we are using the Native Debug extension to debug Ada code, which launches GDB basically. But when using it I don't get the 'Open disassembly view' contextual menu when debugging.
I tried to usecppdbg do debug my Ada code, but the menu was not available too, while it was the case when debugging C/C++. It may be a setup issue, I will try again. I just wanted to make sure that there is nothing that prevents me to get this feature when using GDB but for other languages such as Ada, and apparently it's the case from what you say ;)
Yes, Native Debug will have to support disassembly. We originally forked from that several years ago,
Note that the launch.json contents will be very different for cppdbg. Just follow instructions/examples for cppdbg as if you have a C++ program. cppdbg will not know the difference.
So I have tried to use cppdg by using a simple launch.json configuration found on the web, and I am able to debug my Ada code properly on simple projects. The Open Disassembly View contextual menu is available, I can see the disassembly in the Debug Console, but I get a new view with Disassembly not available at the end, without knowing exactly why.
Any ideas of what could be wrong? I have attached my launch.json contents and a simple screenshot, if that helps.
Can you get disassembly from gdb command line? If not neither can cpptools. It has to do with how you compiled (did you compile for debug and saving saving/debug info).
You should file an issue with cpptools if gdb works but cpptools isn't giving you disassembly. Just for fun, try a larger program with at least a few thousand instructions.
Yes, I can get disassembly from GDB's command line. Note that I am also able to get the Assembly view working in GNAT Studio (an IDE dedicated to Ada), with the same compiled executable (compiled with -g -O0)
Attaching the whole GDB output: as you can see, the -data-disassemble seems to work fine.
You should approach the cpptools team for help. It appears they are doing the right thing but why you are seeing an empty Disassembly window, I cannot explain.
Another point that I haven't logged yet, the zoom in the disassembly view zooms the whole UI, instead of just the editor pane like other code panes does...
Activity
yuehuang010 commentedon Jul 29, 2021
Isidor Nikolic (@isidorn) Andre Weinand (@weinand)
isidorn commentedon Jul 29, 2021
Yue (Felix) Huang (@yuehuang010) Thanks for creating this. We can find all disassembly open issues by looking at what is linked from the test plan item here #129161
And looking at open issues assigned to August that have
debuglabel https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+milestone%3A%22August+2021%22+label%3Adebugxisui-MSFT commentedon Aug 6, 2021
Isidor Nikolic (@isidorn) Can you please help me to investigate how to fix an element from horizontally scrolling in a list? Thanks!
isidorn commentedon Aug 6, 2021
xisui-MSFT yes, but can you clarify, what is the actual issue? Elements should not automatically horizontally scroll as far as I know and there is no programatic way to control horizontal scrolling.
xisui-MSFT commentedon Aug 6, 2021
Isidor Nikolic (@isidorn) Yes. In the original PR we talked about changing the table to a list, to support horizontal scrolling. However, I wasn't able to find a way to fix the breakpoint column (or elements, since we don't have a column concept in list anymore) from scrolling horizontally. Original discussion: #125737 (comment)
Also another question, we would like to implement show/hide source code function, so the source lines (zero or more) can be shown above the corresponding disassembly lines or hidden. I.e., switching between
and
I'm not sure we can do this easily using list? Also looked at trees, doesn't seem to be what we want since this is not a one-to-many map but more like a many-to-many one... It would be great if you could provide some suggestions. Thanks!
isidorn commentedon Aug 6, 2021
Show Source Function/Hide Source Function. Once that action is triggered you wouldsplicethe whole table and your model should be aware that it now needs to feed in the source lines to thetableDataSource. For source lines you would introduce a new renderer and that is it. So should be possible and not hard.yuehuang010 commentedon Aug 17, 2021
Hi Isidor Nikolic (@isidorn), I am looking to adding Show Source Code. From the disassembly, it provides URI and line number.
I see that ITextModel has getLineContent() but I am not sure how to get TextModel. Maybe use NativeTextFileService to open the stream to new TextModel? Another concern is caching, I want to limit open and closing the same file. Are there existing tool for this?
Thanks.
isidorn commentedon Aug 18, 2021
Yue (Felix) Huang (@yuehuang010) can you clarify? Do you have an
URIand aline numberand just want to open an editor for those? In that case just use theeditorService.openEditorand pass youruriandlineNumber.yuehuang010 commentedon Aug 18, 2021
Isidor Nikolic (@isidorn), here is the view in VS. The source code of cpp has is intereved between disassembly.

The disassemble response contains "Source" information such as filepath, start/end line and column. The viewer needs to render the file content. It is like a simpler "peek" view. Showing "colorization" is an added benefit that is not required. A link to open the file should the user decide to make edits is possible.
isidorn commentedon Aug 19, 2021
Yue (Felix) Huang (@yuehuang010) ok great, so you would handle the rendering in your table by having special elements that are actually representing the source lines, that way it would be inter-mingled. You will not have colorisation here easily.
Context menu -> "Open Source in Editor" -> use the editor service to open the
URIas I suggested in the comment above.yuehuang010 commentedon Aug 19, 2021
Isidor Nikolic (@isidorn), Is using NativeTextFileService nad TextModel the way to go? Or are there another way to open the file?
isidorn commentedon Aug 19, 2021
Yue (Felix) Huang (@yuehuang010) you should just use the
editorService. Here's an example here https://github.com/microsoft/vscode/blob/main/src/vs/workbench/contrib/debug/common/debugSource.ts#L76I hope that helps!
15 remaining items
yuehuang010 commentedon Nov 4, 2021
Is this something the C++ extension should handle?
WardenGnaw commentedon Nov 4, 2021
Yes. Disassembly flavor should be set by the debug adapter.
AnthonyLeonardoGracio commentedon Dec 14, 2022
Hello!
I was wondering how hard it would be to get a working Disassembly view for other languages that can be debugged through GDB or LLDB? Basically we would like to get the Disassembly view working for the Ada language, but since the view is only available for C/C++ files, I can't get it work.
Does someone have ideas on how could this work? Also, let me know if this discussion should occur on a separate issue, I can open one if needed!
haneefdm commentedon Dec 14, 2022
The disassembly support is not dependent on the language or even the debugger like gdb/lldb. Your debug adapters (interface between gdb/lldb and VSCode) have to support it and even they do not much care (in many instances) what language is being used.
Not clear what debug adapter (or extension) you are using to debug your ADA program today...and this request would belong to that extension to support the protocols required by the VSCode disassembler (documented in the Debug Adapter Protocol).
If you can debug via gdb/lldb however, then you can even use existing debuggers (
cppdbgfrom cpptools) to debug your executable. For instance, you can debug a program written in Rust because the compiler produces and ELF file that can be debugged via GDB/LLDBWhen you setup your launch.json for
cppdbgjust make sure you are using your elf file if you have one and then you should be able to use it just like C/C++/Rust programmers do.I can say this because I author a debug adapter extension that supports disassembly and any language is fine with us so long as we can debug with GDB.
AnthonyLeonardoGracio commentedon Dec 15, 2022
Thanks for this very detailed answer Haneef Mohammed (@haneefdm)!
Currently we are using the Native Debug extension to debug Ada code, which launches GDB basically. But when using it I don't get the 'Open disassembly view' contextual menu when debugging.
I tried to use
cppdbgdo debug my Ada code, but the menu was not available too, while it was the case when debugging C/C++. It may be a setup issue, I will try again. I just wanted to make sure that there is nothing that prevents me to get this feature when using GDB but for other languages such as Ada, and apparently it's the case from what you say ;)I will try again and keep you posted then!
haneefdm commentedon Dec 15, 2022
Yes, Native Debug will have to support disassembly. We originally forked from that several years ago,
Note that the launch.json contents will be very different for cppdbg. Just follow instructions/examples for cppdbg as if you have a C++ program. cppdbg will not know the difference.
AnthonyLeonardoGracio commentedon Dec 16, 2022
Haneef Mohammed (@haneefdm)
So I have tried to use
cppdgby using a simple launch.json configuration found on the web, and I am able to debug my Ada code properly on simple projects. TheOpen Disassembly Viewcontextual menu is available, I can see the disassembly in theDebug Console, but I get a new view withDisassembly not availableat the end, without knowing exactly why.Any ideas of what could be wrong? I have attached my launch.json contents and a simple screenshot, if that helps.
launch.txt

haneefdm commentedon Dec 16, 2022
Can you get disassembly from gdb command line? If not neither can cpptools. It has to do with how you compiled (did you compile for debug and saving saving/debug info).
You should file an issue with cpptools if gdb works but cpptools isn't giving you disassembly. Just for fun, try a larger program with at least a few thousand instructions.
haneefdm commentedon Dec 16, 2022
You can enable logging to see what commands are being sent to gdb, etc. But first, make sure your gdb is working.
AnthonyLeonardoGracio commentedon Dec 16, 2022
Yes, I can get disassembly from GDB's command line. Note that I am also able to get the Assembly view working in GNAT Studio (an IDE dedicated to Ada), with the same compiled executable (compiled with -g -O0)
Attaching the whole GDB output: as you can see, the
-data-disassembleseems to work fine.gdb_output.txt
AnthonyLeonardoGracio commentedon Jan 2, 2023
Any idea Haneef Mohammed (@haneefdm) ? ;)
haneefdm commentedon Jan 2, 2023
You should approach the cpptools team for help. It appears they are doing the right thing but why you are seeing an empty Disassembly window, I cannot explain.
https://github.com/microsoft/vscode-cpptools
They may direct you to VSCode main repo
AnthonyLeonardoGracio commentedon Jan 4, 2023
Ok I will do that, thanks for your help ;)
thegecko commentedon Nov 9, 2023
Can this scope also include a context menu which can be a contribution point for other extensions?
ref: #171548
xoriath commentedon Feb 9, 2026
Another point that I haven't logged yet, the zoom in the disassembly view zooms the whole UI, instead of just the editor pane like other code panes does...