microsoft / microsoft/vscode-cpptools
It's weird that the debugger works slow (almost not work!!!)
Nessuno ha ancora preso questa issue.
- 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: MacOS 11.1
- VS Code Version: 1.54.3
- C/C++ Extension Version: 1.0.0
- Other extensions you installed (and if the issue persists after disabling them):
CodeLLDB 1.6.1 , Code Runner 0.11.3 - A clear and concise description of what the bug is.
When I finished the c_cpp_properties.json, tasks.json and launch.json according to the offical site "Using Clang in VS Code" with my own cpp.
The compile and output progress is right. However when I use debugger and enter the main(), when I press the "step debug" button, the speed of the debugger is really slow.
example: the debugger debug an "string my_str" use almost 3mins!!!!
code
#include <iostream>
#include <unordered_map>
#include <string>
#include <random>
#include <ctime>
#define NUM 200000
using namespace std;
string strRand(int length);
int main(){
unordered_map<string, int> my_map;
string my_str[NUM];
for(auto it: my_str)
it = strRand(10);
for(int i=0;i<10;i++)
cout << my_str[i] << endl;
// cout << strRand(10) << endl << strRand(10) << endl << strRand(10) << endl;
return 0;
}
string strRand(int length){
char tmp;
string buffer;
random_device rd;
default_random_engine random(rd());
for(int i=0;i<length;i++){
tmp = random() % 36;
if(tmp<10)
tmp+= '0';
else{
tmp -= 10;
tmp += 'a';
}
buffer += tmp;
}
return buffer;
}
launch.json
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "clang++ - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": true,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "lldb",
"preLaunchTask": "clang++ build active file"
}
]
}
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 riproducendo il rallentamento con il programma C++ fornito e launch.json su macOS 11.1 usando VS Code 1.54.3 e l’estensione C/C++ 1.0.0. Confronta l’esecuzione passo-passo in main() e nella dichiarazione di my_str, verificando al contempo le estensioni CodeLLDB e Code Runner indicate. Il lavoro è completato quando viene identificata una causa riproducibile del debugger e viene confermato un comportamento migliorato nell’esecuzione passo-passo.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- cpp
- Ambito
- devtools
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Da chiarire
- Idoneità per principianti
- 25/100