I have the same problem when using the -x parameter of GDB in VS Code. If I use the below config in lanuch.json
"miDebuggerArgs": "-x ${workspaceRoot}/.vscode/gdb.conf",
I will get error
Unhandled Exception: System.ArgumentException: Invalid escape sequence: \U
at WindowsDebugLauncher.Program.ParseDebugExeArgs(String line)
at WindowsDebugLauncher.Program.Main(String[] argv)
Due to ${workspaceRoot}
was expand to c:\\Users\\username\\Apps\\Msys64\\home\\username\\project/.vscode/gdb.conf
There are many discussions https://github.com/microsoft/vscode-cpptools/issues/908 and https://github.com/microsoft/vscode-cpptools/issues/9785 but without any solution. The work solution is from here.The solution is to use the Command Variable VSCode extension
"miDebuggerArgs": "-x ${command:extension.commandvariable.workspace.folderPosix}/.vscode/gdb.conf",
Will be expanded to /c/Users/username/Apps/Msys64/home/username/project/.vscode/gdb.conf
and the problem is solved.