microsoft / microsoft/vscode-cpptools
Allow "args" to be specified as a single string.
Nessuno ha ancora preso questa issue.
- Lingua principale
- TypeScript
- Stelle
- 6.2k
- Fork
- 1.7k
- Merge medio
- 14h 46m
- PR unite (30g)
- 61
Descrizione
When configuring the launch.json file, it expects args to be an array of strings that are passed to the process, where each item in the array is one argument. This is extremely user-unfriendly when dealing with long command lines. For example, here is my use case.
Problem: I want to debug clang when you run clang-cl.exe /c foo.cpp
Step 1: Run clang-cl.exe /c foo.cpp -###
E:\src\llvmbuild\ninja>bin\clang-cl /c foo.cpp -###
clang version 6.0.0
Target: i686-pc-windows-msvc
Thread model: posix
InstalledDir: E:\src\llvmbuild\ninja\bin
"E:\\src\\llvmbuild\\ninja\\bin\\clang-cl.exe" "-cc1" "-triple" "i686-pc-windows-msvc19.11.25508" "-emit-obj"
"-mrelax-all" "-mincremental-linker-compatible" "-disable-free" "-main-file-name" "foo.cpp" "-mrelocation-model"
"static" "-mthread-model" "posix" "-mdisable-fp-elim" "-relaxed-aliasing" "-fmath-errno" "-masm-verbose"
"-mconstructor-aliases" "-target-cpu" "pentium4" "-D_MT" "-flto-visibility-public-std" "--dependent-lib=libcmt"
"--dependent-lib=oldnames" "-stack-protector" "2" "-fms-volatile" "-fdiagnostics-format" "msvc"
"-dwarf-column-info" "-debugger-tuning=gdb" "-coverage-notes-file" "E:\\src\\llvmbuild\\ninja\\foo.gcno" "-resource-dir" "E:\\src\\llvmbuild\\ninja\\lib\\clang\\6.0.0"
"-internal-isystem" "E:\\src\\llvmbuild\\ninja\\lib\\clang\\6.0.0\\include"
"-internal-isystem" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.11.25503\\ATLMFC\\include"
"-internal-isystem" "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Professional\\VC\\Tools\\MSVC\\14.11.25503\\include"
"-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um"
"-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\ucrt"
"-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\shared"
"-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\um"
"-internal-isystem" "C:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.16299.0\\winrt"
"-fdeprecated-macro" "-fdebug-compilation-dir" "E:\\src\\llvmbuild\\ninja" "-ferror-limit" "19"
"-fmessage-length" "120" "-fno-use-cxa-atexit" "-fms-extensions" "-fms-compatibility"
"-fms-compatibility-version=19.11.25508" "-std=c++14" "-fdelayed-template-parsing"
"-fobjc-runtime=gcc" "-fdiagnostics-show-option" "-fcolor-diagnostics" "-o" "foo.obj" "-x" "c++" "foo.cpp"
Step 2: Take the resulting command line, and debug that. this is necessary because the original invocation actually spawns a child process whose command line is the second invocation, and it is that child invocation that actually needs to be debugged.
In order for me to do this, I have to manually add commas to this huge list of command line arguments.
Worse, if I change one little option to the original clang-cl.exe this entire line could end up being different, and I have to do this all over again. It would be nice if I could just paste this somewhere as a single string.
In regular VS there is one box where I can just paste this. Even in GDB I can just run gdb against clang-cl.exe and then pass command line arguments as a single string. This is a very big productivity hit for projects that frequently debug processes with long command lines.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia individuando la gestione degli argomenti di launch.json nella configurazione di debug C/C++ e verifica come la forma array esistente viene passata al processo. Definisci il comportamento di analisi della riga di comando della forma stringa, incluso l'esempio lungo di clang-cl, mantenendo la forma array attuale. Il lavoro è completato quando gli utenti possono incollare una singola stringa di argomenti e avviare in modo affidabile lo stesso processo figlio.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript, vscode
- Ambito
- developer-experience, tooling
- Tipo di issue
- Funzionalità
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100