This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: How to use compile & execute function in GDB
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: éåè <guosheng_gao at realsil dot com dot cn>
- Cc: "gdb at sourceware dot org" <gdb at sourceware dot org>, Phil Muldoon <pmuldoon at redhat dot com>
- Date: Wed, 15 Apr 2015 17:48:36 +0200
- Subject: Re: How to use compile & execute function in GDB
- Authentication-results: sourceware.org; auth=none
- References: <0CEE46EB9C50E44486A861D738D3E20645F9C073 at rsex2 dot realsil dot com dot cn>
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