This is the mail archive of the fortran@gcc.gnu.org mailing list for the GNU Fortran project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch,fortran] Add -fdump-core option to coredump at library run-time errors (PR29649)


:ADDPATCH fortran:

Currently, when errors are detected in libgfortran, an error message is
shown; depending on the kind of error, it can be rather difficult to
find the place where the error occurred. And fiddling with the debugger
is also not easy (which symbol do you use for the break point?)

This patch adds the -fdump-core option, which causes libgfortran to
SIGQUIT itself (coredump).

This patch was extracted from Francois-Xavier's patch, posted at
http://gcc.gnu.org/ml/fortran/2006-11/msg00634.html
which also implemented backtracing.

The default setting is off. The setting can be changed both at compile
time (-fdump-core) and overwritten at run time via
the GFORTRAN_ERROR_DUMPCORE variable.

As set_std is modified, this makes the library incompatible with
previously compiled gfortran programs. One should thus either bump the
library version or consider to backport it to 4.2. (Suggestions?)

The initial patch was bootstrapped and regtested on x86_64-linux and
built and tested on sparc-solaris2.9 by FX.
This patch was bootstrapped and regtested by me on x86_64-linux.


Tobias
("configure" regenerated using autoconf 2.59 using --enable-maintainer-mode)


libgfortran/

2006-11-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
            Tobias Burnus  <burnus@net-b.de>

	PR fortran/29649
	* runtime/environ.c (variable_table): New GFORTRAN_ERROR_DUMPCORE
	  environment variable.
	* runtime/compile_options.c (set_std): Add new argument.
	* runtime/error.c (sys_exit): Move from io/unix.c. Add coredump functionality.
	* libgfortran.h (options_t): New dump_core and backtrace members.
	  (sys_exit): Move prototype.
	* io/unix.c (sys_exit): Move to runtime/error.c.
	* configure.ac: Add check for getrlimit.
	* configure: Regenerate.


fortran/
2006-11-24  Francois-Xavier Coudert  <coudert@clipper.ens.fr>
            Tobias Burnus  <burnus@net-b.de>

	PR fortran/29649
	* gfortran.h (gfc_option_t): Add flag_dump_core.
	* lang.opt: Add -fdump-core option.
	* invoke.texi: Document the new options.
	* trans-decl.c (gfc_build_builtin_function_decls): Add new
	  options to the call to set_std.
	* options.c (gfc_init_options, gfc_handle_option): Set the
	  new options.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]