microsoft / microsoft/vscode-cpptools

[vscode-gdb-debug] gdb stuck at launch - any command gives "Unable to perform this action because the process is running"

Aperta
#13,667 10 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

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

Descrizione

Environment
  • OS and version: Alma Linux 8
  • VS Code: 1.99.3
  • C/C++ extension: 1.25.3
  • C/C++ extension pack: 1.3.1
  • GDB version: 14.2
Bug Summary and Steps to Reproduce

Bug Summary:

I'm using VS Code for C++ for around 6 months. But so far, I have not tried gdb from vs code. Ealier in emacs, I used to debug using gud-gdb interface. So, I tried defining a launch.json for my application. However, I have not been able to successfully setup gdb with vs code.

We have a large C++ code base. I just want gdb to get launched and load the binary (not start the run). This is because, I have a gdb python script that I use to setup PATH and LD_LIBRARY_PATH depending upon MYPROG_HOME env variables and I want to use that. Also I need to set args (differently with different switches depending upon my test case) before running the program.

I have tried following launch.json -

{
    "version": "0.2.0",
    "configurations": [

        {
            "name": "GDB Debug Manual Mode",
            "type": "cppdbg",
            "request": "launch",
            // "program": "${BUILD_PATH}/bin-linux64/myprog-G",
            "program": <full-path to myprog-G>,
            "cwd": "<test dir where I want to debug>",
            "MIMode": "gdb",
            "miDebuggerPath": "<path to gdb>",
            "stopAtEntry": true,
            "stopAtConnect": true,
            "launchCompleteCommand": "None",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
            ]
        }

    ]
}

But when I invoke gdb from the Run and Debug option, gdb prompt comes up. But when I try any gdb commands (like show env MYPROG_HOME), it gives me below error message: -

Unable to perform this action because the process is running.

Please let me know what I may be missing because of which it is not working. Let me know if I can any additional diagnostics to understand why it is stuck.

Debugger Configurations
Please refer the bug summary section above.
Debugger Logs
I tried enabling logging and when the gdb prompt comes, if I type "show env PATH", I get following o/p -


show env PATH
<--   C (evaluate-25): {"command":"evaluate","arguments":{"expression":"show env PATH","context":"repl"},"type":"request","seq":25}
--> R (evaluate-25): {"type":"response","request_seq":25,"success":false,"command":"evaluate","message":"Failed to handle EvaluateRequest","body":{"error":{"id":1105,"format":"Unable to perform this action because the process is running."}},"seq":215}
Unable to perform this action because the process is running.
Other Extensions

No response

Additional Information

No response

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 con la configurazione launch.json fornita e l’entry point cppdbg di VS Code Run and Debug, quindi esamina il log GDB MI alla ricerca della richiesta evaluate che segnala che il processo è in esecuzione. Il lavoro è completato quando viene determinato se il comportamento è causato dalla configurazione o dall’estensione e viene documentata una configurazione riproducibile con la diagnostica aggiuntiva necessaria per una correzione.

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

Valutazione

Stack tecnologico
cpp, typescript, vscode
Ambito
developer-experience, devtools
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.