Closed
Description
From @leoliuasia on February 7, 2018 6:6
- VSCode Version:1.19.3
- OS Version: Windows 10 Pro 1709 16299.214
Steps to Reproduce:
- Debug->Start Debugging
- Nothing happens.... just hang in there with little blue block progressbar scrolling...
But when I force end task for gdb.exe in task manager window, vscode shows up an error, and little blue block disappears.
c_cpp_properties.json:
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include\\c++"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceRoot}",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include\\c++"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
task.json:
"tasks": [
{
"label": "build cpp",
"type": "shell",
"command": "g++",
"args": [
"-g",
"-o",
"a.out",
"main.cpp",
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
launch.json
"configurations": [
{
"name": "(gdb) Launch",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}\\a.out",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": true,
"MIMode": "gdb",
"miDebuggerPath": "C:\\MinGW\\bin\\gdb.exe",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
]
}
]
Copied from original issue: microsoft/vscode#43075
Activity
pieandcakes commentedon Feb 7, 2018
@leoliuasia Can you enable
"logging": { "engineLogging": true }
and see where it stops while communicating with gdb?leoliuasia commentedon Feb 8, 2018
@pieandcakes Thanks for your time! Below are the output informations from the DEBUG CONSOLE after logging enabled.
leoliuasia commentedon Feb 8, 2018
@pieandcakes When this kind of things happens, I think the "Stop Debugging" should also be working, but it does not. The whole debug process only can start again util reopen the vscode.
pieandcakes commentedon Feb 8, 2018
@leoliuasia I don't know if you are using a different encoding, but for some reason
gdb
is receivingand the issue looks like
->&"\357\273\2771001-gdb-set target-async on\n"
with the strangely escaped characters.WardenGnaw commentedon Feb 9, 2018
@leoliuasia Can you run
reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage
? This will help us understand which language you have enabled on your OS for us to recreate the issue.leoliuasia commentedon Feb 9, 2018
@WardenGnaw Below is the output:
D:\Integration Projects>reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage
HKEY_LOCAL_MACHINE\system\controlset001\control\nls\language
Installlanguage REG_SZ 0409
WardenGnaw commentedon Feb 9, 2018
Could you also share what CodePage your OS is running? You can find this out by building and running the attached project.
You can build and run this by installing dotnet core at https://www.microsoft.com/net/learn/get-started/windows. Then unzip that project and run
dotnet build
anddotnet run
.You should see something similar to
Your code page is 437
but with a different number.CheckCodePage.zip
WardenGnaw commentedon Feb 10, 2018
Hi,
We may have a potential fix. Can you try installing this patched cpptools vsix and see if this fixes your issue?
cpptools.zip
Please uninstall the c/c++ extension that is already installed, then in the Extensions menu, click on the 3 dots and you should see
install from vsix
.Thank you.
bolu61 commentedon Feb 12, 2018
@WardenGnaw I ran into the exact same issue. My code page is 65001. The potential fix does not work.
@pieandcakes I believe that \357\273\277 is a BOM indicating UTF-8 encoding?
pieandcakes commentedon Feb 12, 2018
@MUTTSU which OS installation are you using? Please give the OS version and the locale that you installed so we can setup a proper test machine. We haven't been able to duplicate this issue here yet.
bolu61 commentedon Feb 12, 2018
Im using win10pro build 17093.1000 (though i had this issue with older builds). Locale is en_CA.
Also I was wondering when the extension starts gdb, where does "set target-async on" come from? I couldn't figure out where in the extension's code it tries to put these configurations.
pieandcakes commentedon Feb 12, 2018
Do you have any additional language packs installed? are you using an input method other than English?
36 remaining items
phanthaiduong22 commentedon Sep 24, 2019
Actually, I typed a,b (ex: 3 4) in temminal in vscode . but nothing happened.
z7z8th commentedon Oct 20, 2019
This issue blocked me several days until I know it's caused by UTF BOM.
After some debugging, I found that the BOM does not come from the PIPE, but comes from the input stream of the debugger(gdb for me).
In file https://github.com/microsoft/MIEngine/blob/master/src/WindowsDebugLauncher/DebugLauncher.cs :
I think the UTF BOM is already in the BaseStream when creating the debugger process.
So the following line did not remove the BOM.
Two possible solutions:
Add the following lines after https://github.com/microsoft/MIEngine/blob/ccec0b00986ca4606b19291a3a3fcf986e5728a6/src/WindowsDebugLauncher/DebugLauncher.cs#L135
Log after this change:
Add the following line before
_dbgProcess.Start();
in https://github.com/microsoft/MIEngine/blob/master/src/WindowsDebugLauncher/DebugLauncher.csLog after this change:
I tested the 2nd solution with English+UTF8, Chinese+UTF-8 and Chinese+Unicode(UTF16), all works.
The 2nd solution seems cleaner if no other impact.
phanthaiduong22 commentedon Oct 21, 2019
Excuse me, Where is DebugLauncher.cs located in my computer.
Thanks
z7z8th commentedon Oct 21, 2019
@phanthaiduong22
You need to download the MIEngine source code to get that file. It's part of the source code of the c/c++ extension. the source code needed to be built in visual studio to generate windowsdebugadapter.exe and serveral other files. but your problem is not related to this issue.
pieandcakes commentedon Oct 21, 2019
@z7z8th Thank you for your investigation. Let me take that fix and do some additional testing.
Thanks!
michelleangela commentedon Oct 28, 2019
Fixed in 0.26.1
Maint/build ~ update VSCode debug settings