microsoft / microsoft/vscode-cpptools
VScode debugging with GDB doesn't show vector or map contents from header files
Personne n'a encore pris cette issue.
- Langage dominant
- TypeScript
- Étoiles
- 6.2k
- Forks
- 1.7k
- Merge moyen
- 14 h 46 min
- PR mergées (30 j)
- 61
Description
Describe the bug
- OS and Version: Windows 10
- VS Code Version: 1.57.1
- C/C++ Extension Version: 1.5.0 insiders3
When debugging with gbd(mingw64 latest version of Sourceforge) and trying to access variables from header files(.hpp), it says:
can not access memory
To Reproduce
Please include a code sample and launch.json configuration.
Steps to reproduce the behavior:
Use a C++ file with a .hpp file
add a vector or map as part of the header file
debug with gdb(with pretty printing enabled)
try taking a look the vector contents
lanuch.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": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\bin\\EnderKnightShell.exe",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"miDebuggerPath": "C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "build"
}
]
}
Additional context
part of the log(I can't copy the full thing)
1: (5403) ->(gdb)
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (5403) 1066: elapsed time 14\r\n"},"seq":1396}
1: (5403) 1066: elapsed time 14
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (5403) ->&\"\\n\"\r\n"},"seq":1398}
1: (5403) ->&"\n"
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (5403) ->^done\r\n"},"seq":1400}
1: (5403) ->^done
--> E (output): {"type":"event","event":"output","body":{"category":"console","output":"1: (5403) ->(gdb)\r\n"},"seq":1402}
1: (5403) ->(gdb)
--> R (variables-20): {"type":"response","request_seq":20,"success":true,"command":"variables","body":{"variables":[{"name":"eklexer","value":"{...}","type":"lex::Lexer","evaluateName":"eklexer","variablesReference":1003},{"name":"var","value":"0","type":"int","evaluateName":"var","variablesReference":0,"memoryReference":"0x0000000000000000"},{"name":"DebugTokens","value":"{...}","type":"std::vector<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > >, std::allocator<std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > > > >","evaluateName":"DebugTokens","variablesReference":1004},{"name":"argc","value":"1","type":"int","evaluateName":"argc","variablesReference":0,"memoryReference":"0x0000000000000001"},{"name":"argv","value":"0x11b1870","type":"char **","evaluateName":"argv","variablesReference":1005,"memoryReference":"0x00000000011b1870"}]},"seq":1404}```
Guide de contribution
Ouvrir le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Piste de recherche
Commencez par reproduire le problème sous Windows 10 avec le launch.json fourni, MinGW-w64 GDB et un fichier source C++ qui utilise des valeurs de vector ou map provenant d’un fichier .hpp. Comparez le comportement du débogueur pour la variable DebugTokens et considérez le problème comme résolu lorsque le contenu de son conteneur s’affiche correctement.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- cpp, vscode
- Domaine
- devtools
- Type d'issue
- Bug
- Difficulté
- 4/5
- Temps estimé
- 3-5 jours
- Activité
- À l'abandon
- Clarté
- À clarifier
- Accessibilité débutants
- 25/100