microsoft / microsoft/vscode-cpptools

Breakpoints with multiple sourceFileMap mapping only works for the first mapping, not the second one

Aperta
#8,181 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

debugger more info needed
Lingua principale
TypeScript
Stelle
6.2k
Fork
1.7k
Merge medio
14h 46m
PR unite (30g)
61

Descrizione

Bug type: Debugger

Describe the bug

  • OS and Version: Linux Ubunut 18.04
  • VS Code Version: 1.60.2
  • C/C++ Extension Version: v1.6.0
  • Other extensions you installed (and if the issue persists after disabling them): bazel , yes
  • A clear and concise description of what the bug is.

I am on a bazel build for a project with multiple workspaces

Therefore I need multiple entries in the sourceFileMap.

The problem is, all breakpoints in sources from the second source file mapping are disabled.
I can step through the code, and the corresponding code is opened in the editor,
but all breakpoints that are not in files from the first source file mapping become disabled/

To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:

Set a breakpoint in a file from the second mapping, it is ignored

Set a breakpoint in a file from the first mapping, it works

Remove the first mapping, files will not be found, but the breakpoint from the - now first but previously second - breakpoint work

    "version": "0.2.0",
    "configurations": [
        {
            "name": "some_bin",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/current_workspace/.bazel/what/ever/some_bin"
            "args": [],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ],
            "sourceFileMap": {
                // parent bazel workspace == ${workspaceFolder}
                "/proc/self/cwd/external/" : "/home/me/project/",            
               "/proc/self/cwd/" : "/home/me/project/current_workspace/" ,
            }
        }

Interestingly, when I set stopAtEntry to true, the main function is stopped, (a file from the second mapping) but all breakpoints int this file are grey out

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia riproducendo il problema con la configurazione launch.json fornita e le sue due voci sourceFileMap nel debugger C++. Verifica il comportamento dei breakpoint per i file di ogni mappatura, anche con stopAtEntry abilitato. Il lavoro è completato quando i breakpoint nei file della seconda mappatura rimangono abilitati e vengono raggiunti come quelli della prima mappatura.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
cpp
Ambito
devtools
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.