From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21715 invoked by alias); 21 May 2012 15:56:09 -0000 Received: (qmail 21701 invoked by uid 22791); 21 May 2012 15:56:07 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 21 May 2012 15:55:49 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q4LFtmLg026060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 21 May 2012 11:55:48 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q4LFtl5f032671; Mon, 21 May 2012 11:55:47 -0400 Message-ID: <4FBA6583.5000002@redhat.com> Date: Mon, 21 May 2012 15:56:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120430 Thunderbird/12.0.1 MIME-Version: 1.0 To: Tom Tromey CC: Jan Kratochvil , gdb@sourceware.org Subject: Re: Will therefore GDB utilize C++ or not? References: <20120330161403.GA17891@host2.jankratochvil.net> <87aa2rjkb8.fsf@fleche.redhat.com> <4F832D5B.9030308@redhat.com> <87ehqhfenc.fsf@fleche.redhat.com> In-Reply-To: <87ehqhfenc.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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 X-SW-Source: 2012-05/txt/msg00101.txt.bz2 On 05/18/2012 08:55 PM, Tom Tromey wrote: >>>>>> "Pedro" == Pedro Alves writes: > > Pedro> This is important, because we want gdbserver to be usable in #1, > Pedro> resource constrained scenarios where the C++ dependency would be > Pedro> unacceptable. > > I wonder whether you would reconsider this given the size measurements I > did. Thanks. I appreciate them. I didn't expect the code size to grow significantly, as we had already seem similar comparisons done for gcc in the course of the various C vs C++ discussions over there with similar results. However, I'll note that such comparisons assume an unchanged C-style codebase, and ignore the size increase you get when you actually start using C++ features, such as, throwing exceptions, or using iostream. In my quick experiment adding a cout << "foo" (-static-libstdc++ -flto -Os + strip) more than triples the binary size. > In particular, C++ is something like 3% space overhead today, and that > gdbserver is already ~300K. I think that size growth is quite > acceptable. > > Pedro> We don't want there to need to be other gdbserver-like programs > Pedro> specialized for such environments, and gdbserver to be usable > Pedro> only on bigger machines. We want gdbserver to run everywhere. > > The recent gdb-patches thread from Jonathan Larmour indicates that we > already lost this one. He was concerned about the use of 2183 bytes. That was for eCos, running on tiny embedded micro-controllers though. I'm talking about things such as uclinux based routers vs big iron GNU/Linux mainframes -- having only one codebase to maintain that has to know ptrace intricasy, for example. -- Pedro Alves