LLDB for Fortran on macOS with M2 chips warning: no plugin for the language "fortran90"

I’m attempting to debug a Fortran program (Mach-O 64-bit executable format, compiled by gfortran) on macOS. When I load the program into LLDB, I receive the following message:

warning: This version of LLDB has no plugin for the language "fortran90". Inspection of frame variables will be limited.

Consequently, I’m unable to inspect the variables.

Does a “fortran90” plugin exist for LLDB? If so, where can I find it? If there isn’t a plugin for LLDB, are there alternative methods to debug Fortran programs on macOS?"

3 Likes

I was able to get gfortran to install and compile on M2 MacMini, but I used Home Brew and I edit in Emacs… Is there any way to install LLBD with Home Brew as well? Maybe that would install the plugins that you need.

Knarfnarf

Thank you for your suggestion.

I installed llvm using Homebrew, but the lldb within llvm still exhibits the same issue.

There’s no such plugin so far as I could find, and gdb doesn’t work on MacOS. There are many hard to follow links out on the web, but nothing works. My solution is to pretty much exist without a debugger, but when I have to use one (very rarely for what I do) I set up a docker container. I recompile my code and dependencies in the container and then use gdb with no problem. My container is at GitHub - BlameTroi/gfortran-gdb: a docker dev container for running gfortran and gdb to debug and is pretty minimal. The dockerfile is well commented and references some other sources.

If you dig around on SO or Reddit you may find the instructions on how to create and code sign a gdb, but that process doesn’t work reliably and I abandoned it.

I have not tried to build Flang and go full LLVM because I don’t see any reports of it working on Apple Silicon.

I have compiled and run Flang on an M1 (although it’s been a couple months since the last time I did it). It works fine. That said, Flang is not quite feature complete, so your mileage may vary.

Cool, I may try it then. Feature complete isn’t a problem for me, I’m just futzing around teaching myself more modern Fortran. I want to use LFortran, and anytime I do find an issue I report it (and that team moves fast!) but gfortran is getting the job done for me now, except for that debugging stuff. Of course, for someone who learned with cards, overnight turnaround, and core dumps … who needs debuggers :slight_smile: