How to install/fix gdb on Big Sur macport after OS upgrade

The solution that ultimately worked for me was:

  1. Install the newest security patch for Big Sur - on Nov 22, 2021 a new one was released that claims to fix this exact issue, which it does not... on it's own
  2. Install the newest Xcode (tested with Xcode 13.1)
  3. sudo rm -r /Library/Developer/CommandLineTools (yes really, installing a new one with the old present seems to break)
  4. Find your proper Xcode Command Line Tools link here and install it: https://developer.apple.com/download/all/?q=command%20line%20tools
  5. sudo xcode-select -switch /Library/Developer/CommandLineTools
  6. sudo port selfupdate
  7. sudo port upgrade outdated
  8. sudo port uninstall gcc6
  9. sudo port install gcc8 (because gcc6 and gcc7 still don't install, and I suspect 9 and 10 will not either, as per https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061)
  10. sudo port install gdb
  11. ggdb

Yes, after all that, it installs it under a name not mentioned ever during installation. For reasons.