3

While debugging like normally (before I didn't have this kind of problem) GDB returned message :

Internal error while converting character sets: No error.

Only for viewing string or char kind of variables.

I have tried to disable Windows beta UTF-8 engine, tried additional commands from here StackOverflow

Unfortunately nothing works.

Adding additional command for GDB logging I receive the same message.

1: (394137) ->1059^error,msg="Internal error while converting character sets: No error."

EDIT

As @rainbow.gekota requested, I added some more informations.

Current OS : Windows 10 21H2 (Compilation: 19044:2006)

VSCode ver. : 1.72.0 x64 -> 64bbfbf67ada9953918d72e1df2f4d8e537d340e

GDB ver. : 12.1 for MinGW-W64 x86_64, built by Brecht Sanders

GDB installed from MSYS2 repos.

Here's my launch.json with which I was trying to fix this error with set charset UTF-8

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Start debugging",
            "type": "cppdbg",
            "request": "launch",
            "program": "${fileDirname}\\main.exe",
            "args": ["arg1", "arg2", "arg3"],
            "stopAtEntry": false,
            "cwd": "${fileDirname}",
            "environment": [],
            "externalConsole": true,
            "MIMode": "gdb",
            "miDebuggerPath": "C:\\msys64\\mingw64\\bin\\gdb.exe",
            "setupCommands": [
                {
                    "description": "Enable pretty-printing for gdb",
                    "text": "-enable-pretty-printing",
                    "ignoreFailures": true
                },
                {
                    "description": "Fix pretty-printing for gdb",
                    "text": "set charset UTF-8"
                }
            ],
            "preLaunchTask": "Build program",
            "logging": { "engineLogging": true }
        }
    ]
}

I don't have any more idea how to reproduce this error. It was working fine until one day.

gunhasiz
  • 118
  • 1
  • 8
  • You'll need to give more details. What OS version are you on? What version of GDB are you using and from where was it installed? [Provide an MRE](https://stackoverflow.com/help/minimal-reproducible-example). – rainbow.gekota Oct 11 '22 at 09:45
  • Obviously its having to convert from one character set to another, the error is explicit about this much, therefore, I can conclude that the problem is likely cuased by 1 of 2 senarios. One the character set your using can be converted by GDB, but your using a character within the set that GDB is unable to convert. **#2** is: The character-set your using isn't able to be converted by GDB at all. Either way, changing the character-set that the document is in should fix the issue, so long as it is the set that is native to GDB, which I am guessing is Latin-1. – JΛYDΞV Oct 12 '22 at 09:58
  • Have you tried setting VSCode to **`"Western Europe 1"`?** I believe that `"Western Europe 1"` (aka **`"ISO-88591"`**) is the same ISO-standard as `Latin-1`. You can switch to it in VS Code by clicking on the character-encoding display in the status bar, or in the settings menu. – JΛYDΞV Oct 12 '22 at 10:02
  • 1
    This is a good ask by the way, I couldn't find anything about it using DDG, Google, or Bing. – JΛYDΞV Oct 12 '22 at 10:02
  • @rainbow.gekota I provided more info as you requested. – gunhasiz Oct 12 '22 at 19:03
  • 1
    @J-D3V Unfortunately it does not work :( I would love to do a reinstall, however as this error is so exotic that I'm waiting and trying to solve it too. – gunhasiz Oct 12 '22 at 19:07

1 Answers1

0

Unfortunately I couldn't find any logical answer to my question. The only thing that helped was deleting MSYS2 with gdb and gcc installed and installing it once again.

Now I can't reproduce this issues so maybe in the future I'll comeback with the same error. Will see.

gunhasiz
  • 118
  • 1
  • 8