Search code examples
linuxemacsgdbemacs24

What does gdb -i=mi mean?


When starting gdb from emacs, emacs says that gdb should be started as

gdb -i=mi

The option -i is not defined in the gdb man page. If gdb is invoked from the command line with option -i=mi, it works. So it must be specific to gdb. Where is the documentation for the -i option?


Solution

  • gdb -i=mi is equivalent to gdb --interpreter=mi.

    In short, --interpreter=mi makes gdb present a machine-oriented text interface rather than the human-oriented command prompt you get without it. Emacs's gud buffer parses the output from this interface and presents something resembling the normal gdb interface to you.

    The --interpreter flag is documented here, and the GDB/MI interface is documented here. That -i is an alias for --interpreter is mentioned in passing here.