From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15737 invoked by alias); 11 Jul 2008 12:43:54 -0000 Received: (qmail 15729 invoked by uid 22791); 11 Jul 2008 12:43:54 -0000 X-Spam-Check-By: sourceware.org Received: from mailhost.u-strasbg.fr (HELO mailhost.u-strasbg.fr) (130.79.200.153) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 11 Jul 2008 12:43:19 +0000 Received: from baal.u-strasbg.fr (baal.u-strasbg.fr [IPv6:2001:660:2402::41]) by mailhost.u-strasbg.fr (8.14.2/jtpda-5.5pre1) with ESMTP id m6BChEDC009573 ; Fri, 11 Jul 2008 14:43:14 +0200 (CEST) Received: from mailserver.u-strasbg.fr (ms1.u-strasbg.fr [IPv6:2001:660:2402::141]) by baal.u-strasbg.fr (8.14.0/jtpda-5.5pre1) with ESMTP id m6BChEXk096792 ; Fri, 11 Jul 2008 14:43:14 +0200 (CEST) Received: from d620muller (www-ics.u-strasbg.fr [130.79.210.225]) by mailserver.u-strasbg.fr (8.13.8/jtpda-5.5pre1) with ESMTP id m6BCh9vJ045089 ; Fri, 11 Jul 2008 14:43:13 +0200 (CEST) From: "Pierre Muller" To: "'Daniel Jacobowitz'" , References: <487658F7.1090508@earthlink.net> <48772D22.1050602@st.com> <20080711114353.GA29593@caradoc.them.org> In-Reply-To: <20080711114353.GA29593@caradoc.them.org> Subject: RE: Move GDB to C++ ? Date: Fri, 11 Jul 2008 12:43:00 -0000 Message-ID: <000001c8e353$af148f10$0d3dad30$@u-strasbg.fr> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Content-Language: en-us X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.0 (mailhost.u-strasbg.fr [IPv6:2001:660:2402::153]); Fri, 11 Jul 2008 14:43:14 +0200 (CEST) X-Virus-Status: Clean 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: 2008-07/txt/msg00114.txt.bz2 > -----Message d'origine----- > De=A0: gdb-owner@sourceware.org [mailto:gdb-owner@sourceware.org] De la > part de Daniel Jacobowitz > Envoy=E9=A0: Friday, July 11, 2008 1:44 PM > =C0=A0: gdb@sourceware.org > Objet=A0: Re: Move GDB to C++ ? >=20 > On Fri, Jul 11, 2008 at 10:51:30AM +0100, Andrew STUBBS wrote: > > A while ago there was some idea of a libgdb that would abstract the > > debugger back end from the interface (or I may have totally > misunderstood > > what the whole thing was about). I haven't heard much about it > recently, > > and the libgdb that exists seems to be something of a build artefact, > > rather than a useful abstraction. If such an idea still exists, what > > affect would switching to C++ have on that plan? Would it make it > easier? > > Or would it just make it incompatible with non-C++ projects? >=20 > I don't think such an idea still exists. We've sunk our effort into > MI instead. >=20 > Oddly, even though the idea doesn't exist, it has one user that I know > of (in the Free Pascal IDE). The way it works is quite terrifying; > there's a Pascal interface definition that includes several versions > of each of GDB's core types for selected GDB versions. You can blame ME, I wrote part of that stuff, and it is horrible to=20 maintain too... Just look at the source: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/packages/gdbint/src/gdbin t.pp?view=3Dlog And the current version does not have all the tweaks about older GDB releases for which some fields in some of the structs where missing. Another big trouble was the offsets, and I am still not sure it works correctly for 64 bit architechtures... But it is still very useful... To come back to the main topic about moving GDB sources to C++, Ii must confess that I am a pascal programmer by hart.=20 I only came to C for the beauty of GDB itself! To be able to add pascal support for GDB (which is still far from good, but at least usable). When I see all the troubles about debugging pascal object/classes, I suspect that C++ will still also have some subtleties. I would really hate to not be able to debug GDB with itself!=20 Even nowadays, I still get complaints about incomplete types when I debug GDB with itself, so I imagine that this would become much more common. =20 But I am an old dinosaur, and I also resisted at that time the move of Free Pascal compiler sources from pascal objects to classes, because of similar doubts. I must confess that some things are now much clearer=20 in the implementation of the Free Pascal compiler thanks to that switch. And the argument that we are already using hidden class programming is quite relevant... Using classes is probably a good thing, but I would be scared that people start to use sophisticated C++ features that I=20 do not understand :( Pierre Muller Pascal language support maintainer for GDB