]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: remove --disable-gdbmi configure option
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 14 Feb 2023 16:13:43 +0000 (11:13 -0500)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 23 Feb 2023 21:40:19 +0000 (16:40 -0500)
commit831a223b984c04b6a118791b392efd2c7282f9ed
tree641dfacefd7c389575f0fd8f6a944070af4c6af6
parenteb94f4278737e6df934d7064ebbd87e4d95ad9d7
gdb: remove --disable-gdbmi configure option

I noticed that the --disable-gdbmi option was broken for almost a year
(since 740b42ceb7c "gdb/python/mi: create MI commands using python").

The problem today is the python/py-cmd.c file.  It is included in the
build if Python support is enabled, and it calls into some MI functions
(e.g. insert_mi_cmd_entry).  If MI support is disabled, we get some
undefined symbols like:

    mold: error: undefined symbol: insert_mi_cmd_entry(std::unique_ptr<mi_command, std::default_delete<mi_command> >)
    >>> referenced by py-micmd.c
    >>>               python/py-micmd.o:(micmdpy_install_command(micmdpy_object*))

The python/py-cmd.c file should be included in the build if both Python
and MI support are enabled.  It is not a case we support today, but it
could be done with a bit more configure code.  However, I think we
should just remove the --disable-gdbmi option, and just include MI
support unconditionally.

Tom Tromey proposed a while ago to remove this option, but it ended
staying:

  https://inbox.sourceware.org/gdb-patches/20180628172132.28843-1-tom@tromey.com/

However, there was no strong opposition to remove it.  The argument was
just "bah, it doesn't hurt anybody".

But given today's case, I would rather remove complexity rather than add
some.  I couldn't find anybody caring deeply for that option, and it's
not like MI adds any external dependency.  It's just a bit more code.

Removing the option will not break anybody using --disable-gdbmi (it can
be found in many build scripts [1]), since we don't flag invalid
configure flags.

So, remove the option from configure.ac, and adjust Makefile.in
accordingly to always include the MI objects in the build.

[1] https://github.com/search?q=%22--disable-gdbmi%22&type=code

Change-Id: Ifcaa8c9fc4abc6fa686ed5fd984598644f745240
Approved-By: Tom Tromey <tom@tromey.com>
gdb/Makefile.in
gdb/configure
gdb/configure.ac