diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2017-02-21 13:32:56 -0800 |
---|---|---|
committer | Sergio Durigan Junior <sergiodj@redhat.com> | 2017-08-23 11:16:35 -0400 |
commit | 6e41ddec97d402c6c150701da0f70d40bd6ed5ca (patch) | |
tree | 584df3b69d7feba5ac880046ec7385b02ae2c416 /gdb/doc | |
parent | e68c32d53e44ac0fe9f48637c0113da42b62644a (diff) | |
download | gdb-6e41ddec97d402c6c150701da0f70d40bd6ed5ca.zip gdb-6e41ddec97d402c6c150701da0f70d40bd6ed5ca.tar.gz gdb-6e41ddec97d402c6c150701da0f70d40bd6ed5ca.tar.bz2 |
compile: Add 'set compile-gcc'
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 override which compiler to use. This is what this patch
implements.
It is also a sync between GCC's and GDB's interfaces.
gdb/ChangeLog
2017-08-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* NEWS (Changes since GDB 7.9): Add set compile-gcc and show
compile-gcc.
* compile/compile.c (compile_gcc, show_compile_gcc): New.
(compile_to_object): Implement compile_gcc.
(_initialize_compile): Install "set compile-gcc". Initialize
compile_gcc.
gdb/doc/ChangeLog
2017-08-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.texinfo (Compiling and Injecting Code): Add to subsection
"Compiler search for the compile command" descriptions of set
compile-gcc and show compile-gcc.
include/ChangeLog
2017-08-23 Jan Kratochvil <jan.kratochvil@redhat.com>
* gcc-interface.h (enum gcc_base_api_version): Update comment for
GCC_FE_VERSION_1.
(struct gcc_base_vtable): Rename set_arguments to set_arguments_v0.
Add set_arguments, set_triplet_regexp and set_driver_filename.
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/doc/gdb.texinfo | 36 |
2 files changed, 36 insertions, 6 deletions
diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 40b0e40..bf82730 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2017-08-23 Jan Kratochvil <jan.kratochvil@redhat.com> + + * gdb.texinfo (Compiling and Injecting Code): Add to subsection + "Compiler search for the compile command" descriptions of set + compile-gcc and show compile-gcc. + 2017-08-07 Weimin Pan <weimin.pan@oracle.com> * gdb.texinfo (Architectures): Add new Sparc64 section to document diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index d0d5d96..d977b23 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -18154,13 +18154,15 @@ will print to the console. @subsection Compiler search for the @code{compile} command -@value{GDBN} needs to find @value{NGCC} for the inferior being debugged which -may not be obvious for remote targets of different architecture than where -@value{GDBN} is running. Environment variable @code{PATH} (@code{PATH} from -shell that executed @value{GDBN}, not the one set by @value{GDBN} -command @code{set environment}). @xref{Environment}. @code{PATH} on +@value{GDBN} needs to find @value{NGCC} for the inferior being debugged +which may not be obvious for remote targets of different architecture +than where @value{GDBN} is running. Environment variable @code{PATH} on @value{GDBN} host is searched for @value{NGCC} binary matching the -target architecture and operating system. +target architecture and operating system. This search can be overriden +by @code{set compile-gcc} @value{GDBN} command below. @code{PATH} is +taken from shell that executed @value{GDBN}, it is not the value set by +@value{GDBN} command @code{set environment}). @xref{Environment}. + Specifically @code{PATH} is searched for binaries matching regular expression @code{@var{arch}(-[^-]*)?-@var{os}-gcc} according to the inferior target being @@ -18170,6 +18172,28 @@ example both @code{i386} and @code{x86_64} targets look for pattern for pattern @code{s390x?}. @var{os} is currently supported only for pattern @code{linux(-gnu)?}. +On Posix hosts the compiler driver @value{GDBN} needs to find also +shared library @file{libcc1.so} from the compiler. It is searched in +default shared library search path (overridable with usual environment +variable @code{LD_LIBRARY_PATH}), unrelated to @code{PATH} or @code{set +compile-gcc} settings. Contrary to it @file{libcc1plugin.so} is found +according to the installation of the found compiler --- as possibly +specified by the @code{set compile-gcc} command. + +@table @code +@item set compile-gcc +@cindex compile command driver filename override +Set compilation command used for compiling and injecting code with the +@code{compile} commands. If this option is not set (it is set to +an empty string), the search described above will occur --- that is the +default. + +@item show compile-gcc +Displays the current compile command @value{NGCC} driver filename. +If set, it is the main command @command{gcc}, found usually for example +under name @file{x86_64-linux-gnu-gcc}. +@end table + @node GDB Files @chapter @value{GDBN} Files |