dseight / vscode-disasexpl

Disassembly Explorer for VS Code
MIT License
48 stars 11 forks source link

Assembly appears and then disappears in pane #6

Closed daveharmon closed 4 years ago

daveharmon commented 5 years ago

Using gcc 8.2, and vscode 1.30.2. I can compile my assembly and it appears to save the file at some intermediate step which causes the assembly view pane to appear with correct highlighting. Eventually the compilation completes and the assembly view completely disappears and it dims all code as unused. The options I'm using are: g++ -g -o file.S -masm=intel -S -fdiagnostics-color=always -O2 -std=c++17 file.cc Have you ever seen something like this before? Do I need to add some option or change the ordering somehow?

dseight commented 5 years ago

I haven't seen this before. Am I right that you can view disassembly only when compiling is in progress?

daveharmon commented 5 years ago

Yes, that’s correct. Sorry I was having trouble describing what I was seeing for a while. I tried adding -save-temps (which I didn’t expect to work but wondered if there was some intermediate compiler run that was emitting the desired information) but nothing different happened. On Jan 23, 2019, 4:32 PM -0500, Dmitry Gerasimov notifications@github.com, wrote:

I haven't seen this before. Am I right that you can view disassembly only when compiling is in progress? — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

dseight commented 5 years ago

Yes, I confirm that this is a bug. Steps to reproduce: 1) show disassembly (there is no difference if .S file already exists or not); 2) rebuild disassembly with g++ -g -o test.S -S test.cc; 3) disassembly disappears in view.

I'll look at this a bit later. Probably something is wrong with hot reloading in provider.ts.

likewise commented 4 years ago

I have the same issue, but than with the objdump approach; Each time I regenerate the .S file, the assembly view toggles between showing everything or only one empty line.

I have an app.c open that after cross-compilation, I cross-objdump as follows from a vscode terminal:

objdump -d ../build/app -l > /tmp/app.S
mv /tmp/app.S app.S

(I tried the "mv" approach to atomically change the file, but the bug remains.) My settings.json contains this:

    "disasexpl.associations": {
        "**/*.c": "${fileDirname}/${fileBasenameNoExtension}.S",
        "**/*.cpp": "${fileDirname}/${fileBasenameNoExtension}.S"
    },
    "disasexpl.useBinaryParsing": true

The bug is annoying, but your extension is super productive for me! So thank you very kindly for this extension. It helps me quickly understand performance hotspots in my time-sensitive code.

dseight commented 4 years ago

Fixed with e8d5a1552f09f06554e2d8294fe20e42f7af148a and 53f6955a7d8f9bf7d9a7ae2c6afcaa502198aab9 in 0.2.0 release.