From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27810 invoked by alias); 18 Feb 2003 14:45:35 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 27803 invoked from network); 18 Feb 2003 14:45:34 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by 172.16.49.205 with SMTP; 18 Feb 2003 14:45:34 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18lAt4-0003oV-00; Tue, 18 Feb 2003 10:46:30 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18l8zt-0001ft-00; Tue, 18 Feb 2003 09:45:25 -0500 Date: Tue, 18 Feb 2003 14:45:00 -0000 From: Daniel Jacobowitz To: Pierre Muller Cc: gdb-patches@sources.redhat.com Subject: Re: [RFC] New file fpc-abi.c Message-ID: <20030218144525.GA6379@nevyn.them.org> Mail-Followup-To: Pierre Muller , gdb-patches@sources.redhat.com References: <5.0.2.1.2.20030217180426.02227540@ics.u-strasbg.fr> <5.0.2.1.2.20030217180426.02227540@ics.u-strasbg.fr> <5.0.2.1.2.20030218085343.03243438@ics.u-strasbg.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5.0.2.1.2.20030218085343.03243438@ics.u-strasbg.fr> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-02/txt/msg00371.txt.bz2 On Tue, Feb 18, 2003 at 09:13:28AM +0100, Pierre Muller wrote: > At 18:31 17/02/2003, Daniel Jacobowitz wrote: > >On Mon, Feb 17, 2003 at 06:12:17PM +0100, Pierre Muller wrote: > >> This patch adds a new file fpc-abi.c > >> to the gdb directory. > >> > >> The purpose of this file is rather clear: > >> it allows to recognize Free Pascal compiled > >> objects and to handle ABI stuff in a more > >> adequate way. > >> > >> Should I submit this in several RFA? > >> > >> > >> ChangeLog entry: > >> > >> 2003-02-17 Pierre Muller > >> > >> * fpc-abi.c: New file. > >> Implements Free Pascal specific ABI. > >> * minsyms.c (install_minimal_symbols): Recognize > >> Free Pascal compiled objects by the presence of > >> 'fpc_compiled' minimal symbol. > >> * Makefile.in: Add fpc-abi.c compilation rules. > > > >A lot of this file looks like it was just copied from one of the GNU > >C++ ABI files. Certainly the comments are now wrong. Is a lot of the > >code really appropriate? i.e. does Free Pascal have the concept of an > >RTTI type, or virtual functions, or operator names? > > > >These are listed as C++ ABIs. Adding one for Pascal feels dodgy. > > > Free Pascal does have most of these. > > - The pascal objects are a little bit different from > the C++ classes, in the sense that they are basically > struct that can (but do not always) have a > hidden field, that contains the address of a Virtual Method Table > i.e. a structure that contains information about > the virtual methods of the give object type. > - Free Pascal also knows Delphi like classes > which are more similar to C++ classes, in the sense > that they are just pointers to strucutures allocated on heap > in constructor calls. > > - Run Time Type Information is also supported for > Free Pascal classes, but I did not yet check this part of the code, > because I did never really use it until now. > My idea was that these parts can still be corrected after > this file is in CVS. > > - operators are also supported in Free Pascal, > but the fpc_is_operator_name is not yet correctly implemented. > > I should probably add explicit comments about the > state of the different funtions implemented in this file. > > > The fact that several functions are the same as in gnu-v2-abi.c > are due to the fact that, we I tried to add correct object/class > debugging stabs generation, I tried to generate > gnu-v2 compatible output. > This explains for instance that the is_(cons/des)tructor_name > functions are the same. > > fpc_is_vtable_name is completely Fre Pascal specific. > The other important point is that the recognition of > Free Pascal compiled objects avoid to treat them as gnu-v3 > files, which can be the case with current head CVS GDB if they are linked together with > C files that use this ABI. > Indeed, the gnu-v3 code leads to crashes inside the GDB > code itself when trying to get class informations. Great, I recall you mentioning that v3 and FPC code can be linked together. Someday GDB will be ready for that.... > I do not claim that the fpc-abi.c is a completely correct code, > but: > 1) it avoids some internal GDB crashes when trying to debug executables > that contain both FPC and GNU C v3 generated code. > 2) It enhances the class recognition with respect to the gnu-v2 > ABI. > 3) It is only used if the object has a fpc_compiled minimal symbol, > which should be enough to avoid any interference with other compiler, no? Could you remove or stub out the implementations which are incorrect for FPC and repost it, please? -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer