From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30227 invoked by alias); 23 Oct 2004 15:04:26 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30187 invoked from network); 23 Oct 2004 15:04:24 -0000 Received: from unknown (HELO legolas.inter.net.il) (192.114.186.24) by sourceware.org with SMTP; 23 Oct 2004 15:04:24 -0000 Received: from zaretski ([80.230.152.122]) by legolas.inter.net.il (MOS 3.5.3-GR) with ESMTP id CXU57962 (AUTH halo1); Sat, 23 Oct 2004 17:04:04 +0200 (IST) Date: Mon, 25 Oct 2004 09:27:00 -0000 From: "Eli Zaretskii" To: Michael Snyder Message-ID: <01c4b911$Blat.v2.2.2$0f0b5500@zahav.net.il> Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=ISO-8859-1 CC: cagney@gnu.org, cmarkle@sendmail.com, gdb@sources.redhat.com, gdb-patches@sources.redhat.com In-reply-to: <40F5B514.8070906@redhat.com> (message from Michael Snyder on Wed, 14 Jul 2004 22:35:00 +0000) Subject: Re: gcore or generate-core-file command? Reply-to: Eli Zaretskii References: <00df01c46715$ef7cbc80$0239a8c0@D4PS1621> <40F58CEB.9080308@gnu.org> <40F5B514.8070906@redhat.com> X-SW-Source: 2004-10/txt/msg00407.txt.bz2 I've committed the attached patch to document this command. 2004-10-23 Eli Zaretskii * gdb.texinfo (Core File Generation): New section. Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.221 diff -u -r1.221 gdb.texinfo --- gdb.texinfo 23 Oct 2004 14:34:53 -0000 1.221 +++ gdb.texinfo 23 Oct 2004 15:00:42 -0000 @@ -4780,6 +4780,7 @@ * Auxiliary Vector:: Auxiliary data provided by operating system * Memory Region Attributes:: Memory region attributes * Dump/Restore Files:: Copy between memory and a file +* Core File Generation:: Cause a program dump its core * Character Sets:: Debugging programs that use a different character set than GDB does @end menu @@ -6176,6 +6177,36 @@ @end table +@node Core File Generation +@section How to Produce a Core File from Your Program +@cindex dump core from inferior + +A @dfn{core file} or @dfn{core dump} is a file that records the memory +image of a running process and its process status (register values +etc.). Its primary use is post-mortem debugging of a program that +crashed while it ran outside a debugger. A program that crashes +automatically produces a core file, unless this feature is disabled by +the user. @xref{Files}, for information on invoking @value{GDBN} in +the post-mortem debugging mode. + +Occasionally, you may wish to produce a core file of the program you +are debugging in order to preserve a snapshot of its state. +@value{GDBN} has a special command for that. + +@table @code +@kindex gcore +@kindex generate-core-file +@item generate-core-file [@var{file}] +@itemx gcore [@var{file}] +Produce a core dump of the inferior process. The optional argument +@var{file} specifies the file name where to put the core dump. If not +specified, the file name defaults to @file{core.@var{pid}}, where +@var{pid} is the inferior process ID. + +Note that this command is implemented only for some systems (as of +this writing, @sc{gnu}/Linux, FreeBSD, Solaris, Unixware, and S390). +@end table + @node Character Sets @section Character Sets @cindex character sets