microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.
Other
5.42k stars 1.52k forks source link

Break points don't work when trying to debug an application using vsdbg that was compiled with /clr #3370

Closed Corvax-Fisher closed 3 years ago

Corvax-Fisher commented 5 years ago

Type: Debugger

Describe the bug

As stated in the title, when trying to debug an application that was built with /clr (and /debug of course) using msbuild, break points don't work.
I'm not sure if compiling a project with /clr causes the problem. It's just a wild guess. But I don't know what else it could be at the moment.
launch.json looks as follows:

{
  "version": "0.2.0",
  "configurations": [
    {
    "name": "(Windows) Attach",
    "type": "cppvsdbg",
    "request": "attach",
    "processId": "${command:pickProcess}"
    },
    {
    "name": "(Windows) Launch",
    "type": "cppvsdbg",
    "request": "launch",
    "logging": { "engineLogging": true },
    "program": "${workspaceFolder}/../../../Common/System/DEBUG/App.exe",
    "args": [],
    "stopAtEntry": false,
    "cwd": "${workspaceFolder}",
    "environment": [],
    "externalConsole": true
    }
  ]
}

Additional context The following warning is printed out:

Breakpoint warning: No executable code of the debugger’s target code type is associated with this line.
Possible causes include: conditional compilation, compiler optimizations, or the target architecture of this line is not supported by the current debugger code type.

Later, the following message is printed:

Loaded 'D:\Projects\path\to\folder with spaces\Common\System\DEBUG\App.exe'. Symbols loaded.

After this message, I do not get an engine print outs about break point events.
I'm writing this, because for another library that's included in the project, I get the following prints:

Loaded 'D:\Projects\path\to\folder with spaces\Common\System\DEBUG\Library.dll'. Symbols loaded.
<- (E) {"seq":171,"type":"event","event":"module","body":{"reason":"new","module":{"id":"{16CA6F46-AE80-4937-BA89-03F3CE6663AE}","name":"Library.dll","path":"D:\\Projects\\path\\to\\folder with spaces\\Common\\System\\DEBUG\\Library.dll","isUserCode":true,"version":"6.06.200.0","symbolStatus":"Symbols loaded.","symbolFilePath":"D:\\Projects\\path\\to\\folder with spaces\\Common\\System\\DEBUG\\Library.pdb"}}}
<- (E) {"seq":173,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":true,"source":{"name":"Source1.cpp","path":"d:\\Projects\\path\\to\\folder with spaces\\Build\\Dll\\Library\\Source1.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"0220c00f41829afe2add7d55aac94c92"}]},"line":369,"endLine":369}}}
<- (E) {"seq":175,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":2,"verified":true,"source":{"name":"Source2.cpp","path":"d:\\Projects\\path\\to\\folder with spaces\\Build\\Dll\\Library\\Source2.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"2335691fee4e6ef796ab7f525a584bce"}]},"line":201,"endLine":201}}}
<- (E) {"seq":177,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":3,"verified":true,"source":{"name":"Source3.cpp","path":"d:\\Projects\\path\\to\\folder with spaces\\Build\\Dll\\Library\\Source3.cpp","sourceReference":0,"sources":[],"checksums":[{"algorithm":"MD5","checksum":"2335691fee4e6ef796ab7f525a584bce"}]},"line":221,"endLine":221}}}

Break points inside the source files of the loaded library work.

github-actions[bot] commented 3 years ago

This issue has been closed automatically because it has not had recent activity.

TwinZagreus commented 6 months ago

Has it been solved?