comp.lang.ada
 help / color / mirror / Atom feed
From: Marin David Condic <condicma@bogon.pwfl.com>
Subject: Re: Function Calls by Address
Date: 1999/08/30
Date: 1999-08-30T00:00:00+00:00	[thread overview]
Message-ID: <37CAEF6C.197AA467@pwfl.com> (raw)
In-Reply-To: 37CAEA5C.11A23940@pwfl.com

Marin David Condic wrote:

> Craig Jameson wrote:
>
> > Does any one know how to make dynamic function calls in Ada83.

Ooops! I just noticed that you said Ada83. There is no easy way to do this
in Ada83. If you look in LRM 13.5, 13.7 and 13.7.2, you will note that there
is a way to get at the address to a subprogram. Jumping to that address is
likely something you'll have to do with machine instructions or other
implementation dependent ways because I don't think the Ada83 standard ever
specified a standardized way to use the address as a call or goto. If you're
handing off the address to a subsystem that wants to do callbacks, this will
also be very system dependent. Getting the parameter lists correct is
something with which you are entirely on your own. The thing you will need
to look at carefully is your compiler vendor's documentation to see how they
suggest using it. (If you post the compiler/target combo, someone may have
done this already.)

If you can get the 'Address to a subprogram and can figure out how to jump
to that address within the system you're in, it should be relatively easy to
dynamically build a list of the addresses you're interested in and jumping
to them.

An Ada feature that I think is underutilized is the ability to do machine
instruction insertions so that you can do the things normal programming
languages try to stop because they are unsafe or difficult to support. You
might look into machine code insertions as a solution to your problem.
Between the 'Address attribute and a little assembler code you ought to be
able to cobble together a nice isolated chunk of code that lets you do what
you want.

MDC
--
Marin David Condic
Real Time & Embedded Systems, Propulsion Systems Analysis
United Technologies, Pratt & Whitney, Large Military Engines
M/S 731-95, P.O.B. 109600, West Palm Beach, FL, 33410-9600
***To reply, remove "bogon" from the domain name.***

Visit my web page at: http://www.mcondic.com/






  parent reply	other threads:[~1999-08-30  0:00 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-08-30  0:00 Function Calls by Address Craig Jameson
1999-08-30  0:00 ` Robert Dewar
1999-08-30  0:00 ` Robert Dewar
1999-08-31  0:00   ` Martin Gangkofer
1999-08-30  0:00 ` Marin David Condic
1999-08-30  0:00   ` Robert Dewar
1999-08-30  0:00   ` Marin David Condic [this message]
1999-08-30  0:00     ` Larry Kilgallen
1999-08-31  0:00 ` David Kristola
1999-08-31  0:00 ` Matthew Heaney
1999-09-01  0:00 ` Simon Wright
1999-09-02  0:00 ` Francois Godme
1999-09-03  0:00   ` Robert Dewar
1999-09-03  0:00     ` Francois Godme
1999-09-03  0:00       ` Robert Dewar
1999-09-03  0:00         ` Ted Dennison
1999-09-04  0:00           ` Jean-Pierre Rosen
1999-09-05  0:00             ` Ehud Lamm
1999-09-05  0:00             ` Matthew Heaney
1999-09-04  0:00         ` Brian Rogoff
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-05  0:00           ` Robert Dewar
1999-09-03  0:00       ` Simon Wright
1999-09-03  0:00       ` David C. Hoos, Sr.
1999-09-04  0:00         ` Robert Dewar
1999-09-05  0:00           ` Francois Godme
1999-09-06  0:00             ` Robert Dewar
1999-09-06  0:00               ` Francois Godme
1999-09-06  0:00                 ` Robert Dewar
1999-09-06  0:00                   ` Bob Collins
1999-09-07  0:00                     ` Pascal Obry
1999-09-06  0:00                 ` Robert Dewar
1999-09-07  0:00                 ` Pascal Obry
1999-09-07  0:00                   ` Francois Godme
1999-09-08  0:00                   ` Francois Godme
1999-09-03  0:00       ` Marin David Condic
1999-09-14  0:00         ` Robert I. Eachus
     [not found]           ` <wcc3dwgb7ii.fsf@world.std.com>
     [not found]             ` <37E81079.CC2566D9@mitre.org>
1999-09-22  0:00               ` Robert A Duff
1999-09-22  0:00                 ` Robert I. Eachus
1999-09-23  0:00                 ` Robert Dewar
1999-09-23  0:00                   ` Robert A Duff
1999-09-04  0:00       ` Mario Klebsch
1999-09-05  0:00         ` Robert Dewar
1999-09-06  0:00           ` Francois Godme
1999-09-05  0:00             ` Brian Rogoff
1999-09-06  0:00             ` Robert Dewar
1999-09-08  0:00               ` Georg Bauhaus
1999-09-05  0:00       ` Geoff Bull
1999-09-07  0:00       ` Michael F. Yoder
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox