On 04/21/2015 03:41 PM, Jan Kratochvil wrote:
Hi,

as discussed in
        How to use compile & execute function in GDB
        https://sourceware.org/ml/gdb/2015-04/msg00026.html

GDB currently searches for /usr/bin/ARCH-OS-gcc and chooses one but it does not
display which one.  It cannot, GCC method set_arguments() does not yet know
whether 'set debug compile' is enabled or not.

Unfortunately this changes libcc1 API in an incompatible way.  There is
a possibility of a hack to keep the API the same - one could pass "-v" option
explicitly to set_arguments(), set_arguments() could compare the "-v" string
and print the GCC filename accordingly.  Then the 'verbose' parameter of
compile() would lose its meaning.  What do you think?
I think we're early enough in the evolution of libcc1 that changing the ABI shouldn't be a big deal. I'd expect gcc & gdb to need to move in lock-step for this stuff for a while.


GDB counterpart:
        [PATCH 3/4] compile: set debug compile: Display GCC driver filename
        https://sourceware.org/ml/gdb-patches/2015-04/msg00807.html
        Message-ID: <20150421213649.14147.79719.st...@host1.jankratochvil.net>


Jan


include/ChangeLog
2015-04-21  Jan Kratochvil  <jan.kratoch...@redhat.com>

        * gcc-interface.h (enum gcc_base_api_version): Add comment to
        GCC_FE_VERSION_1.
        (struct gcc_base_vtable): Move parameter verbose from compile to
        set_arguments.

libcc1/ChangeLog
2015-04-21  Jan Kratochvil  <jan.kratoch...@redhat.com>

        * libcc1.cc: Include intl.h.
        (struct libcc1): Add field verbose.
        (libcc1::libcc1): Initialize it.
        (libcc1_set_arguments): Add parameter verbose, implement it.
        (libcc1_compile): Remove parameter verbose, use self's field instead.
OK.  Please install on the trunk.

jeff


Reply via email to