diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2017-02-21 13:32:55 -0800 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2017-08-23 11:15:03 -0400 |
commit | e68c32d53e44ac0fe9f48637c0113da42b62644a (patch) | |
tree | ac71155c327ab46a5bb437684ecb894fbe736b46 /include | |
parent | f6a36b0c9e537e4525f3b0687a4f76b4f77bf173 (diff) | |
download | gdb-e68c32d53e44ac0fe9f48637c0113da42b62644a.zip gdb-e68c32d53e44ac0fe9f48637c0113da42b62644a.tar.gz gdb-e68c32d53e44ac0fe9f48637c0113da42b62644a.tar.bz2 |
compile: set debug compile: Display GCC driver filename
As discussed in
How to use compile & execute function in GDB
https://sourceware.org/ml/gdb/2015-04/msg00026.html
GDB currently searches for compilers on /usr/bin/ARCH-OS-gcc and
chooses a match from there. However, it is not currently possible for
the user to display which compiler was selected. Up until now, GDB's
compiler interface was not up-to-date with GCC's one, which means that
it wasn't possible to obtain this information. This patch implements
the mechanisms necessary for that.
gdb/ChangeLog
2017-08-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* compile/compile.c (compile_to_object): Conditionally call
set_verbose. Conditionally call compile or compile_v0.
include/ChangeLog
2017-08-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* gcc-interface.h (enum gcc_base_api_version): Add
GCC_FE_VERSION_1.
(struct gcc_base_vtable): Rename compile to compile_v0. Update
comment for compile. New methods set_verbose and compile.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 7 | ||||
-rw-r--r-- | include/gcc-interface.h | 36 |
2 files changed, 35 insertions, 8 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index db500dc..02ee554 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,10 @@ +2017-08-23 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gcc-interface.h (enum gcc_base_api_version): Add + GCC_FE_VERSION_1. + (struct gcc_base_vtable): Rename compile to compile_v0. Update + comment for compile. New methods set_verbose and compile. + 2017-08-21 Alexander Fedotov <alexander.fedotov@nxp.com> Edmar Wienskoski <edmar.wienskoski@nxp.com> diff --git a/include/gcc-interface.h b/include/gcc-interface.h index d4c4ec6..c98f078 100644 --- a/include/gcc-interface.h +++ b/include/gcc-interface.h @@ -44,7 +44,10 @@ struct gcc_base_context; enum gcc_base_api_version { - GCC_FE_VERSION_0 = 0 + GCC_FE_VERSION_0 = 0, + + /* Deprecated method compile_v0. Added method set_verbose and compile. */ + GCC_FE_VERSION_1 = 1, }; /* The operations defined by the GCC base API. This is the vtable for @@ -93,18 +96,35 @@ struct gcc_base_vtable const char *message), void *datum); - /* Perform the compilation. FILENAME is the name of the resulting - object file. VERBOSE can be set to cause GCC to print some - information as it works. Returns true on success, false on - error. */ + /* Deprecated GCC_FE_VERSION_0 variant of the GCC_FE_VERSION_1 + compile method. GCC_FE_VERSION_0 version verbose parameter has + been replaced by the set_verbose method. */ - int /* bool */ (*compile) (struct gcc_base_context *self, - const char *filename, - int /* bool */ verbose); + int /* bool */ (*compile_v0) (struct gcc_base_context *self, + const char *filename, + int /* bool */ verbose); /* Destroy this object. */ void (*destroy) (struct gcc_base_context *self); + + /* VERBOSE can be set to non-zero to cause GCC to print some + information as it works. Calling this method overrides its + possible previous calls. + + This method is only available since GCC_FE_VERSION_1. */ + + void (*set_verbose) (struct gcc_base_context *self, + int /* bool */ verbose); + + /* Perform the compilation. FILENAME is the name of the resulting + object file. Either set_triplet_regexp or set_driver_filename must + be called before. Returns true on success, false on error. + + This method is only available since GCC_FE_VERSION_1. */ + + int /* bool */ (*compile) (struct gcc_base_context *self, + const char *filename); }; /* The GCC object. */ |