From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30624 invoked by alias); 2 Jun 2012 07:01:22 -0000 Received: (qmail 30616 invoked by uid 22791); 2 Jun 2012 07:01:21 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_05,KHOP_THREADED,MISSING_HEADERS,RCVD_IN_HOSTKARMA_NO,RCVD_VIA_APNIC,TO_NO_BRKTS_PCNT X-Spam-Check-By: sourceware.org Received: from icp-osb-irony-out8.external.iinet.net.au (HELO icp-osb-irony-out8.external.iinet.net.au) (203.59.1.225) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 02 Jun 2012 07:01:05 +0000 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvACAL65yU9yxku0/2dsb2JhbAANOLMRhCoBAQEDAThAAQULCw0LCRYPCQMCAQIBRRMBBwKIAhC3PYsRhhADmw2MdoFEIw Received: from unknown (HELO [192.168.0.10]) ([114.198.75.180]) by icp-osb-irony-out8.iinet.net.au with ESMTP; 02 Jun 2012 15:01:03 +0800 Message-ID: <4FC9BA2F.7030202@netspace.net.au> Date: Sat, 02 Jun 2012 07:01:00 -0000 From: Russell Shaw User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.15) Gecko/20101030 Icedove/3.0.10 MIME-Version: 1.0 CC: gdb@sourceware.org Subject: Re: Will therefore GDB utilize C++ or not? References: <20120526155005.GA30091@host2.jankratochvil.net> In-Reply-To: <20120526155005.GA30091@host2.jankratochvil.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes 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-06/txt/msg00005.txt.bz2 On 27/05/12 01:50, Jan Kratochvil wrote: > On Mon, 21 May 2012 17:55:47 +0200, Pedro Alves wrote: ... > 453728 vs. 265000 bytes is +71% increase. > It still seems perfectly worth to me for all the discussed C++ benefits for GDB. ... A few of the things i didn't like about C++ have been fixed in the C++11 standard. In particular, under: Rvalue references and move constructors A lot of C++ code was copying objects by value, which means the copy constructor had to deep-copy and malloc to make temporaries, only to throw them away later. That is *slow* and fragments the heap, especially on smaller systems. With C11, new "move constructors" have been added for copying malloc'd memory to avoid that problem. Parsing C++ has also been improved. A lot of other improvements too. I just read the C11 standard (close to final version), and am re-considering the use of C++ for smaller microcontrollers. If gdb is done in C++, run-time performance and bloat should be kept in check by avoiding gratuitous use of generalized template libraries. C-like libraries for things like bit-sets and symbol tables should work equally as efficient in C++ if translated with some superficial C++ syntax. Hitting my F9 "compile" button would result in an annoying half-second delay when compiling simple programs using the STL (years ago when i did C++). Self written utility libraries such as those already done in C in gdb could avoid that.