microsoft / vscode-cpptools

Official repository for the Microsoft C/C++ extension for VS Code.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doesn't hit the breakpoint set in the code editor

zclrsr opened this issue · comments

Environment

  • OS and version: Windows 10 1809
  • VS Code: 1.88.1
  • C/C++ extension: 1.19.9
  • OS and version of remote machine (if applicable):
  • GDB / LLDB version:

Bug Summary and Steps to Reproduce

Bug Summary:
I am trying to debug a C program directly from the source code editor to see the values of local variables.
Initially at first run, everything was working fine but later on after some more runs of the debugger, my breakpoint set at a given line at int main() in the source code wasn't hitting. When hovering over the breakpoint and it showed "no symbols have been loaded for this document". I checked that PDB symbol files are being generated.

I am not sure what went wrong.

Steps to reproduce:

  1. In this environment, I am debugging a debug version of https://github.com/googleprojectzero/winafl
  2. The CMake config used is from the repository itself and debugged an x86 version

Debugger Configurations

{
    "version": "0.2.0"
    "configuration": [
        {
            "name": "(Windows) Launch",
            "type": "cppvsdbg",
            "request": "launch",
            "program": "E:\\winafl\build\\bin\\Debug\\afl-fuzz.exe",
            "stopAtEntry": false,
            "cwd": "E:\\winafl\build\\bin\\Debug"
            "environment": [],
            "console": "externalTerminal",
            "logging": {"engineLogging: true}
        }
    ]
}

Debugger Logs

<- (E) {"seq":3,"type":"event","event":"output","body":{"category":"console","output":"-------------------------------------------------------------------\nYou may only use the C/C++ Extension for Visual Studio Code\nwith Visual Studio Code, Visual Studio or Visual Studio for Mac\nsoftware to help you develop and test your applications.\n-------------------------------------------------------------------\n","severity":"ok"}}
-------------------------------------------------------------------
You may only use the C/C++ Extension for Visual Studio Code
with Visual Studio Code, Visual Studio or Visual Studio for Mac
software to help you develop and test your applications.
-------------------------------------------------------------------
<- (R) {"seq":5,"type":"response","request_seq":2,"success":true,"command":"launch"}
-> (C) {"type":"response","seq":1,"command":"handshake","request_seq":2,"success":true,"body":{"signature":"969tEur6L1kEkcGQifSK39rJqqKGb8HlV2zdCYUcWg2RW4="}}
<- (E) {"seq":8,"type":"event","event":"initialized","body":{}}
-> (C) {"command":"setBreakpoints","arguments":{"source":{"name":"afl-fuzz.c","path":"e:\\winafl\\afl-fuzz.c"},"lines":[8143],"breakpoints":[{"line":8143}],"sourceModified":false},"type":"request","seq":3}
<- (E) {"seq":11,"type":"event","event":"output","body":{"category":"telemetry","output":"vs/diagnostics/debugger/vsdbg/BreakpointAdded","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"17.8.10929.2 commit:f5957dcef136d5225d2eb95e5eca6b39d3785bf9","VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.HasHitCount":false,"VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.17763","VS.Diagnostics.Debugger.vsdbg.AdapterId":"cppvsdbg","VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.BreakpointType":"Source","VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.HasLogMessage":false,"VS.Diagnostics.Debugger.vsdbg.BreakpointAdded.HasCondition":false}}}
<- (R) {"seq":13,"type":"response","request_seq":3,"success":true,"command":"setBreakpoints","body":{"breakpoints":[{"id":1,"verified":false,"message":"The breakpoint is pending and will be resolved when debugging starts.","line":8143}]}}
-> (C) {"command":"setFunctionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":4}
<- (R) {"seq":16,"type":"response","request_seq":4,"success":true,"command":"setFunctionBreakpoints","body":{"breakpoints":[]}}
-> (C) {"command":"setInstructionBreakpoints","arguments":{"breakpoints":[]},"type":"request","seq":5}
<- (R) {"seq":19,"type":"response","request_seq":5,"success":true,"command":"setInstructionBreakpoints","body":{"breakpoints":[]}}
-> (C) {"command":"setExceptionBreakpoints","arguments":{"filters":[],"filterOptions":[]},"type":"request","seq":6}
<- (R) {"seq":22,"type":"response","request_seq":6,"success":true,"command":"setExceptionBreakpoints","body":{}}
-> (C) {"command":"configurationDone","type":"request","seq":7}
-> (C) {"seq":25,"type":"request","command":"runInTerminal","arguments":{"kind":"external","title":"E:\\winafl\\build\\bin\\Debug\\afl-fuzz.exe","cwd":"","args":["c:\\Users\\IEUser\\.vscode\\extensions\\ms-vscode.cpptools-1.19.9-win32-x64\\debugAdapters\\vsdbg\\bin\\VsDebugConsole.exe","\\\\.\\pipe\\Microsoft-VisualStudio-Debug-Console-{EA164268-F5E6-42FD-91C7-DC1DF3BB875A}","Local\\{EA164268-F5E6-42FD-91C7-DC1DF3BB875A}","/AutoExit"]}}
-> (C) {"type":"response","seq":8,"command":"runInTerminal","request_seq":25,"success":true,"body":{}}
<- (E) {"seq":28,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/ProcessCreate","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"17.8.10929.2 commit:f5957dcef136d5225d2eb95e5eca6b39d3785bf9","VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.17763","VS.Diagnostics.Debugger.vsdbg.TargetArchitecture":"X86"}}}
<- (E) {"seq":30,"type":"event","event":"process","body":{"name":"E:\\winafl\\build\\bin\\Debug\\afl-fuzz.exe","systemProcessId":3296,"startMethod":"launch","pointerSize":32}}
<- (E) {"seq":32,"type":"event","event":"breakpoint","body":{"reason":"changed","breakpoint":{"id":1,"verified":false,"message":"No symbols have been loaded for this document.","line":8143}}}
<- (E) {"seq":34,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/Launch","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"17.8.10929.2 commit:f5957dcef136d5225d2eb95e5eca6b39d3785bf9","VS.Diagnostics.Debugger.vsdbg.VisualizerFileUsed":false,"VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.17763","VS.Diagnostics.Debugger.vsdbg.Launch.Duration":1109,"VS.Diagnostics.Debugger.vsdbg.TargetType":"Live","VS.Diagnostics.Debugger.vsdbg.AdapterId":"cppvsdbg","VS.Diagnostics.Debugger.vsdbg.SourceFileMappings":0}}}
<- (R) {"seq":36,"type":"response","request_seq":7,"success":true,"command":"configurationDone"}
<- (E) {"seq":38,"type":"event","event":"progressStart","body":{"progressId":"1","title":"Loading...","cancellable":true,"message":"Loading symbols for afl-fuzz.exe","percentage":0}}
<- (E) {"seq":40,"type":"event","event":"progressUpdate","body":{"progressId":"1","message":"Loading symbols for afl-fuzz.exe from: E:\\winafl\\build\\bin\\Debug","percentage":0}}
-> (C) {"command":"threads","type":"request","seq":9}
<- (R) {"seq":43,"type":"response","request_seq":9,"success":true,"command":"threads","body":{"threads":[]}}
<- (E) {"seq":45,"type":"event","event":"output","body":{"category":"console","output":"Loaded 'E:\\winafl\\build\\bin\\Debug\\afl-fuzz.exe'. Symbols loaded.\n"}}
Loaded 'E:\winafl\build\bin\Debug\afl-fuzz.exe'. Symbols loaded.
<- (E) {"seq":47,"type":"event","event":"module","body":{"reason":"new","module":{"id":1000,"name":"afl-fuzz.exe","path":"E:\\winafl\\build\\bin\\Debug\\afl-fuzz.exe","isUserCode":true,"symbolStatus":"Symbols loaded.","symbolFilePath":"E:\\winafl\\build\\bin\\Debug\\afl-fuzz.pdb"}}}
<- (E) {"seq":49,"type":"event","event":"thread","body":{"reason":"started","threadId":10508}}
------------------snip---------------------------------------------------------------
contains logs for loading windows system32 dlls
------------------snip---------------------------------------------------------------
<- (E) {"seq":296,"type":"event","event":"thread","body":{"reason":"exited","threadId":9624}}
<- (E) {"seq":298,"type":"event","event":"thread","body":{"reason":"exited","threadId":9652}}
<- (E) {"seq":300,"type":"event","event":"output","body":{"category":"console","output":"The program '[3296] afl-fuzz.exe' has exited with code 1 (0x1).\n"}}
The program '[3296] afl-fuzz.exe' has exited with code 1 (0x1).
<- (E) {"seq":302,"type":"event","event":"exited","body":{"exitCode":1}}
<- (E) {"seq":304,"type":"event","event":"terminated","body":{}}
-> (C) {"command":"threads","type":"request","seq":11}
<- (R) {"seq":307,"type":"response","request_seq":11,"success":false,"command":"threads","message":"Error processing 'threads' request. The operation cannot be preformed while the target process is running."}
-> (C) {"command":"disconnect","arguments":{"restart":false,"terminateDebuggee":false},"type":"request","seq":12}
<- (E) {"seq":310,"type":"event","event":"output","body":{"category":"telemetry","output":"VS/Diagnostics/Debugger/vsdbg/DebugCompleted","data":{"VS.Diagnostics.Debugger.vsdbg.OSFamily":"Windows","VS.Diagnostics.Debugger.vsdbg.Version":"17.8.10929.2 commit:f5957dcef136d5225d2eb95e5eca6b39d3785bf9","VS.Diagnostics.Debugger.vsdbg.WindowsVersion":"10.0.17763","VS.Diagnostics.Debugger.vsdbg.DebugCompleted.BreakCounter":0,"VS.Diagnostics.Debugger.vsdbg.AdapterId":"cppvsdbg"}}}
<- (R) {"seq":312,"type":"response","request_seq":12,"success":true,"command":"disconnect"}

Other Extensions

No response

Additional Information

No response