Msys2 gdb workaround

If you develop your Rack plugin on Windows, you may have have run into this:

$ gdb
osabi.c:661: internal-error: _initialize_gdb_osabi: gdb_osabi_names[] is inconsistent
A problem internal to GDB has been detected,
further debugging may prove unreliable.
Quit this debugging session? (y or n) Segmentation fault (core dumped)

Here’s the bug verifying that this has nothing to do with Rack:

And here’s the fix:

pacman -S mingw-w64-x86_64-gdb
$ /mingw64/bin/gdb
GNU gdb (GDB) 8.3

Wow, thanks so much for posting, that did it :slight_smile:

Thanks, added mingw-w64-x86_64-gdb to list of Windows build dependencies, since it’s used so much.

One downside to this workaround is that the replacement GDB does not work with arrow keys to edit the command line or show history, when used with the standard mingw64.exe terminal.

There is a workaround to this workaround as described here

$ pacman -S winpty
$ winpty gdb --args ./Rack.exe -d

[Edit] … but it messes up breakpoints. Sigh.