Skip to content

Debugger fails when hovering over iterator #3082

@mihaiconstantin

Description

@mihaiconstantin

Type: Debugger

Describe the bug

  • OS and Version: Windows 10 NT x64, Version 1809, Build 17763.253
  • VS Code Version: 1.30.2
    • Commit: 61122f88f0bf01e2ac16bdb9e1bc4571755f5bd8
    • Electron: 2.0.12
    • Chrome: 61.0.3163.100
    • Node.js: 8.9.3
    • V8: 6.1.534.41
  • C/C++ Extension Version: 0.21.0
  • Other extensions you installed:
    • CMake -> the issue still persists after uninstalling it

A clear and concise description of what the bug is:

While debugging, when I hover over the iterator of std::unordered_map the debugger fails with the following error:

  • in notification area: Debug adapter process has terminated unexpectedly (read error)` and the debug console outputs
  • in debug console: Stopping due to fatal error: AggregateException: One or more errors occurred.

To Reproduce

launch.json configuration:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "debug",
            "type": "cppdbg",
            "request": "launch",
            "program": "${workspaceFolder}/bin/vscode/program.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\CLI\\gcc-tools\\mingw-w64\\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        },

        {
            "name": "build & debug",
            "type": "cppdbg",
            "request": "launch",
            "preLaunchTask": "build (cmake)",
            "program": "${workspaceFolder}/bin/vscode/program.exe",
            "args": [],
            "stopAtEntry": false,
            "cwd": "${workspaceFolder}",
            "environment": [],
            "externalConsole": false,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\CLI\\gcc-tools\\mingw-w64\\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                }
            ]
        }
    ]
}

Steps to reproduce the behavior:

Consider the following short snippet:

for (auto iterator = selections.begin(); iterator != selections.end(); ++iterator)
{
    if (iterator->first == name && iterator->second == list)
    {
        iterator = selections.erase(iterator);
    }
}

Everytime when I hover over first and second the debugger crashes. I tested this in different parts of the code and it seems to be the case all the time. If I do not hover, but continue to step over, everything works as expected.

Re-installing the extension did not help.

Additional context

Debug console output:

=thread-group-added,id="i1"
GNU gdb (GDB) 8.1
Copyright (C) 2018 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
Warning: Debuggee TargetArchitecture not detected, assuming x86_64.
=cmd-param-changed,param="pagination",value="off"
[New Thread 18040.0x5114]
[New Thread 18040.0x2e60]
[New Thread 18040.0x2b78]

Thread 1 hit Breakpoint 1, main () at C:\Users\Mihai\Desktop\folder\folder\Console\src\Console.cpp:10
10	    LOG("Console starting...");

Thread 1 hit Breakpoint 2, engine::ItemSelecting::MoveItemToList (item=..., from=..., to=...) at C:\Users\Mihai\Desktop\folder\folder\Engine\src\syntax\ItemSelecting.cpp:79 
79        RemoveFromActiveSelections(itemName, from.type);

Loaded 'C:\WINDOWS\SYSTEM32\ntdll.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\kernel32.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\KernelBase.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\msvcrt.dll'. Symbols loaded.
Loaded 'C:\CLI\gcc-tools\mingw-w64\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\mingw64\opt\bin\libgcc_s_sjlj-1.dll'. Symbols loaded.
Loaded 'C:\CLI\gcc-tools\mingw-w64\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\mingw64\opt\bin\libwinpthread-1.dll'. Symbols loaded.
Loaded 'C:\CLI\gcc-tools\mingw-w64\x86_64-8.1.0-posix-sjlj-rt_v6-rev0\mingw64\bin\libstdc++-6.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\user32.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\win32u.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\gdi32.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\gdi32full.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\msvcp_win.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\ucrtbase.dll'. Symbols loaded.
Loaded 'C:\WINDOWS\System32\imm32.dll'. Symbols loaded.
Execute debugger commands using "-exec <command>", for example "-exec info registers" will list registers in use (when GDB is the debugger)
Stopping due to fatal error: AggregateException: One or more errors occurred.

Any ideas what may case this? Thanks!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions