================ @@ -100,6 +100,31 @@ treated as big-endian for both input and output, while units 26 and 27 will be treated as little-endian for both input and output. +## `FLANG_ERROR_BACKTRACE` + +Controls the stack trace printed for a fatal runtime error, an `ERROR STOP` +statement, the `ABORT` extension, or a deadly signal such as `SIGSEGV` or +`SIGFPE`. A normal `STOP` statement does not print a trace. +`CALL BACKTRACE()` always prints one, whether or not this variable disables +the others. + +The value must be `0` or `1`. `1` enables the trace and `0` disables it. +Any other value is ignored. When the variable is unset, the trace is enabled. + +`-fbacktrace` is the compiler default and does not set the variable. +`-fno-backtrace` sets `FLANG_ERROR_BACKTRACE=0` only when the variable is not +already set, so a value in the environment wins over the option. The option +takes effect only for the file that contains the main program, because the +compiler sets the variable from the main program's startup code. Programs ---------------- tarunprabhu wrote:
This documentation is intended for end-users. I don't think referring to "main program's startup code" would make sense to anyone who is not familiar with how Fortran programs are code-gen'ed. If you want to leave a note for developers, you could consider adding a design document describing how the backtrace support works in Flang. https://github.com/llvm/llvm-project/pull/241967 _______________________________________________ cfe-commits mailing list [email protected] https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
