1

This question was asked before here but there is no answers on this questions.

When trying to debug char or string type, the debugger prints <error reading variable> or Converting character sets: Invalid argument respectively instead of its value.

This problem can be fixed by running -exec set charset UTF-8 from the debug console while debugging but it is only a temporary fix, and has to be run every time on debugger startup manually.

Is there a way to permanently fix this issue? (I'd prefer not to change any system settings)

FieryRMS
  • 91
  • 3
  • 11

1 Answers1

2

In the Launch.json file, adding set charset UTF-8 to the setupCommands fixed it.

"setupCommands": [
    {
        "description": "Enable pretty-printing for gdb",
        "text": "-enable-pretty-printing",
        "ignoreFailures": true
    },
    {
        "text": "set charset UTF-8"
    }
]
FieryRMS
  • 91
  • 3
  • 11