-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Debugger hangs starting gdb.exe on Windows 10 with UTF-8 enabled. #1527
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@leoliuasia Can you enable |
@pieandcakes Thanks for your time! Below are the output informations from the DEBUG CONSOLE after logging enabled.
|
@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. |
@leoliuasia I don't know if you are using a different encoding, but for some reason
and the issue looks like |
@leoliuasia Can you run |
@WardenGnaw Below is the output: D:\Integration Projects>reg query "hklm\system\controlset001\control\nls\language" /v Installlanguage |
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 You should see something similar to |
Hi, We may have a potential fix. Can you try installing this patched cpptools vsix and see if this fixes your issue? Please uninstall the c/c++ extension that is already installed, then in the Extensions menu, click on the 3 dots and you should see Thank you. |
@WardenGnaw I ran into the exact same issue. My code page is 65001. The potential fix does not work. |
@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. |
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. |
Do you have any additional language packs installed? are you using an input method other than English? |
@pieandcakes I do have french, chinese and japanese keyboard layouts installed, but i use english(us) for coding. I noticed that vscode would switch my keyboard layout sometimes? it's weird |
@MUTTSU The "set target-async on" comes from MIEngine which the extension uses as part of the debug adapter. |
@WardenGnaw My CodePage is 65001. The potential fix does not work. |
@leoliuasia What region is your English keyboard setting? |
@pieandcakes English(United States) with keyboard layout: US. |
@leoliuasia @MUTTSU we are having problems reproducing this issue. I’ve tried installing non-US windows and changing locales and keyboards but I can’t seem to get my Windows installation to report code page 65001. Can either of you provide some guidance as to what other configuration you did? It doesn’t matter what I change I still get my base code page. Win 10 installation: Simplified Chinese Encoding: 936 |
@pieandcakes I think I had the beta option that let me use some universal UTF-8 encoding in locale settings. I'm going to uncheck that and see if it works. |
@pieandcakes @MUTTSU Same problem and I've fixed it by disabling unicode UTF-8 encoding in region settings and current system locate is Chinese (Simplified, China) |
@MUTTSU @KIRI-Z We haven't found a good solution beyond having users disable Unicode UTF-8 encoding. @KIRI-Z Do you have a good set of steps that users can use to disable this setting? If so, please share it here so users know how to work around the problem. |
@pieandcakes Sure. |
Is this actually fixed? cause debugger still hangs if I enable UTF-8. I'm using v0.23.1 |
@Summon528 No I think this was closed by accident. The codepage issue has not been fixed. I have been unable to determine why we are receiving a UTF-8 BOM from gdb and unfortunately this is still causing problems. |
I encounter the same problem, and my |
I have the same problems: i cannot type input when debug. I reinstall window yesterday. |
@phanthaiduong22 if you would like help, please post an engine log and more additional information. |
@pieandcakes , Any status on fixing this? As a workaround...
@:: gdb-with-chcp.BAT
@chcp 1257 >NUL 2>&1 && @"gdb.exe" %*
// eg
// ...
"miDebuggerPath": "${workspaceFolder}/dbin/gdb-with-chcp.BAT",
// ... |
We are trying to determine what needs to happen to block sending of the BOM to We have a repro but not a good way to make a fix unfortunately. |
I just install Window yesterday so Beta: Unicode UTF-8 for worldwide language support was already disabled. But when i debugging i still can't type in terminal my input( like image i want to type a,b but it doesn't work. OS: win10 pro Here is my .vscode : https://pastebin.com/SE3gmACy |
The UTF8 issue is not the issue you are running into @phanthaiduong22. It looks like its waiting for input but i don't see you typing anything in the terminal. You can also try |
Actually, I typed a,b (ex: 3 4) in temminal in vscode . but nothing happened. |
This issue blocked me several days until I know it's caused by UTF BOM. In file https://github.com/microsoft/MIEngine/blob/master/src/WindowsDebugLauncher/DebugLauncher.cs : _debuggerCommandStream = new StreamWriter(_dbgProcess.StandardInput.BaseStream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false)) { AutoFlush = true }; Two possible solutions:
_debuggerCommandStream.WriteLine();
_debuggerCommandStream.Flush(); Log after this change: 1: (993) ->~"For help, type \"help\".\n"
1: (994) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (996) ->(gdb)
1: (996) ->&"\357\273\277\n"
1: (996) ->&"Undefined command: \"\". Try \"help\".\n"
1: (996) ->^error,msg="Undefined command: \"\". Try \"help\"."
1: (996) ->(gdb)
1: (1000) <-1001-gdb-set target-async on
1: (1005) Send Event AD7MessageEvent
1: (1007) ->1001^done
1: (1007) ->(gdb)
1: (1007) ->&"\n"
1: (1007) ->^done
1: (1007) ->(gdb)
1: (1007) 1001: elapsed time 6
1: (1014) <-1002-enable-pretty-printing
Console.InputEncoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier: false); Log after this change: 1: (993) ->~"Type \"apropos word\" to search for commands related to \"word\".\n"
1: (995) ->(gdb)
1: (999) <-1001-gdb-set target-async on
1: (1005) ->1001^done
1: (1005) ->(gdb)
1: (1005) ->&"\n"
1: (1005) ->^done
1: (1005) ->(gdb)
1: (1006) 1001: elapsed time 7
1: (1012) <-1002-enable-pretty-printing 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. |
Excuse me, Where is DebugLauncher.cs located in my computer. Thanks |
@phanthaiduong22 |
@z7z8th Thank you for your investigation. Let me take that fix and do some additional testing. Thanks! |
Fixed in 0.26.1 |
- use new '${defaultBuildTask}' (ref: microsoft/vscode#80478) - removes now unneeded workaround for use of `gdb` with UTF-8 (ref: microsoft/vscode-cpptools#1527)
From @leoliuasia on February 7, 2018 6:6
Steps to Reproduce:
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:
task.json:
launch.json
Copied from original issue: microsoft/vscode#43075
The text was updated successfully, but these errors were encountered: