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

[Feature Request] Implement Assembly View/Disassembly View for Debugger #206

Closed
ghost opened this issue Sep 7, 2016 · 54 comments
Closed
Assignees
Labels
debugger Feature Request fixed Check the Milestone for the release in which the fix is or will be available.

Comments

@ghost
Copy link

ghost commented Sep 7, 2016

Being able to view assembly and step through assembly instructions would be useful. Especially when debug information isn't available for a certain library. Right now it just displays a message saying unknown source, when it goes into one of these functions. Being able to view values of registers in the GUI some way. Not entirely sure how that would work with VSCode, but being able to the registers all the time and able to modify them such other assembly debuggers.

@agauniyal
Copy link

agauniyal commented Sep 8, 2016

@marktrz if you're on Linux, nemiver does it all and is quite a performer. I'm using it as an alternative to vs debugger on linux and so far it performs well. Now only if vscode could implement its features 🎐

@jacdavis
Copy link

jacdavis commented Sep 8, 2016

Thanks for the feedback. You can view disassembly in vscode using the -exec disassembly command in the debug console. Registers can be viewed the same way (-exec info registers).

@Izikiel
Copy link

Izikiel commented Oct 12, 2016

I have code in C which calls code in ASM and it would be very useful to debug the ASM code within vs code without calling specific gdb commands which only show part of the source.

@hth313
Copy link

hth313 commented Mar 2, 2017

A register display would be very useful in situations like this, having it update as you step around.

@Izikiel
Copy link

Izikiel commented Mar 2, 2017

