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

Disassembly view is blank on linux #7960

Closed
abrahammurciano opened this issue Aug 11, 2021 · 9 comments
Closed

Disassembly view is blank on linux #7960

abrahammurciano opened this issue Aug 11, 2021 · 9 comments
Assignees
Labels
debugger fixed Check the Milestone for the release in which the fix is or will be available.
Projects
Milestone

Comments

@abrahammurciano
Copy link

Bug type: Debugger

Describe the bug

  • OS and Version: Arch Linux 5.13.9-arch1-1
  • VS Code Version: 1.59.0
  • C/C++ Extension Version: 1.5.1
  • Desassembly view is blank for C or C++ on linux.

To Reproduce

launch.json

{
	"version": "0.2.0",
	"configurations": [
		{
			"name": "gcc - Build and debug active file",
			"type": "cppdbg",
			"request": "launch",
			"program": "${fileDirname}/${fileBasenameNoExtension}",
			"args": [],
			"stopAtEntry": false,
			"cwd": "${fileDirname}",
			"environment": [],
			"externalConsole": false,
			"MIMode": "gdb",
			"setupCommands": [
				{
					"description": "Enable pretty-printing for gdb",
					"text": "-enable-pretty-printing",
					"ignoreFailures": true
				}
			],
			"preLaunchTask": "C/C++: gcc build active file",
			"miDebuggerPath": "/usr/bin/gdb"
		}
	]
}

tasks.json

{
    "tasks": [
        {
            "type": "cppbuild",
            "label": "C/C++: gcc build active file",
            "command": "/usr/bin/gcc",
            "args": [
                "-g",
                "${file}",
                "-o",
                "${fileDirname}/${fileBasenameNoExtension}"
            ],
            "options": {
                "cwd": "${fileDirname}"
            },
            "problemMatcher": [
                "$gcc"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "detail": "Task generated by Debugger."
        }
    ],
    "version": "2.0.0"
}

My c code

#include <stdio.h>

int main() {
	int counter = 1;
	while (counter <= 5) {
		printf("%d\n", counter);
		++counter;
	}
	return 0;
}

Steps to reproduce the behavior:

  1. Open any C or C++ file.
  2. Add a breakpoint.
  3. Start the debugger.
  4. Right click anywhere in the code and click Open Disassembly View.
  5. An empty tab opens up instead of displaying the assembly code. (see screenshot)

image

@DenverCoder1
Copy link

Having the same issue. My configuration is similar (Arch Linux 5.13.8-arch1-1, VS Code 1.59.0)

It should be working in 1.59.0 according to this blog post.

Gif reproduction, disassembly tab does not show any output:

Peek 2021-08-11 20-02

@WardenGnaw WardenGnaw added the fixed Check the Milestone for the release in which the fix is or will be available. label Aug 12, 2021
@Colengms Colengms added this to Triage in 1.6.0 via automation Aug 12, 2021
@Colengms Colengms moved this from Triage to Done in 1.6.0 Aug 12, 2021
@Colengms Colengms added this to the 1.6.0 milestone Aug 12, 2021
@Colengms
Copy link
Collaborator

This should be addressed in 1.6.0-insiders.

@freyjadomville
Copy link

Can this issue be reopened? I seem to be running 1.6.0 and I am still experiencing this issue. System details in the about dialog of the screenshot.

image

@freyjadomville
Copy link

Please let me know if I'm missing an executable that the extension relies on for disassembly.

@freyjadomville
Copy link

Wait, don't mind me, it seems... tempremental.

@freyjadomville
Copy link

I can get the disassembly when there's library code, but it seems to not want to show anything in user-facing code, on Linux. Is that a new issue?

@freyjadomville
Copy link

Ah, never mind, seems to be a mistake on my part as a result of optimisations. removing -O2 from my project gets the debuginfo to be found again, even if the -g flag is emitted. Is that expected?

@yuehuang010
Copy link
Collaborator

It uses the stackframe to locate the current address. Without debug information, perhaps, it couldn't resolve the stackframe.
Do you have "-fno-omit-frame-pointer" or similar flag? This optimization, implied from -O1, will decrease the chance of debugger from locating stackframe.

@freyjadomville
Copy link

ahhh, OK, good to know, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
debugger fixed Check the Milestone for the release in which the fix is or will be available.
Projects
No open projects
1.6.0
Done
Development

No branches or pull requests

6 participants