From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18120 invoked by alias); 22 Mar 2004 18:17:01 -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 18110 invoked from network); 22 Mar 2004 18:17:00 -0000 Received: from unknown (HELO demos.bsdclusters.com) (69.55.225.36) by sources.redhat.com with SMTP; 22 Mar 2004 18:17:00 -0000 Received: from demos.bsdclusters.com (demos [69.55.225.36]) by demos.bsdclusters.com (8.12.8p1/8.12.8) with ESMTP id i2MIGiqc020943; Mon, 22 Mar 2004 10:16:44 -0800 (PST) (envelope-from kmacy@fsmware.com) Received: from localhost (kmacy@localhost) by demos.bsdclusters.com (8.12.8p1/8.12.8/Submit) with ESMTP id i2MIGdNd020912; Mon, 22 Mar 2004 10:16:39 -0800 (PST) X-Authentication-Warning: demos.bsdclusters.com: kmacy owned process doing -bs Date: Tue, 23 Mar 2004 01:27:00 -0000 From: Kip Macy X-X-Sender: kmacy@demos.bsdclusters.com To: Daniel Jacobowitz cc: David Carlton , gdb Subject: Re: generating a core file In-Reply-To: <20040322175209.GA8274@nevyn.them.org> Message-ID: <20040322101031.X79960@demos.bsdclusters.com> References: <20040322175209.GA8274@nevyn.them.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-SW-Source: 2004-03/txt/msg00204.txt.bz2 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 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 >