Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* generating a core file
@ 2004-03-22 17:52 David Carlton
  2004-03-22 18:17 ` Kip Macy
  2004-03-22 19:17 ` David Carlton
  0 siblings, 2 replies; 6+ messages in thread
From: David Carlton @ 2004-03-22 17:52 UTC (permalink / raw)
  To: gdb

This is quite off-topic, but are there any programs out there that can
generate a core file from a stopped process, and write that core file
to a pipe or send it over the network somehow?  We're having issues
debugging seg faults on machines without local disks, and for various
reasons we'd rather not remotely mount disks on these machines,
either.

David Carlton
carlton@kealia.com


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

* Re: generating a core file
  2004-03-22 17:52 generating a core file David Carlton
@ 2004-03-22 18:17 ` Kip Macy
  2004-03-22 19:17 ` David Carlton
  1 sibling, 0 replies; 6+ messages in thread
From: Kip Macy @ 2004-03-22 18:17 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb

On solaris and BSD there is gcore. I assume such a thing can be found
for linux and that it can be modified to write the output to a socket
instead of a file.

I wrote a checkpoint/restore facility for a BSD a few months back, the
checkpointing part was just an extension to core dump with some extra
interfaces exported. If gcore won't do the trick you could add a
system call that would take a file descriptor and then pass that to the
core dump routine.


				-Kip

On Mon, 22 Mar 2004, David Carlton wrote:

> This is quite off-topic, but are there any programs out there that can
> generate a core file from a stopped process, and write that core file
> to a pipe or send it over the network somehow?  We're having issues
> debugging seg faults on machines without local disks, and for various
> reasons we'd rather not remotely mount disks on these machines,
> either.
>
> David Carlton
> carlton@kealia.com
>


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

* Re: generating a core file
  2004-03-22 17:52 generating a core file David Carlton
  2004-03-22 18:17 ` Kip Macy
@ 2004-03-22 19:17 ` David Carlton
  2004-03-22 20:59   ` Daniel Jacobowitz
  2004-03-23  9:55   ` Andrew Cagney
  1 sibling, 2 replies; 6+ messages in thread
From: David Carlton @ 2004-03-22 19:17 UTC (permalink / raw)
  To: gdb

On Mon, 22 Mar 2004 09:24:11 -0800, David Carlton <carlton@kealia.com> said:

> This is quite off-topic, but are there any programs out there that can
> generate a core file from a stopped process, and write that core file
> to a pipe or send it over the network somehow?

I guess it's not completely off-topic, actually; it might be nice if
there were a mention of generate-core-file in the GDB info pages.  I
just tried using that command together with a named pipe, but it
complained a lot about illegal seeks; is it inherently difficult to
generate a core file without random-access files?

David Carlton
carlton@kealia.com


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

* Re: generating a core file
  2004-03-22 19:17 ` David Carlton
@ 2004-03-22 20:59   ` Daniel Jacobowitz
  2004-03-23  1:27     ` Kip Macy
  2004-03-23  9:55   ` Andrew Cagney
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Jacobowitz @ 2004-03-22 20:59 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb

On Mon, Mar 22, 2004 at 09:48:11AM -0800, David Carlton wrote:
> On Mon, 22 Mar 2004 09:24:11 -0800, David Carlton <carlton@kealia.com> said:
> 
> > This is quite off-topic, but are there any programs out there that can
> > generate a core file from a stopped process, and write that core file
> > to a pipe or send it over the network somehow?
> 
> I guess it's not completely off-topic, actually; it might be nice if
> there were a mention of generate-core-file in the GDB info pages.  I

Indeed.  See also gdb/gcore.sh.

> just tried using that command together with a named pipe, but it
> complained a lot about illegal seeks; is it inherently difficult to
> generate a core file without random-access files?

Yes; it's certainly not insoluble but it would be very hard to make BFD
do it.  You'd have to build the ELF file in memory and then write it
out.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


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

* Re: generating a core file
  2004-03-22 20:59   ` Daniel Jacobowitz
@ 2004-03-23  1:27     ` Kip Macy
  0 siblings, 0 replies; 6+ messages in thread
From: Kip Macy @ 2004-03-23  1:27 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: David Carlton, gdb

IIRC FreeBSD does core dump in 2 passes. It iterates over all the
sections to figure out how many headers it needs, then it allocates
a corresponding amount of memory. It then fills out the headers, writes
out the headers, and then iterates through the VMAs writing them out.

This approach allows one to avoid seeks.


				-Kip


On Mon, 22 Mar 2004, Daniel Jacobowitz wrote:

> On Mon, Mar 22, 2004 at 09:48:11AM -0800, David Carlton wrote:
> > On Mon, 22 Mar 2004 09:24:11 -0800, David Carlton <carlton@kealia.com> said:
> >
> > > This is quite off-topic, but are there any programs out there that can
> > > generate a core file from a stopped process, and write that core file
> > > to a pipe or send it over the network somehow?
> >
> > I guess it's not completely off-topic, actually; it might be nice if
> > there were a mention of generate-core-file in the GDB info pages.  I
>
> Indeed.  See also gdb/gcore.sh.
>
> > just tried using that command together with a named pipe, but it
> > complained a lot about illegal seeks; is it inherently difficult to
> > generate a core file without random-access files?
>
> Yes; it's certainly not insoluble but it would be very hard to make BFD
> do it.  You'd have to build the ELF file in memory and then write it
> out.
>
> --
> Daniel Jacobowitz
> MontaVista Software                         Debian GNU/Linux Developer
>


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

* Re: generating a core file
  2004-03-22 19:17 ` David Carlton
  2004-03-22 20:59   ` Daniel Jacobowitz
@ 2004-03-23  9:55   ` Andrew Cagney
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Cagney @ 2004-03-23  9:55 UTC (permalink / raw)
  To: David Carlton; +Cc: gdb

> On Mon, 22 Mar 2004 09:24:11 -0800, David Carlton <carlton@kealia.com> said:
> 
> 
>>> This is quite off-topic, but are there any programs out there that can
>>> generate a core file from a stopped process, and write that core file
>>> to a pipe or send it over the network somehow?
> 
> 
> I guess it's not completely off-topic, actually; it might be nice if
> there were a mention of generate-core-file in the GDB info pages.  I
> just tried using that command together with a named pipe, but it
> complained a lot about illegal seeks; is it inherently difficult to
> generate a core file without random-access files?

What's needed to make gcore work with a remote target?

Andrew



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

end of thread, other threads:[~2004-03-22 19:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-22 17:52 generating a core file David Carlton
2004-03-22 18:17 ` Kip Macy
2004-03-22 19:17 ` David Carlton
2004-03-22 20:59   ` Daniel Jacobowitz
2004-03-23  1:27     ` Kip Macy
2004-03-23  9:55   ` Andrew Cagney

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