From 868d75dbdc33cfb040fcd93d0f525ab70eb43491 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Coudert Date: Thu, 15 Mar 2007 13:39:47 +0100 Subject: gfortran.h (gfc_option_t): Add flag_backtrace field. * gfortran.h (gfc_option_t): Add flag_backtrace field. * lang.opt: Add -fbacktrace option. * invoke.texi: Document the new option. * trans-decl.c (gfc_build_builtin_function_decls): Add new option to the call to set_std. * options.c (gfc_init_options, gfc_handle_option): Handle the new option. * runtime/backtrace.c: New file. * runtime/environ.c (variable_table): New GFORTRAN_ERROR_BACKTRACE environment variable. * runtime/compile_options.c (set_std): Add new argument. * runtime/main.c (store_exe_path, full_exe_path): New functions. * runtime/error.c (sys_exit): Add call to show_backtrace. * libgfortran.h (options_t): New backtrace field. (store_exe_path, full_exe_path, show_backtrace): New prototypes. * configure.ac: Add checks for execinfo.h, execvp, pipe, dup2, close, fdopen, strcasestr, getrlimit, backtrace, backtrace_symbols and getppid. * Makefile.am: Add runtime/backtrace.c. * fmain.c (main): Add call to store_exe_path. * Makefile.in: Renegerate. * config.h.in: Renegerate. * configure: Regenerate. From-SVN: r122954 --- libgfortran/libgfortran.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'libgfortran/libgfortran.h') diff --git a/libgfortran/libgfortran.h b/libgfortran/libgfortran.h index 80698e9..3703949 100644 --- a/libgfortran/libgfortran.h +++ b/libgfortran/libgfortran.h @@ -361,7 +361,7 @@ typedef struct int fpu_round, fpu_precision, fpe; int sighup, sigint; - int dump_core; + int dump_core, backtrace; } options_t; @@ -378,6 +378,7 @@ typedef struct int pedantic; int convert; int dump_core; + int backtrace; size_t record_marker; int max_subrecord_length; } @@ -550,6 +551,17 @@ export_proto(set_args); extern void get_args (int *, char ***); internal_proto(get_args); +extern void store_exe_path (const char *); +export_proto(store_exe_path); + +extern char * full_exe_path (void); +internal_proto(full_exe_path); + +/* backtrace.c */ + +extern void show_backtrace (void); +internal_proto(show_backtrace); + /* error.c */ #define GFC_ITOA_BUF_SIZE (sizeof (GFC_INTEGER_LARGEST) * 3 + 2) -- cgit v1.1