gdb core dump

Thomas Lumley thomas@biostat.washington.edu
Fri, 16 Oct 1998 08:36:55 -0700 (PDT)


On 16 Oct 1998, Peter Dalgaard BSA wrote:

> Paul Gilbert <pgilbert@bank-banque-canada.ca> writes:
> 
> > When I get a segmentation fault and core dump can I use gdb to examine the core
> > file and get any useful information about why and where things went wrong? Do I
> > need to compile R in a special way to do this? Obviously I'm a newbie at this.
> > Details would be appreciated.
> > 
> > Paul Gilbert
> 
> Just execute as
> 
> R -d gdb
> 
> (and type 'run')
> 

In order for this to be as useful as possible you should do it before 
	make install
so that gdb can find the source files and display them for you.

Also, compilers vary in how useful their optimised output is for
debugging. I find that the Sun compiler loses line number information when
optimisation is specified, and just keeps track of which function you are
in. gcc keeps line number information, which makes it better for debugging
purposes.

	-thomas



Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._