* PLEASE HELP ME @ 1998-10-21 0:00 DENIS 1998-10-22 0:00 ` Tucker Taft 0 siblings, 1 reply; 5+ messages in thread From: DENIS @ 1998-10-21 0:00 UTC (permalink / raw) Please , I do not have any clue in Ada95, but I do have to know how to determine the order parameters are put on the stack. Please write as soons is possible. This is my email : datodia@hotmail.com ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: PLEASE HELP ME 1998-10-21 0:00 PLEASE HELP ME DENIS @ 1998-10-22 0:00 ` Tucker Taft 0 siblings, 0 replies; 5+ messages in thread From: Tucker Taft @ 1998-10-22 0:00 UTC (permalink / raw) DENIS (denis23@ix.netcom.com) wrote: : Please , I do not have any clue in Ada95, but I do have to know how to : determine the order parameters are put on the stack. : Please write as soons is possible. This is implementation-dependent. Perhaps it would be in the documentation provided by the Ada vendor, in the area of interfacing with assembly language. Furthermore, note that these days, not all parameters are passed on the stack. For most RISC machines, at least a few parameters are passed in registers. You could write your own test case using 'Address which might tell you something. E.g.: with system.storage_elements; use system.storage_elements; with ada.text_io; use ada.text_io; procedure stack_order is procedure p(A, B, C, D, E, F, G, H, I, J : Integer) is begin put_line("A'address = " & Integer_Address'Image(To_Integer(A'Address))); put_line("B'address = " & Integer_Address'Image(To_Integer(B'Address))); put_line("C'address = " & Integer_Address'Image(To_Integer(C'Address))); ... end p; begin p(1,2,3,4,5,6,7,8,9,10); end stack_order; : This is my email : datodia@hotmail.com -- -Tucker Taft stt@inmet.com http://www.inmet.com/~stt/ Intermetrics, Inc. Burlington, MA USA An AverStar Company ^ permalink raw reply [flat|nested] 5+ messages in thread
* STORAGE_ERROR : EXCEPTION_STACK_OVERFLOW @ 2005-08-05 0:55 Adaddict 2005-08-06 11:21 ` How to set the stack size on GNAT (Follow-up) Adaddict 0 siblings, 1 reply; 5+ messages in thread From: Adaddict @ 2005-08-05 0:55 UTC (permalink / raw) Greetings, I'm doing a small program that uses a search function. That search function compares a given string with the strings returned by a second function until that second function can't return another string. During the execution of that search I get that error. Does anyone know what causes it and how could I solve it? P.S: Using GNAT 3.15p on AdaGIDE to develop a Win32 app. ^ permalink raw reply [flat|nested] 5+ messages in thread
* How to set the stack size on GNAT (Follow-up) 2005-08-05 0:55 STORAGE_ERROR : EXCEPTION_STACK_OVERFLOW Adaddict @ 2005-08-06 11:21 ` Adaddict 2005-08-07 12:33 ` Please, help me Adaddict 0 siblings, 1 reply; 5+ messages in thread From: Adaddict @ 2005-08-06 11:21 UTC (permalink / raw) Ok, I read the posts below talking about this error and they all menction about setting the stack size. They menction different ways to do it: 1. package Linker is for Default_Switches ("ada") use ("-g", "-Xlinker stack=0x10000000,0x10000000"); end Linker; 2. -Xlstack= 10485760 3. --Xlinker --stack=4000000,4000000 4. $ gnatlink hello -Xlinker --stack=0x10000,0x1000 5. $ gnatlink hello -Wl,--stack=0x1000000 Creating the linker package (1) I was getting a compilation error with it ("missing use"). Using the other 4 ways in the command prompt by writing gnatlink <my main program filename here> and the 4 other options I was getting the message "gnatlink: Failed to open binder output". Could anyone tell me what am I doing wrong and what should I write exactly? Thank you everyone. Forgive me for such a newbie question. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Please, help me. 2005-08-06 11:21 ` How to set the stack size on GNAT (Follow-up) Adaddict @ 2005-08-07 12:33 ` Adaddict 2005-08-07 14:11 ` Jeff Creem 0 siblings, 1 reply; 5+ messages in thread From: Adaddict @ 2005-08-07 12:33 UTC (permalink / raw) I know this questions must seem stupid (I'm sure they really are), but I'm getting desesperated because I'm not getting those ways of setting the stack size to work. Sorry for being a nuisance. Regards. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Please, help me. 2005-08-07 12:33 ` Please, help me Adaddict @ 2005-08-07 14:11 ` Jeff Creem 2005-08-07 15:16 ` Ludovic Brenta 0 siblings, 1 reply; 5+ messages in thread From: Jeff Creem @ 2005-08-07 14:11 UTC (permalink / raw) Adaddict wrote: > I know this questions must seem stupid (I'm sure they really are), but I'm > getting desesperated because I'm not getting those ways of setting the > stack size to work. > > Sorry for being a nuisance. > > Regards. > I've always tried to find ways of avoiding having the main task require a large stack. On some OSs, there is no good way to do it at link time at all. Is there any way you can restructure your code so you don't need a large stack (e.g. If there is a set of large variables within the procedure blah is large variables begin end; then moving all of the large variables to a package spec that the procedure blah withs will reduce the stack space. If it is the sum of lots of littler things through the program then perhaps using the storage_size attribute on a new task that does all of the real work of the program (with the main thread just terminating) will work. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Please, help me. 2005-08-07 14:11 ` Jeff Creem @ 2005-08-07 15:16 ` Ludovic Brenta 0 siblings, 0 replies; 5+ messages in thread From: Ludovic Brenta @ 2005-08-07 15:16 UTC (permalink / raw) Jeff Creem <jcreem@yahoo.com> writes: [...] > If there is a set of large variables within the > > procedure blah is > large variables > > begin > > end; > > then moving all of the large variables to a package spec that the > procedure blah withs will reduce the stack space. > > If it is the sum of lots of littler things through the program then > perhaps using the storage_size attribute on a new task that does all > of the real work of the program (with the main thread just > terminating) will work. I have observed that array or record aggregates tend to be allocated on the stack, too. Array aggregates are particularly surprising since they're easy to replace with loops. For example: procedure Proc is type T is array (1 .. 100_000) of Integer; A : T; begin A := (others => 42); end Proc; allocates two large arrays on the stack (A and the aggregate) with some compilers I've used. In contrast: procedure Proc is type T is array (1 .. 100_000) of Integer; A : T; begin for J in A'Range loop A (J) := 42; end loop; end Proc; allocates just one array on the stack. Back on topic, setting the stack size depends on the target operating system and on the host linker. There are even situations where it is not possible to set the stack size at all. -- Ludovic Brenta. ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-08-07 15:16 UTC | newest] Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 1998-10-21 0:00 PLEASE HELP ME DENIS 1998-10-22 0:00 ` Tucker Taft -- strict thread matches above, loose matches on Subject: below -- 2005-08-05 0:55 STORAGE_ERROR : EXCEPTION_STACK_OVERFLOW Adaddict 2005-08-06 11:21 ` How to set the stack size on GNAT (Follow-up) Adaddict 2005-08-07 12:33 ` Please, help me Adaddict 2005-08-07 14:11 ` Jeff Creem 2005-08-07 15:16 ` Ludovic Brenta
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox