From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128053 invoked by alias); 15 Apr 2015 15:48:43 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 128035 invoked by uid 89); 15 Apr 2015 15:48:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.7 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,GARBLED_BODY,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Wed, 15 Apr 2015 15:48:42 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id E5F32A10B1; Wed, 15 Apr 2015 15:48:40 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3FFmaJR027262 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 15 Apr 2015 11:48:39 -0400 Date: Wed, 15 Apr 2015 15:48:00 -0000 From: Jan Kratochvil To: =?utf-8?B?6auY5Zu96IOc?= Cc: "gdb@sourceware.org" , Phil Muldoon Subject: Re: How to use compile & execute function in GDB Message-ID: <20150415154836.GA10538@host1.jankratochvil.net> References: <0CEE46EB9C50E44486A861D738D3E20645F9C073@rsex2.realsil.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <0CEE46EB9C50E44486A861D738D3E20645F9C073@rsex2.realsil.com.cn> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00028.txt.bz2 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