On 04/23/2015 02:38 PM, Jan Kratochvil wrote:
Hi,

already approved, reposting just to keep it a part of the series:
        https://gcc.gnu.org/ml/gcc-patches/2015-04/msg01301.html

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?

GDB counterpart:
        [PATCH v2 1/2] compile: set debug compile: Display GCC driver filename
        https://sourceware.org/ml/gdb-patches/2015-04/msg00909.html
        Message-ID: <20150423203402.23140.92757.st...@host1.jankratochvil.net>


Jan


include/ChangeLog
2015-04-23  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): Rename set_arguments to set_arguments_v0.
        Update comment for compile.  New method set_arguments.

libcc1/ChangeLog
2015-04-23  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_set_arguments_v0): New function.
        (libcc1_compile): Set parameter verbose to SELF.
        (vtable): Use libcc1_set_arguments_v0 and add libcc1_set_arguments.
OK.
jeff

Reply via email to