[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::ada

Title:DEC Ada
Notice:Ada is no longer a trademark of the US Government
Moderator:KMOOSE::CMCCUTCHEON
Created:Mon Jan 27 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3874
Total number of notes:16668

3845.0. "How can I know the stack in use in a task at run time." by AUBER::LORENZO (Philippe LORENZO: EVRY FRANCE TSSC Ultrix) Wed Feb 19 1997 05:18

    Hi,

    Using the GET_TASK_INFO package, I know how to obtain the current task's
    stack size, whith
        TOP := GET_TASK_INFO.GET_CURRENT_TASK_STACK_TOP;
        BAS := GET_TASK_INFO.GET_CURRENT_TASK_STACK_BASE;
        SIZ := BAS - TOP;

    This value is the same as shown with ada_debug> show -f 4

    But I don't know how to obtain the current "Stack in use:" ?

    Running DEC ADA.V3.3 on an Unix V4.0A system.

    Thanks for help.

Philippe.
T.RTitleUserPersonal
Name
DateLines
3845.1use the CMA interfaceFLOYD::YODERMFYFri Feb 21 1997 10:368
There doesn't seem to be a routine in the PAL for this.  An unsupported method
is to use pragma Interface(C, ...) to get at the CMA routines directly--this is
unsupported because, in theory, we might someday rewrite the RTL to use the
POSIX interface rather than CMA.  That is unlikely, but it is an option we will
(probably) never officially give up.

If you use this, be aware that passive tasks in effect borrow the stacks of
their callers (there isn't always a 1-1 map from tasks to stacks).
3845.2correctionFLOYD::YODERMFYFri Feb 21 1997 10:594
I have just realized that the advice in .1 is probably bad... there shouldn't be
any reason you can't use the POSIX interface rather than the CMA interface for
this particular operation.  The CMA interface is just layered on it, and using
the POSIX interface would keep working if we recoded the Ada RTL.