microsoft / microsoft/vscode-cpptools

[Linux] Cannot Pass Environment Variable To Debug Session

Aperta
#3,189 5 commenti 1 reazione 1 assegnatario Vedi su GitHub

@WardenGnaw ci sta già lavorando.

Dal 20/2/2019.

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

Descrizione

Describe the bug

  • OS and Version: Linux
  • VS Code Version: 1.31.0
  • C/C++ Extension Version: 0.22.0
  • Other extensions you installed (and if the issue persists after disabling them): None
  • A clear and concise description of what the bug is.

I am attempting to debug an application that has to link to some custom DLL's.

The application needs the proper path set in the LD_LIBRARY_PATH environment variable.

When I launch the application in debug mode, I receive the following output.

&"warning: GDB: Failed to set controlling terminal: Operation not permitted\n"
/home/myuser/git/myworkspace/bin/debug/Linux/3.10.0/x86_64/myprogram: error while loading shared libraries: mySharedLib.so: cannot open shared object file: No such file or directory

The problem is simple, I just need to get the debug session to have the proper environment variable setup prior to launching my application.

In my launch.json file, I have external console set to FALSE. When I echo the LD_LIBRARY_PATH variable from this terminal it has the correct path. If I launch my program from here (non debug mode) it works fine.

I have tried the following settings in launch.json...

"args": ["${env:LD_LIBRARY_PATH}"],

"environment": [ { "name": "LD_LIBRARY_PATH", "value": "/mypath/to/lib/" } ]

"setupCommands": 
[{ 
     "description": "Additional libs",
     "text": "set env LD_LIBRARY_PATH =/mypath/to/lib/",
}],

"additionalSOLibSearchPath" : "/mypath/to/lib/"

But I continue to receive the same error where it cannot find my libs. This seems like something trivial and should work. Anyone else with this issue?

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.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.