Re: How to use compile & execute function in GDB

Jan Kratochvil <[email protected]>
Newsgroups gmane.comp.gdb.devel
Message-ID <[email protected]>
On Wed, 15 Apr 2015 07:45:19 +0200, 高国胜 wrote:
> I have install gcc-5.0, and copy libcc1.so to current work space.

GDB apparently found libcc1.so but the gcc commmand GDB found is not gcc-5.0,
otherwise it would not complain for '-std=gnu11' etc.

GDB does not search for 'cc' or 'gcc', it uses more complicated pattern:
	https://sourceware.org/gdb/current/onlinedocs/gdb/Compiling-and-Injecting-Code.html#Compiling-and-Injecting-Code
	17.7.3 Compiler search for the compile command
For example on my system it found (not easy to find out, used 'strace -f -p'
for running GDB during the 'compile code' command):
	/usr/lib64/ccache/x86_64-redhat-linux-gcc

I will add there some debug output + filename-enforcing commands.


Thanks for testing compile,
Jan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.