From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16674 invoked by alias); 17 May 2006 19:07:45 -0000 Received: (qmail 16665 invoked by uid 22791); 17 May 2006 19:07:44 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 17 May 2006 19:07:42 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FgRMv-0003IL-Li; Wed, 17 May 2006 15:07:37 -0400 Date: Wed, 17 May 2006 19:07:00 -0000 From: Daniel Jacobowitz To: Mikhail Teterin Cc: insight@sourceware.org, gdb-patches@sources.redhat.com Subject: Re: Single-executable patch Message-ID: <20060517190737.GB12559@nevyn.them.org> Mail-Followup-To: Mikhail Teterin , insight@sourceware.org, gdb-patches@sources.redhat.com References: <200605162201.33772.mi+mx@aldan.algebra.com> <200605171415.24053.mi+mx@aldan.algebra.com> <446B6AE7.7030200@redhat.com> <200605171502.18798.mi+mx@aldan.algebra.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200605171502.18798.mi+mx@aldan.algebra.com> User-Agent: Mutt/1.5.11+cvs20060403 Mailing-List: contact insight-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: insight-owner@sourceware.org X-SW-Source: 2006-q2/txt/msg00039.txt.bz2 On Wed, May 17, 2006 at 03:02:18PM -0400, Mikhail Teterin wrote: > It seems, all three of the gdb, gdbtui, and insight executables are the same > except for their (tiny) main() functions. > > The attached sample patch allows to install just the gdb and link it to gdbtui > and insight -- the program will behave differently depending on the name, > under which it is invoked. > > This saves not only the disk space (3.2Mb per executable here on FreeBSD/amd64 > despite using shared -ltcl, -ltk, -litcl, and -litk), but the more precious > RAM at runtime too -- when different users run different interfaces on a > shared system, the OS will be able to efficiently share the read-only pages > between them. This has been a world of trouble for other programs in the past, and I do not recommend it; we switched to the separate main programs deliberately IIRC. If this is all you want, here's a simple implementation: /usr/bin/gdbtui: #!/usr/bin/gdb -i=tui -- Daniel Jacobowitz CodeSourcery