This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB 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]

Re: generating a core file


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
>


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