From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,6c7dea22b75ba442 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feed.tweaknews.nl!not-for-mail From: Ludovic Brenta Newsgroups: comp.lang.ada Subject: Stack checking in GNAT (was: ada compiler?) References: <1194747665.6151.31.camel@K72> <_evZi.177931$Xa3.50640@attbi_s22> <87hcjq46t4.fsf@ludovic-brenta.org> <473abc9d$0$13104$9b4e6d93@newsspool2.arcor-online.net> <1195035988.599522.87580@50g2000hsm.googlegroups.com> <1195043147.1007.263.camel@kartoffel> <1195052954.315227.220840@o3g2000hsb.googlegroups.com> <1195056238.1007.317.camel@kartoffel> <1195058211.682783.288340@d55g2000hsg.googlegroups.com> <87pryb2e2k.fsf@willow.rfc1149.net> Date: Fri, 16 Nov 2007 10:41:47 +0100 Message-ID: <87tznm1q90.fsf_-_@ludovic-brenta.org> User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:4VCIgHppJgY/xMmo7vrymAVWCX8= MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Organization: Tele2 X-Trace: DXC=VOA_einIC>5KLGTUV1Yi656`Y6aWje^Y:]6Y8loTRQS51B4<]HH1:n3`3lK=0G:Ug76l[@j:7Qo17 Xref: g2news1.google.com comp.lang.ada:18432 Date: 2007-11-16T10:41:47+01:00 List-Id: Samuel Tardieu writes: > You have two ways of doing stack checking: > > 1- at the GCC level by checking the stack at the entry of every > subprogram and comparing it to a thread/task specific marker; this > is costly > > 2- at the OS level by mapping a page after the stack which does not > allow either reads or writes to the page (or, when this is not > possible, which doesn't allow writes) [detailed explanation] > Does that answer your question? Yes, thank you very much. It seems that I can enable or disable stack checking, and select from the two methods above, by patching some flags in System and Targparm. In System: Stack_Check_Default : constant Boolean := False; Stack_Check_Probes : constant Boolean := False; Stack_Check_Default is True only on VMS. Stack_Check_Probes is True only on VMS, IRIX, MinGW, Solaris and Tru64 Unix (it depends on the OS, not the processor). And in Targparm.ads: Stack_Check_Probes_On_Target : Boolean := False; -- Indicates if stack check probes are used, as opposed to the standard -- target independent comparison method. (the "stack check probes" are method 2, the "standard target independent comparison method" is method 1) Stack_Check_Default_On_Target : Boolean := False; -- Indicates if stack checking is on by default I don't understand the difference between the flags in System and those in Targparm (i.e. why are there two sets of flags, and what happens if their values are different?). Also I am curious to know what would be the effect of changing these flags in Debian. Can you help? -- Ludovic Brenta.