From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26435 invoked by alias); 9 Apr 2012 19:05:42 -0000 Received: (qmail 26426 invoked by uid 22791); 9 Apr 2012 19:05:40 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,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, 09 Apr 2012 19:05:25 +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 q39J5OEe020114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 9 Apr 2012 15:05:24 -0400 Received: from host2.jankratochvil.net (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q39J5Koo030680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Mon, 9 Apr 2012 15:05:23 -0400 Date: Mon, 09 Apr 2012 19:05:00 -0000 From: Jan Kratochvil To: Pedro Alves Cc: Tom Tromey , gdb@sourceware.org Subject: Re: Will therefore GDB utilize C++ or not? Message-ID: <20120409190519.GA524@host2.jankratochvil.net> References: <20120330161403.GA17891@host2.jankratochvil.net> <87aa2rjkb8.fsf@fleche.redhat.com> <4F832D5B.9030308@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4F832D5B.9030308@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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-04/txt/msg00064.txt.bz2 On Mon, 09 Apr 2012 20:41:31 +0200, Pedro Alves wrote: > Indeed, gdbserver would need to remain pure C, [...] > This is important, because we want gdbserver to be usable > in #1, resource constrained scenarios where the C++ dependency would > be unacceptable. We don't want there to need to be other gdbserver-like > programs specialized for such environments, and gdbserver to be usable only > on bigger machines. We want gdbserver to run everywhere. And #2, the debugger > is one of the first programs that is desirable to get running on a new > system/board. Usually you get C going much sooner than C++. While it was said before gdbserver should stay in C I did not see it long-term maintainable - due to the code sharing goals. While I wanted to simplify the talk excluding gdbserver first we can talk even about C++ization of gdbserver. Which specific platforms do you talk about which is UNIX compatible (=FSF gdbserver compatible, not just an embedded stub) and cannot run C++ programs? (*) Please give examples of viable platforms with future development. (*) The smallest device I know about is SIM card - and it runs Java (Card) VM, therefore more heavy environment than C++. > The event-loop.c file is yet another thing. > It is currently duplicated (though a bit simplified) in gdbserver/event-loop.c. > There goes another use for C++ classes. The mail lists all the code parts which cannot be C++ized. I do not find that too interesting. I find interesting code parts which can be C++ized - such as anything about symbols/types outside of gdbserver. > (On a sidenote: I get the impression from some that C++ would be mostly > useful for the stronger static typing, Not just that one, std::string vs. cleanups vs. exceptions are even more wanted (by me); just static typing (probably) cannot be done without C++, the other parts are still being fixed up without C++. Thanks, Jan