DMD flag -gs and -gx
Rene Zwanenburg via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri May 13 04:33:05 PDT 2016
On Friday, 13 May 2016 at 10:19:04 UTC, Nordlöw wrote:
> -gs always emit stack frame
IIRC, not emitting a stack frame is an optimization which
confuses debuggers. So I think this can be used to make optimized
builds a bit easier to debug.
> -gx add stack stomp code
After a function returns the stack normally still contains the
local variables of that function, but they can be overwritten at
any time (which is why it's unsafe to escape references to stack
variables from a function). Using this switch will cause the
compiler to overwrite the stack with bogus values before
returning, which will help with early detection of bugs like the
above. It can also be useful in security contexts where a
function operates on sensitive data.
More information about the Digitalmars-d-learn
mailing list