I am compiling some code using GNAT for VxWorks. The code has been
previously compiled using Apex for VxWorks.
I think under Apex there is a pragma to set the stack size for the main
program.
How do i do this under GNAT?
If i was writing pure VxWorks code, I think i can set the stack size in
the taskSpawn call?
However i am compiling exisitng high level Ada code and cross compiling
it. What techniques can i use at this level to set the stack size.
Examples, some linkers allow switches for stack size, eg windows where
gnatmake myprog -Wl,-stack_size, 0x40000, or for unix setenv
GNAT_STACK_LIMIT, it goes on....
Whats the best way to achieve this on VxWorks???
Stuart Clark
task type MY_TASK_TYPE;
for MY_TASK_TYPE'STORAGE_SIZE use 20000;
MY_TASK : MY_TASK_TYPE;
It will also keep your code portable as oppose to setting it directly
from vxworks.
Be aware that the 20000 above will not be the resulting stack size
there is an overhead- so the resultant stack size is approximately
19200.
Regards
For VxWorks, the stack size of your Ada main is the stack size of the
task that it was called in. Thus, if you call your main via taskSpawn,
it is the stack size specified in that call. If you don't want to
worry about having the specify the stack size for main, leave your main
as a null statement, and create a task that will act as your real main.
This way you can give it a stack size in a standard way, and your
actual main will not terminate until that task does.
REH
Do you know of any linker/binder options for VxWorks like the Windows
gnatmake my_prog -Wl,-stack_size,0x40000
i have seen a gnatbind option of -dnn[k|m] but that sets the default
task stack size, i assume this is for all tasks that dont have a pragma
storage_size().
Do you know if this also sets the main program, ie primary/environment
task???
please xcuse any "dumb" questions, i havent done a lot of VxWorks, and
not used gnat with VxWorks. I have done a little VxWorks but using
GreenHills.
You probalby know this but i found an option to adjust the stack size
in the debugger, ie
>set -wtx-task-stack-size .....
Once again thanks for the help.
You should ask in the comp.lang.ada group. There are a lot of smart people
there that know GNAT and they don't get upset about OS-specific questions.
REH