Vscode-cpptools: Files with the same name in different paths have the same breakpoint set in both

Created on 5 May 2017  路  12Comments  路  Source: microsoft/vscode-cpptools

Steps to Reproduce:

Attach to a running process (gdb backend).
Set break point by left click on the beginning of a code line.
Another file with the same file name may be affected by this action and it seems that the break point I just set was also applied to this file.

Feature Request bug debugger

Most helpful comment

Why is this marked as a feature request? Isn't this a bug? Having the debugger breaking in the wrong file is a bug.

All 12 comments

@harwise is this local or remote attach? also can you provide a example project?

@harwise thanks. I'm investigating.

I have the same issue with vscode. And I found Visual Studio 2017 Linux extension has exactly the same issue.

@harwise We send only the file name to gdb and it binds the breakpoint based on it. If you enable "logging": { "engineLogging": true } you will see our -set-breakpoint commands sending filename:line to gdb which is probably why this is happening. I will mark this as a feature request to see if we can fix it.

@super-kevin They both have a similar issue because they use a shared component, MIEngine as the translation to gdb's MI interfaces.

We just got bitten by this issue. Would you accept a pull request that sends the full path? Do you need the old behavior preserved (e.g. with a configuration flag)?

Will this be fixed any time soon? If not, could someone explain how I can fix this problem myself? I assume this can be fixed by adding the path to the file name that is sent to the MIEngine, but I'm having trouble finding where in the code this is done exactly.

I appreciate any help you can offer!

Why is this marked as a feature request? Isn't this a bug? Having the debugger breaking in the wrong file is a bug.

@pieandcakes Wasn't this a VS Code bug that couldn't be fixed by us? https://github.com/Microsoft/vscode/issues/12448

I'm hitting this in our work repo (Redhat 7, gcc) where we have a lot of folders / libraries that occasionally have the same filename. It makes for a pretty broken / unusable debugging experience when breakpoints you set in one file trigger on the same line in a completely different file.

The only work-around I've found is to delete the debug symbols of the files you don't want to debug :(

I'm also running into this problem. One of the very few reasons why I can't switch to VS Code :(

@pieandcakes

The reason this happens is because only the file name, not its file path is provided when setting the breakpoint.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jheinzel picture jheinzel  路  3Comments

SkyRiderMike picture SkyRiderMike  路  3Comments

vicatcu picture vicatcu  路  3Comments

montery8 picture montery8  路  3Comments

arl picture arl  路  3Comments