microsoft / microsoft/vscode-cpptools
Garbled error pop-up when using under Simplified Chinese Windows environment
Open
Nobody has claimed this yet.
debugger
help wanted
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 1.7k
- Avg merge
- 14h 46m
- Merged PRs (30d)
- 61
Description
Environment
- OS and version: Windows 10 22H2 19045.3448
- VS Code: 1.82.2
- C/C++ extension: 1.17.5
- OS and version of remote machine (if applicable):
- GDB / LLDB version: 8.2.1
Bug Summary and Steps to Reproduce
Bug Summary:
When attempting to start a debugging session, OpenOCD may return errors such as connection denied in localized language, for instance:
OpenOCD:
Open On-Chip Debugger 0.12.0+dev-01297-g909fd47f9 (2023-09-06-10:18)
Licensed under GNU GPL v2
Error: unable to open ftdi device with description 'Dual RS232-HS', serial '*' at bus location '*'
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
GDB:
The target is assumed to be little endian
./gdb.txt:6: Error in sourced command file:
localhost:3333: 由于目标计算机积极拒绝,无法连接。
.
(gdb)
In these cases, cppdbg would report an error in a pop-up, but in wrong encoding, as shown in this screenshot:
Debugger Configurations
// https://code.visualstudio.com/docs/cpp/launch-json-reference
{
"version": "0.2.0",
"configurations": [
{
"name": "cppdbg OpenOCD GDB",
"type": "cppdbg",
"request": "launch",
"program": "${workspaceFolder}/build/uAptiv_Baremetal.elf",
"cwd": "${workspaceFolder}",
"targetArchitecture": "mips",
// Debug Server: OpenOCD @ localhost:3333
// Comment "debugServerPath" to stop cppdbg from launching OpenOCD,
// allowing the usage of other OpenOCD instances.
"debugServerPath": "openocd",
"debugServerArgs": "-s \"${workspaceFolder}\"",
"miDebuggerServerAddress": "localhost:3333",
"filterStderr": true,
"filterStdout": false,
"serverStarted": "Listening on port 4444 for telnet connections",
// Debugger: GDB
"MIMode": "gdb",
"miDebuggerPath": "mips-mti-elf-gdb",
"miDebuggerArgs": "",
"useExtendedRemote": true,
"stopAtEntry": true,
"stopAtConnect": true,
// Commands before GDB connects remote
"setupCommands": [
{ "text": "set endian little" },
{ "text": "set mem inaccessible-by-default off" },
{ "text": "set disassemble-next-line on" },
/* { // This bug no longer exists in OpenOCD 0.12.0
"text": "-environment-cd ${workspaceFolder}",
"description": "https://github.com/microsoft/vscode-cpptools/issues/548"
}, */
{ "text": "dir src/asm" },
],
// Commands after GDB connects remote
"postRemoteConnectCommands": [
{ "text": "load" },
{ "text": "set $pc=0xa0070000" },
]
}
]
}
### Debugger Logs
```shell
OpenOCD:
Open On-Chip Debugger 0.12.0+dev-01297-g909fd47f9 (2023-09-06-10:18)
Licensed under GNU GPL v2
Error: unable to open ftdi device with description 'Dual RS232-HS', serial '*' at bus location '*'
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
GDB:
The target is assumed to be little endian
./gdb.txt:6: Error in sourced command file:
localhost:3333: 由于目标计算机积极拒绝,无法连接。
.
(gdb)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the error with the supplied Windows 10 Simplified Chinese environment and cppdbg/OpenOCD/GDB configuration, then trace how cppdbg presents debugger errors in the pop-up. Done means the localized connection-denied message is readable in the pop-up without regressing the debugger output.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100