From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 78652 invoked by alias); 29 Apr 2015 13:57: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 78643 invoked by uid 89); 29 Apr 2015 13:57:42 -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, 29 Apr 2015 13:57:41 +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 (8.14.4/8.14.4) with ESMTP id t3TDvdJQ005972 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Wed, 29 Apr 2015 09:57:39 -0400 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 t3TDvaWJ006121 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Wed, 29 Apr 2015 09:57:38 -0400 Date: Wed, 29 Apr 2015 13:57:00 -0000 From: Jan Kratochvil To: gdb@sourceware.org Cc: Phil Muldoon Subject: compile: objfiles lifetime UI Message-ID: <20150429135735.GA16974@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00051.txt.bz2 Hi, posting first for an approval CLI UI for managing objfiles currently in inferior for the 'compile' command. With each injected code is associated: * infcall dummy frame - deleted when the code returns or when user interrupts the code and 'return's from it in CLI. * objfile - deleted when the dummy frame is deleted * inferior mmap()ped memory - currently leaked in inferior forever - prepared in a local patchset: deleted when the objfile is deleted * inferior malloc()ed memory - only from the posted 'compile print' command - in the posted 'compile print' command: deleted when the objfile is deleted The mmap leak was intentional so that one can do for example: inferior: char *str = "foo"; GDB: (gdb) compile code str = "bar"; Now there should be a way to delete everything by default (so that a loop with 'compile print' command will not run the inferior out of memory) but to have a way to keep the memory alive (so that for example strings can be set) or even to keep the objfile alive (so that for example a callback function can be set which may crash so that we want to keep DWARF loaded for the callback function). What CLI should be there for it? (gdB) info compile-files Num Address Range Frame Name 1 0x00007ffff7ff3000 - 0x00007ffff7ff5000 - file test.c 2 0x00007ffff7ff9000 - 0x00007ffff7ffb000 #0 code puts("hello wor... (gdb) delete compile-file 1 (gdb) delete compile-file 2 compile-file #2 dummy frame is still valid, use 'return' command to delete it. (gdb) bt #0 0x00007ffff7ff9021 in _gdb_expr (__regs=0x7ffff7ff7000) at gdb command line:1 #1 #2 main () at ./gdb.compile/compile-print.c:31 (gdB) info compile-files Num Address Range Frame Name 2 0x0000003834603da0 - 0x0000003834603dc0 #0 code puts("hello wor... Jan