Vscode-cpptools: Debugger not hitting breakpoints in 1.1.0-insiders3

Created on 23 Oct 2020  路  6Comments  路  Source: microsoft/vscode-cpptools

After the recent update to cpptools v1.1.0-insiders3, I am no longer able to hit breakpoints. I can still "pause" the debugger and then step/print expressions etc. It is just breakpoints that no longer work. If I revert to cpptools v1.0.1, then breakpoints work again. I also recall that they worked with insiders2.

I'm on Debian 10.

VSCode Version: 1.50.1
C++ Extension Version: 1.1.0-insiders3

Here is my launch.json

        {
            "name": "Launch src/cgir_support dom_core_analysis_livenessAnalysis_pkgtest",
            "type": "cppdbg",
            "MIMode": "gdb",
            "miDebuggerPath": "sbgdb",
            "request": "launch",
            "program": "/local-ssd/ryanholt/test/matlab/derived/glnxa64/testbin/src/cgir_support/dom_core_analysis_livenessAnalysis_pkgtest",
            "cwd": "/local-ssd/ryanholt/test/matlab/src/cgir_support",
            "args": [
                "--gtest_filter=${input:testName}"
            ],
            "logging": {
                "moduleLoad": false,
                "engineLogging": true
            },
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Add file path directory",
                    "text": "directory /local-ssd/ryanholt/test",
                    "ignoreFailures": true
                }
            ],
            "sourceFileMap": {
                "/local-ssd/ryanholt/Bcgir_task_build.latest_pass": "/local-ssd/ryanholt/test",
                "/local-ssd/ryanholt/.Bcgir_task_build.latest_pass.sbsyncmaster": "/local-ssd/ryanholt/test",
                "/local-ssd/ryanholt/.Bcgir_task_build.latest_pass.sbsyncmaster.inprogress": "/local-ssd/ryanholt/test"
            },
            "presentation": {
                "group": "src/cgir_support_tasks",
                "hidden": false
            }
        },

Here is the output from enabling "engineLogging":

engineLogging.txt

bug debugger

Most helpful comment

I think I found the bug.

It is due to having multiple editorPath's (<target-paths>) being the same and it will only use the first one to bind the breakpoint with. Source

It is running

<--   C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"tGenAndKill.cpp","path":"/local-ssd/ryanholt/test/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp"},"lines":[5],"breakpoints":[{"line":5}],"sourceModified":false},"type":"request","seq":4}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6613) <-1013-break-insert -f /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5\n"},"seq":504}
1: (6613) <-1013-break-insert -f /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6649) ->&\"No source file named /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp.\\n\"\n"},"seq":506}
1: (6649) ->&"No source file named /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp.\n"

I believe you can workaround this in -insiders3 by not using the sourceFileMaps for breakpoints.
You can do this by changing it to:

"sourceFileMap": {
                "/local-ssd/ryanholt/Bcgir_task_build.latest_pass": { 
                   "editorPath": "/local-ssd/ryanholt/test", 
                   "useForBreakpoints": false
                },
                "/local-ssd/ryanholt/.Bcgir_task_build.latest_pass.sbsyncmaster": { 
                   "editorPath": "/local-ssd/ryanholt/test", 
                   "useForBreakpoints": false
                },
                "/local-ssd/ryanholt/.Bcgir_task_build.latest_pass.sbsyncmaster.inprogress": { 
                   "editorPath": "/local-ssd/ryanholt/test", 
                   "useForBreakpoints": false
                }
            },

Let me know if that works and I'll find a way to handle this scenario.

Thank you for reporting this bug!

All 6 comments

We have done a change to upgrade sourceFileMappings and how it binds breakpoints from -insiders2 to -insiders3, this change may have caused an issue.

Looks like the second breakpoint failed to bind.

1: (3894) ->1013^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="<PENDING>",pending="/local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5",times="0",original-location="/local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5"}
1: (3895) ->(gdb)
1: (3895) 1013: elapsed time 32
1: (3901) Send Event AD7BreakpointErrorEvent

Can you also provide logs with:

"logging": {
   "traceResponse": true
}

Thank you.

@WardenGnaw: I have attached withTraceResponseAsWell.txt

Let me know if I can provide any more info. Thanks!

I think I found the bug.

It is due to having multiple editorPath's (<target-paths>) being the same and it will only use the first one to bind the breakpoint with. Source

It is running

<--   C (setBreakpoints-4): {"command":"setBreakpoints","arguments":{"source":{"name":"tGenAndKill.cpp","path":"/local-ssd/ryanholt/test/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp"},"lines":[5],"breakpoints":[{"line":5}],"sourceModified":false},"type":"request","seq":4}
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6613) <-1013-break-insert -f /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5\n"},"seq":504}
1: (6613) <-1013-break-insert -f /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp:5
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (6649) ->&\"No source file named /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp.\\n\"\n"},"seq":506}
1: (6649) ->&"No source file named /local-ssd/ryanholt/Bcgir_task_build.latest_pass/matlab/src/cgir_support/dom_core/analysis/livenessAnalysis/pkgtest/tGenAndKill.cpp.\n"

I believe you can workaround this in -insiders3 by not using the sourceFileMaps for breakpoints.
You can do this by changing it to:

"sourceFileMap": {
                "/local-ssd/ryanholt/Bcgir_task_build.latest_pass": { 
                   "editorPath": "/local-ssd/ryanholt/test", 
                   "useForBreakpoints": false
                },
                "/local-ssd/ryanholt/.Bcgir_task_build.latest_pass.sbsyncmaster": { 
                   "editorPath": "/local-ssd/ryanholt/test", 
                   "useForBreakpoints": false
                },
                "/local-ssd/ryanholt/.Bcgir_task_build.latest_pass.sbsyncmaster.inprogress": { 
                   "editorPath": "/local-ssd/ryanholt/test", 
                   "useForBreakpoints": false
                }
            },

Let me know if that works and I'll find a way to handle this scenario.

Thank you for reporting this bug!

@WardenGnaw: That worked! Thanks!

I ran into the same problem on v1.1.1 and vscode 1.51.1. Bug got into the latest release?

@hansaya It hasn't been fixed.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SkyRiderMike picture SkyRiderMike  路  3Comments

montery8 picture montery8  路  3Comments

peterwoods1 picture peterwoods1  路  3Comments

chrisckc picture chrisckc  路  3Comments

jyavenard picture jyavenard  路  3Comments