Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* gcore or generate-core-file command?
@ 2004-07-11  7:08 Chris Markle
  2004-07-14 19:48 ` Andrew Cagney
  0 siblings, 1 reply; 4+ messages in thread
From: Chris Markle @ 2004-07-11  7:08 UTC (permalink / raw)
  To: gdb

Hi - I am currently using some moldy oldy versions of gdb that do not appear
to have a way to generate core files (yes I know I should upgrade). I get
the impression that newer gdb versions have a gcore (or generate-core-file?)
command. Is this the case or is this somehow limited to Linux or some subset
of platforms (my interest here is generating cores with gdb on Solaris).
I've looked in the gdb doc and can't find refs to this ability. Is this
possible? Which version of gdb did this shwo up in? Thx in advance. Chris


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcore or generate-core-file command?
  2004-07-11  7:08 gcore or generate-core-file command? Chris Markle
@ 2004-07-14 19:48 ` Andrew Cagney
  2004-07-14 23:01   ` Michael Snyder
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Cagney @ 2004-07-14 19:48 UTC (permalink / raw)
  To: Chris Markle, Michael Snyder; +Cc: gdb

> Hi - I am currently using some moldy oldy versions of gdb that do not appear
> to have a way to generate core files (yes I know I should upgrade). I get
> the impression that newer gdb versions have a gcore (or generate-core-file?)
> command. Is this the case or is this somehow limited to Linux or some subset
> of platforms (my interest here is generating cores with gdb on Solaris).
> I've looked in the gdb doc and can't find refs to this ability. Is this
> possible? Which version of gdb did this shwo up in? Thx in advance. Chris

The command "gcore" was added to GDB 5.2.  You're right though, it isn't 
doesn't appear to be documented.

Michael, was there any documentation for this command?

Andrew



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcore or generate-core-file command?
  2004-07-14 19:48 ` Andrew Cagney
@ 2004-07-14 23:01   ` Michael Snyder
  2004-10-25  9:27     ` Eli Zaretskii
  0 siblings, 1 reply; 4+ messages in thread
From: Michael Snyder @ 2004-07-14 23:01 UTC (permalink / raw)
  To: Andrew Cagney; +Cc: Chris Markle, gdb

Andrew Cagney wrote:
>> Hi - I am currently using some moldy oldy versions of gdb that do not 
>> appear
>> to have a way to generate core files (yes I know I should upgrade). I get
>> the impression that newer gdb versions have a gcore (or 
>> generate-core-file?)
>> command. Is this the case or is this somehow limited to Linux or some 
>> subset
>> of platforms (my interest here is generating cores with gdb on Solaris).
>> I've looked in the gdb doc and can't find refs to this ability. Is this
>> possible? Which version of gdb did this shwo up in? Thx in advance. Chris
> 
> 
> The command "gcore" was added to GDB 5.2.  You're right though, it isn't 
> doesn't appear to be documented.
> 
> Michael, was there any documentation for this command?

<scrounge scrounge>... Drat.  We had a conversation on gdb-patches
in January 2002, about what section of the manual they could go into.
That sort of trailed off without resolution, and I forgot to persue it.

There is of course the built-in help.

Yes, it does work on Solaris, and Linux, and Unixware.
And apparently bsd, and S390 (who knew?)

Chris, this is what the built-in help says:

(gdb) help gcore
Save a core file with the current state of the debugged process.
Argument is optional filename.  Default filename is 'core.<process_id>'.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: gcore or generate-core-file command?
  2004-07-14 23:01   ` Michael Snyder
@ 2004-10-25  9:27     ` Eli Zaretskii
  0 siblings, 0 replies; 4+ messages in thread
From: Eli Zaretskii @ 2004-10-25  9:27 UTC (permalink / raw)
  To: Michael Snyder; +Cc: cagney, cmarkle, gdb, gdb-patches

I've committed the attached patch to document this command.

2004-10-23  Eli Zaretskii  <eliz@gnu.org>

	* 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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2004-10-23 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-07-11  7:08 gcore or generate-core-file command? Chris Markle
2004-07-14 19:48 ` Andrew Cagney
2004-07-14 23:01   ` Michael Snyder
2004-10-25  9:27     ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox