This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
RE: Adding platform extensions?
- To: "'Mike Stump'" <mrs at windriver dot com>, <gcc at gcc dot gnu dot org>
- Subject: RE: Adding platform extensions?
- From: "Dan Guisinger" <danrg at mn dot mediaone dot net>
- Date: Mon, 15 Nov 1999 21:55:57 -0600
- Reply-To: <danrg at mn dot mediaone dot net>
Well, here is why it can't be done in normal C as far as I can tell.
In the executable file there are actually 2 additional sections.
These contain tables that the system uses to determine how to build the
Objects and Interfaces in memory from.
The problem is syncing these between two files and also transposing size of
structures over to the sections.
The design is basically COM on steroids, I took things from both COM and
CORBA that I liked and made a new API and stuff that in theory a C/C++
library can be written around to hide much of the details. The only part
that it can't be written around is the definitions to create both special
header sections and the actual structures used by the code.
One of the reason I don't think that C++ can do it on its own is that the
structures store more than just a Vtbl, they have several SwCom specific
data structures in front of it which are hidden to the programmer but exist
to track the object, all interface instances, and other data that is related
to upkeep of the SwCom subsys and integrety of the system.
So, how about this:
Is there a way where I can pull the size of a structure from a OBJ file, if
the structure is not created statically?
That is, if the structure is atleast defined, does its size get stored into
the OBJ file so it can be externally referenced?
This would atleast solve one of my problems.
Another way of doing this is writing a program that allows me to script at
one point, and it can parse it and write the second file from it....not
exactly my favorite idea, I would rather a compiler have the built in
functionality.
If you could show me how to use templates to do this I would be very
thankful, as I have never actually used templates.
I somehow doubt though that templates would solve everything and thus some
sort of custom solution would be needed to make the custom output files.
-----Original Message-----
From: Mike Stump [mailto:mrs@windriver.com]
Sent: Monday, November 15, 1999 9:36 PM
To: danrg@mn.mediaone.net
Subject: RE: Adding platform extensions?
> From: "Dan Guisinger" <danrg@mn.mediaone.net>
> Date: Mon, 15 Nov 1999 20:13:09 -0600
> Its based off a COM/CORBA style object model.
There are lots of COM/DCOM/CORBA recreations out there, for both C and
C++. If you don't want to reinvent yet another wheel, you might try
using one of them. I don't see that you solved any additional
problems not already solved by them. I don't see why you think you
need to reinvent this wheel again.
> The work put into modifying GCC to do this from a single source
> would GREATLY simplify my work, along with the work others will do
> when I release a dev. version of my OS this winter.
> Any help, advice on how to continue, etc would be greatly
> appreciated.
I still don't see that C++ can do everything you need. You didn't use
the phrase, `I can't do this: <example> in C++' so I wasn't able to
figure out what feature it lacked.
Anyway, I think you want a COM/DCOM/CORBA or a C++ programming group
instead.
Remember, templates are turing complete at compile time. Are you sure
they can't do what you want?
I look at your code, and continue to see C++. :-)
Anyway, sounds like a fun project.