Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pierre Muller <muller@ics.u-strasbg.fr>
To: Daniel Jacobowitz <drow@mvista.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFC] New file fpc-abi.c
Date: Tue, 18 Feb 2003 08:17:00 -0000	[thread overview]
Message-ID: <5.0.2.1.2.20030218085343.03243438@ics.u-strasbg.fr> (raw)
In-Reply-To: <20030217173108.GA19560@nevyn.them.org>

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  <muller@ics.u-strasbg.fr>
>> 
>>         * 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.

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?






  reply	other threads:[~2003-02-18  8:17 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-17 17:16 Pierre Muller
2003-02-17 17:31 ` Daniel Jacobowitz
2003-02-18  8:17   ` Pierre Muller [this message]
2003-02-18 14:45     ` Daniel Jacobowitz
2003-02-18 21:20       ` Andrew Cagney
2003-02-19 16:42       ` [RFC 2nd] " Pierre Muller
2003-02-19 17:06         ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5.0.2.1.2.20030218085343.03243438@ics.u-strasbg.fr \
    --to=muller@ics.u-strasbg.fr \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox