Stack checking in GNAT (was: ada compiler?)
- From: Ludovic Brenta <ludovic@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 16 Nov 2007 10:41:47 +0100
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.
.
- Follow-Ups:
- Re: Stack checking in GNAT
- From: Robert A Duff
- Re: Stack checking in GNAT
- From: Samuel Tardieu
- Re: Stack checking in GNAT
- References:
- Re: ada compiler?
- From: anon
- Re: ada compiler?
- From: tmoran
- Re: ada compiler?
- From: anon
- Re: ada compiler?
- From: Jeffrey Creem
- Re: ada compiler?
- From: anon
- Re: ada compiler?
- From: Georg Bauhaus
- Re: ada compiler?
- From: Jeffrey R. Carter
- Re: ada compiler?
- From: Ludovic Brenta
- Re: ada compiler?
- From: Jacob Sparre Andersen
- Re: ada compiler?
- From: Georg Bauhaus
- Re: ada compiler?
- From: Ludovic Brenta
- Re: ada compiler?
- From: Georg Bauhaus
- Re: ada compiler?
- From: Ludovic Brenta
- Re: ada compiler?
- From: Georg Bauhaus
- Re: ada compiler?
- From: Ludovic Brenta
- Re: ada compiler?
- From: Samuel Tardieu
- Re: ada compiler?
- Prev by Date: Zip / Unzip from an Ada progam - which library ?
- Next by Date: Re: Zip / Unzip from an Ada progam - which library ?
- Previous by thread: Re: ada compiler?
- Next by thread: Re: Stack checking in GNAT
- Index(es):
Relevant Pages
|
|