Skip to content

Disassembly View: Milestone 2  #129762

Open
Open

Description

Use this to keep track of work for the next milestone.

Features:

  • Show/Hide source code between instructions.
  • Horizontal Scrolling
  • Enable/Disable/Condition for Instruction Breakpoints Instruction breakpoints can not be disabled #129571
  • Copy Blocks of instruction
  • Show/Hide/Rearrange Columns
  • GoTo Disassembly at a specific address

Bugs from Test Disassembly View #129161

Activity

  1. yuehuang010 commented on Jul 29, 2021

    @yuehuang010
    ContributorAuthor
  2. isidorn commented on Jul 29, 2021

    @isidorn

    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 debug label https://github.com/microsoft/vscode/issues?q=is%3Aopen+is%3Aissue+milestone%3A%22August+2021%22+label%3Adebug

  3. xisui-MSFT commented on Aug 6, 2021

    @xisui-MSFT
    Contributor

    Isidor Nikolic (@isidorn) Can you please help me to investigate how to fix an element from horizontally scrolling in a list? Thanks!

  4. isidorn commented on Aug 6, 2021

    @isidorn

    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.

  5. xisui-MSFT commented on Aug 6, 2021

    @xisui-MSFT
    Contributor

    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!

  6. isidorn commented on Aug 6, 2021

    @isidorn
    1. 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.
    2. 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.
  7. yuehuang010 commented on Aug 17, 2021

    @yuehuang010
    ContributorAuthor

    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.

  8. isidorn commented on Aug 18, 2021

    @isidorn

    Yue (Felix) Huang (@yuehuang010) can you clarify? Do you have an URI and a line number and just want to open an editor for those? In that case just use the editorService.openEditor and pass your uri and lineNumber.

  9. yuehuang010 commented on Aug 18, 2021

    @yuehuang010
    ContributorAuthor

    Isidor Nikolic (@isidorn), here is the view in VS. The source code of cpp has is intereved between disassembly.
    MicrosoftTeams-image (1)

    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.

  10. isidorn commented on Aug 19, 2021

    @isidorn

    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.

  11. yuehuang010 commented on Aug 19, 2021

    @yuehuang010
    ContributorAuthor

    Isidor Nikolic (@isidorn), Is using NativeTextFileService nad TextModel the way to go? Or are there another way to open the file?

  12. isidorn commented on Aug 19, 2021

    @isidorn
  13. 15 remaining items

  14. yuehuang010 commented on Nov 4, 2021

    @yuehuang010
    ContributorAuthor
    * Support for intel syntax in the disassembly (preferred to AT&T syntax).
    

    +1 att is horrible. Workaround is adding set disassembly-flavor intel to .gdbinit.

    Is this something the C++ extension should handle?

  15. WardenGnaw commented on Nov 4, 2021

    @WardenGnaw
    Member
    * Support for intel syntax in the disassembly (preferred to AT&T syntax).
    

    +1 att is horrible. Workaround is adding set disassembly-flavor intel to .gdbinit.

    Is this something the C++ extension should handle?

    Yes. Disassembly flavor should be set by the debug adapter.

  16. AnthonyLeonardoGracio commented on Dec 14, 2022

    @AnthonyLeonardoGracio

    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!

  17. haneefdm commented on Dec 14, 2022

    @haneefdm
    Contributor

    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.

  18. AnthonyLeonardoGracio commented on Dec 15, 2022

    @AnthonyLeonardoGracio

    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 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 ;)

    I will try again and keep you posted then!

  19. haneefdm commented on Dec 15, 2022

    @haneefdm
    Contributor

    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.

  20. AnthonyLeonardoGracio commented on Dec 16, 2022

    @AnthonyLeonardoGracio

    Haneef Mohammed (@haneefdm)

    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.

    launch.txt
    Capture d’écran 2022-12-16 à 12 31 39

  21. haneefdm commented on Dec 16, 2022

    @haneefdm
    Contributor

    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.

  22. haneefdm commented on Dec 16, 2022

    @haneefdm
    Contributor

    You can enable logging to see what commands are being sent to gdb, etc. But first, make sure your gdb is working.

  23. AnthonyLeonardoGracio commented on Dec 16, 2022

    @AnthonyLeonardoGracio

    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.

    gdb_output.txt

  24. AnthonyLeonardoGracio commented on Jan 2, 2023

    @AnthonyLeonardoGracio
  25. haneefdm commented on Jan 2, 2023

    @haneefdm
    Contributor

    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

  26. AnthonyLeonardoGracio commented on Jan 4, 2023

    @AnthonyLeonardoGracio

    Ok I will do that, thanks for your help ;)

  27. thegecko commented on Nov 9, 2023

    @thegecko
    Contributor

    Can this scope also include a context menu which can be a contribution point for other extensions?

    ref: #171548

  28. xoriath commented on Feb 9, 2026

    @xoriath

    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...

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

Metadata

Metadata

Assignees

Labels

debugDebug viewlet, configurations, breakpoints, adapter issuesdebug-disassemblyfeature-requestRequest for new features or functionality

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions