Looks like you forgot to specify the “–interpreter mi” argument in the gdb command line. This argument is required in order to enable the “machine interface” – a special mode where gdb produces machine-readable replies to commands instead of the regular text replies.
VisualGDB would normally handle this automatically for the regular debug configurations, however using the fully custom mode shown on the screenshot requires specifying it manually.
The easiest way to resolve this would be to try building a newer gdb from source code (it’s usually much easier than building the entire toolchain and just involves running ./configure –target=<…> and making sure you have libexpat available). Another option would be to try specifying another debug information format in build settings (e.g. DWARF-2 or DWARF-4) or simply avoiding the evaluation of the variable that triggers the crash.