public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Ovidiu Predescu <ovidiu@aracnet.com>
To: marcusd@cathcart.sysc.pdx.edu (Marcus G. Daniels)
Cc: Scott Christley <scottc@net-community.com>, egcs@cygnus.com
Subject: Re: GCC/ObjC enhancements, comments requested
Date: Sun, 08 Feb 1998 22:32:00 -0000	[thread overview]
Message-ID: <199802090632.WAA09654@aracnet.com> (raw)
In-Reply-To: <rfira5dlsnh.fsf@cathcart.sysc.pdx.edu>

On 08 Feb 1998 12:59:30, marcusd@cathcart.sysc.pdx.edu (Marcus G. Daniels) wrote:

> >>>>> "OP" == Ovidiu Predescu <ovidiu@aracnet.com> writes:
>
> OP> The way I originally saw this runtime construction of a call is to
> OP> make GCC generate this knowledge and implement generic functions
> OP> in a runtime library (libgcc or libobjc) that uses that knowledge
> OP> to build the call.
>
> Hey, if worse came to worst, "gcc -g" generates this knowledge.
> Looks to me like "objdump --debugging" reports everything that's needed.
> Link in GNU BFD and load up them reflection data structures!

What we're trying to build is a system that allows us to build a function  
call at _runtime_, knowing the address of the function, the argument types  
and the return value. The types would be encoded in a similar way with how  
ObjC currently encodes them, in C strings. GCC currently implements only half  
of this support with the __builtin_apply() and __builtin_return()  
pseudo-functions.

BFD can't help us here because it gives information only on the name of the  
functions contained in an object file, the argument types are lost (at least  
for C and C++ functions, ObjC does encode the argument and return value types  
of each method).

What is needed is a way to access and set the arguments in the frame passed  
to __builtin_apply() and the return value respectively in __builtin_return().  
The knowledge to do this is definitely contained inside GCC, as it is able  
to generate these functions. We need a way to export this knowledge to an  
external library like libgcc.

I think this can be done relatively easy by exporting the tables and the   
register and mode information used by expand_builtin_apply() and  
expand_builtin_return() in expr.c. We can then implement a simple C API that  
works with them to access the __builtin_apply frame; the algorithms  
implemented would duplicate the ones used by the above functions.

--
Ovidiu Predescu <ovidiu@net-community.com> (NeXTMail, MIME)
http://www.net-community.com/Users/~ovidiu

  reply	other threads:[~1998-02-08 22:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-02-07 18:11 Scott Christley
1998-02-07 22:43 ` Richard Henderson
1998-02-08 10:21   ` Scott Christley
1998-02-10  3:34     ` Richard Henderson
1998-02-10 14:45   ` Anthony Green
1998-02-08 10:27 ` Ovidiu Predescu
1998-02-08 13:12   ` Marcus G. Daniels
1998-02-08 22:32     ` Ovidiu Predescu [this message]
1998-02-09  7:43       ` Bruno Haible
1998-02-09 15:33         ` Ovidiu Predescu
     [not found]           ` <199802092146.WAA04183@halles.ilog.fr>
1998-02-10 10:58             ` Ovidiu Predescu
1998-02-10 14:45               ` Joern Rennecke
1998-02-09 11:31       ` Marcus G. Daniels
1998-02-10  3:34       ` Richard Henderson
1998-02-10 10:58         ` Ovidiu Predescu
1998-02-09 14:46     ` Anthony Green

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=199802090632.WAA09654@aracnet.com \
    --to=ovidiu@aracnet.com \
    --cc=egcs@cygnus.com \
    --cc=marcusd@cathcart.sysc.pdx.edu \
    --cc=scottc@net-community.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).