If I'm not mistaken, since it's been a couple of years since I used it, the sublime gdb plugin for sublime text 2 supported asm debugging, showing registers and everything (https://github.com/quarnster/SublimeGDB). Probably there is a way for it to be done on vs code

@yh-sb
Copy link

yh-sb commented May 24, 2017

So, could you please add a disassembler viewer in dubug view. It will be so helpful for C/C++ developers.
It should not take long time to implement this.

Below placed examples how this view looks like:

disassembler_1

disassembler_2

@kgfly
Copy link

kgfly commented Jun 13, 2018

Please add

ASM window
Memory window
Register window

@doingnz
Copy link

doingnz commented Aug 31, 2018

I have just spent days looking for alternatives to VSCode because I would like to have assembler, memory and register windows. Reworking a large open source project based on VSCode/CMmake to a new tool is considerable effort. There are many people asking for a memory view for a long time. Please do consider adding such a window. Memory view can execute the GDB x command after each step / trace as it is so last decade to enter that command repeatedly (or up arrow enter). Ideally the window would also highlight values that have changed.

@sean-mcmanus
Copy link
Collaborator

@doingnz You could try using Visual Studio 2017 -- they have some remote to Linux ability: https://blogs.msdn.microsoft.com/vcblog/2016/03/30/visual-c-for-linux-development/ .

@ci70
Copy link

ci70 commented Nov 24, 2018

Please add

ASM window
Memory window
Register window

@tehKaiN
Copy link

tehKaiN commented Nov 24, 2018

This is probably related to #941

@ci70
Copy link

ci70 commented Dec 9, 2018

Has this been implemented yet???

@nicolo-ribaudo
Copy link

No, but I think that they would happily accept a PR.

@ci70
Copy link

ci70 commented Dec 9, 2018

Oh I am sure they would. PlatformIO has implemented this a long time ago.
What's the hold up?

@ci70
Copy link

ci70 commented Dec 13, 2018

What's the hold up? Nothing about it in new insider build. @sean-mcmanus

@tehKaiN
Copy link

tehKaiN commented Dec 13, 2018

@optomux

Not that I think that this feature is not needed, but I guess that's not top priority here. Just wait patiently or do it yourself. You can always copy appropriate code from PlatformIO to this extension and submit a pull request.

@ci70
Copy link

ci70 commented Dec 13, 2018

I wish someone made an extension for it. Would PlatformIO work with this?

@sean-mcmanus
Copy link
Collaborator

@optomux I don't work on the debugger stuff at all. The other debugger people spend most of their time working on the Visual Studio debugger (a paid product, although there are some free versions with restricted licenses). Implementing an assembler view or other advanced debugging features isn't a priority for the debugger team and not on their schedule to implement.

@Izikiel
Copy link

Izikiel commented Dec 14, 2018

@sean-mcmanus Hi!
If you could give a few pointers of example code to have an idea of how vs code interacts with gdb, sends commands, and sets the UI, I would be willing to try to implement this.

@sean-mcmanus
Copy link
Collaborator

@Izikiel Ask @WardenGnaw (or @pieandcakes when he gets back from vacation in January). I don't know much about how the debugger works since I just work on the language service stuff. I think most of it is open source. Another repo that may be relevant is https://github.com/Microsoft/MIEngine .

@mirao
Copy link

mirao commented May 12, 2019

I tried debugging in VSCode extension PlatformIO on my embedded device. Nice, it's possible to switch fluently between debugging of C source and disassembly view.
It would be great to have such possibility with desktop apps as well.

@gerekon
Copy link

gerekon commented Oct 10, 2019

Please add

ASM window
Memory window
Register window

@pieandcakes pieandcakes changed the title Implement Assembly View for Debugger [Feature Request] Implement Assembly View/Disassembly View for Debugger Oct 28, 2019
@pkeir
Copy link

pkeir commented Feb 4, 2020

@jacdavis How does "-exec disassembly" work? While debugging, I type "-exec disassembly" + RETURN in the DEBUG CONSOLE window, but receive only "identifier "exec" is undefined".

@bobbrow bobbrow added this to the 1.5.0 milestone Apr 1, 2021
@Al-aqua
Copy link

Al-aqua commented Apr 9, 2021

it will be cool

@nextarg
Copy link

nextarg commented Apr 16, 2021

I am trying to execute the instruction steps using vscode-cpptools + cppvsdbg, however, I have a wonder about it.
If the address has no source information, are there any limitations?

For example, when I do a stepinto an address with no source information, it seems that a temporary step is being executed.
(ex: call @ILT+X when using incremental link).

Does anyone know anything about this behavior?

Below is a comparison with VS.

VS

vs

RIP : 00000001400BDF3D
=>  00000001400BDF3D E8 E1 75 FE FF       call        func (01400A5523h) 
    00000001400BDF42 33 C0                xor         eax,eax 
RIP : 00000001400A5523
=>  00000001400A5523 E9 38 76 01 00       jmp         func (01400BCB60h)
RIP : 00000001400BCB60
=>  00000001400BCB60 40 55                push        rbp 

VS Code

vscode

RIP : 00000001400BDF3D
=> 0x00000001400BDF3D	E8 E1 75 FE FF	call func (01400A5523h)
   0x00000001400BDF42	33 C0		xor eax,eax
RIP : 00000001400BDF42
   0x00000001400BDF3D	E8 E1 75 FE FF	call func (01400A5523h)
=> 0x00000001400BDF42	33 C0		xor eax,eax
RIP : 00000001400BCB60
=> 0x00000001400BCB60	40 55		push rbp

@bobbrow bobbrow assigned yuehuang010 and unassigned yuehuang010 Apr 16, 2021
@mirao
Copy link

mirao commented May 7, 2021

I'm playing with Rust and CodeLLDB in VSCode. Just FYI a screenshot from dissasembly view where you can "end up" during debugging of Rust code. Hope it's not so off-topic
image

@Trass3r
Copy link

Trass3r commented May 8, 2021

Official support is on the roadmap:
https://github.com/microsoft/vscode/wiki/Roadmap#debug

@bobbrow
Copy link
Member

bobbrow commented May 25, 2021

For those following along, we are now tracking implementing this support directly in VS Code. You can subscribe to this issue for updates: microsoft/vscode#124163

@bobbrow
Copy link
Member

bobbrow commented Jul 27, 2021

The first iteration of this feature is now available in VS Code Insiders. Give it a try and let us know what you think.
microsoft/vscode#124163 (comment)

@bobbrow bobbrow added the fixed Check the Milestone for the release in which the fix is or will be available. label Jul 27, 2021
@Trass3r
Copy link

Trass3r commented Jul 27, 2021

👍🏽

Note that you'll need the step granularity feature from MIEngine main which has not been released yet.
The stepping performance will need some improvement, esp. when registers are expanded.
As will the link between original source and disassembly. I usually pull the disassembly view to the right manually to see both and they both update but when you step into another source file you won't see the code anymore.
Eventually a mixed view like in VS and objdump is desirable.

@sean-mcmanus sean-mcmanus modified the milestones: 1.6.0, 1.6.0-insiders Jul 28, 2021
@Colengms
Copy link
Collaborator

This should be addressed in 1.6.0-insiders.

@Trass3r
Copy link

Trass3r commented Aug 19, 2021

Yeah indeed it works with the insider version. Even the performance is a bit better.
Oddly though vscode sends a disassemble request even before you open the disassembly view, quite wasteful.

One missing feature is syntax highlighting. There are wonderful extensions for this like ASM Code Lens but since this view is not a normal editor there's no chance of them ever working. (It's also a bit weird in general that you can't select the code.)

Btw Intel syntax can be set via ~/.gdbinit with set disassembly-flavor intel.

@ShlomiRex
Copy link

This should be addressed in 1.6.0-insiders.

Hi, I downloaded insiders 1.6.0 , I'm on mac.
How can I enable or use this feature?
I really like the memory view in Visual Studio Community 2019.
I hoope this feature can reach VS code.

@Trass3r
Copy link

Trass3r commented Aug 30, 2021

It's in the editor context menu during debugging.

@Trass3r
Copy link

Trass3r commented Oct 15, 2021

One missing feature is syntax highlighting. There are wonderful extensions for this like ASM Code Lens but since this view is not a normal editor there's no chance of them ever working. (It's also a bit weird in general that you can't select the code.)

microsoft/vscode#131210
microsoft/vscode#129762

@How-invin
Copy link

it seems that disassembly doesn't work on the gdb which is customized like for mips. .

@MatAtBread
Copy link

Also no disassembly on esp32-C3 under esf-idf. Memory, code and registers are all visible within gdbgui. I'm running insiders 1.6.4.

Is there something I need to enable or select to see these viewers (no context menu item, unless I'm being really dumb)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger Feature Request fixed Check the Milestone for the release in which the fix is or will be available.
Projects
None yet
Development

No branches or pull requests