microsoft / microsoft/vscode-cpptools

Allow user to specify file location when prompted "Error: Unable to resolve non-existing file"

Aperta
#5,361 11 commenti 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Type: Debugger

Describe the bug

  • OS and Version: Windows 10
  • VS Code Version: 1.43.2
  • C/C++ Extension Version: 0.27.0

I am using VS Code to debug a C++ compiled .exe. I can configure a launch.json that successfully launches my .exe. However when I attempt to step into a function I get the following error:

`Unable to open 'thing.cpp'. Unable to read file 'c:\foo\bar\baz'. (Error: Unable to resolve non-existing file 'c:\foo\bar\baz'.

This makes sense. The file does not exist at 'c:\foo\bar\baz' because it was produced by a caching build system. However the file does exist on my hard drive in another location.

In Visual Studio I get a similar prompt. Except Visual Studio lets me specify the file location. This lets me successfully step-into and debug my code. Unfortunately VS Code does not give me this option. The file exists in my VS Code workspace which makes it particularly frustrating.

My feature request: when debugging fails to read the file allow the user to specify the file's location. If a file with the correct filename and similar path offer to open that file automatically.

To Reproduce
Here is a guess at some minimum work.

Clone a C++ repo onto one machine in a location of your choice. Copy the .exe to a different machine that has cloned the same repo into a different location. Configure launch.json to launch your exe. Try to step into some code. It should fail with an error that the file doesn't exist at a specific location. Even though the file does exist on your machine and, ideally, VS Code workspace.

Additional context
In my particular use case I have an .exe and many DLLs. We use a caching build system (Buck) so the DLLs were compiled on a build machine with completely different folder structure. Even though the code used to compile that DLL exists on my machine.

Creating a minimum-repro project for this would take a little work. If that would be useful I can do it. But I think the problem/missing feature here is pretty obvious so I'm not sure it would be worth the effort.

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 prompt relativo alla sorgente mancante da launch.json mentre esegui il passo nel codice compilato in un percorso diverso. Esamina la gestione da parte del debugger dei file sorgente non risolti e della posizione dell'area di lavoro; non sono indicati file di implementazione o test. Il lavoro è completato quando un utente può scegliere la posizione locale del sorgente e continuare a eseguirne il passo.

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

Valutazione

Stack tecnologico
cpp, typescript
Ambito
devtools
Tipo di issue
Funzionalità
Difficoltà
4/5
Tempo stimato
3-5 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.