From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129042 invoked by alias); 6 May 2015 12:26:44 -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 129027 invoked by uid 89); 6 May 2015 12:26:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.8 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham 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, 06 May 2015 12:26:43 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id 0606DA10A9 for ; Wed, 6 May 2015 12:26:42 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-27.ams2.redhat.com [10.36.116.27]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t46CQcjm022726 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 6 May 2015 08:26:40 -0400 Date: Wed, 06 May 2015 12:26:00 -0000 From: Jan Kratochvil To: Phil Muldoon Cc: gdb@sourceware.org, Alexandre Oliva Subject: Re: compile: objfiles lifetime UI Message-ID: <20150506122637.GA21147@host1.jankratochvil.net> References: <20150429135735.GA16974@host1.jankratochvil.net> <55420463.10400@redhat.com> <20150430105349.GA6260@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150430105349.GA6260@host1.jankratochvil.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-05/txt/msg00007.txt.bz2 On Thu, 30 Apr 2015 12:53:49 +0200, Jan Kratochvil wrote: > What about that 2nd case example of: > (gdb) compile code str = "bar"; > That can be also typed as the 1st case: > (gdb) compile print str = "bar" > Obviously "bar" remains the GDB-mmap()ed memory. Maybe it would be best if GCC can report whether the compiled code exposes address to its internal object outside - such as by such an assignment or by passing such a pointer to some external function. I expect some scan of the IR (intermediate representation - RTL/GIMPLE?) would be sufficient. IMO for 99% of such compiled code it will not happen and therefore GDB can quietly and safely discard such injected objfile from the inferior. It is questionable how many false positives would such a scan-for-address-of make. Jan