Skip to content

Instantly share code, notes, and snippets.

@jcmoyer
Created May 4, 2024 09:06
Show Gist options
  • Select an option

  • Save jcmoyer/cd4d8b63084ab977ad26fe8629375821 to your computer and use it in GitHub Desktop.

Select an option

Save jcmoyer/cd4d8b63084ab977ad26fe8629375821 to your computer and use it in GitHub Desktop.

Problem: You're using a msys2 / mingw gcc / gnat distribution and you're trying to debug Ada code, but you can't catch exceptions:

(gdb) catch exception
Your Ada runtime appears to be missing some debugging information.
Cannot insert Ada exception catchpoint in this configuration.

This is because the distribution installed via pacman is stripped by default. You need to compile gcc yourself and leave the binaries unstripped.

  • Start a mingw64 shell
  • pacman -S base-devel - required for makepkg
  • git clone git@github.com:msys2/MINGW-packages.git
  • cd MINGW-packages/mingw-w64-gcc
  • Edit PKGBUILD in this directory, find options and add !strip, e.g. options=('!emptydirs' '!strip')
  • makepkg-mingw --syncdeps --install (this will ask you to install over your current global install)

Now you should be able to catch exceptions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment