From owner-freebsd-hackers@FreeBSD.ORG Thu Dec 7 11:22:31 2006 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id C301316A4FB for ; Thu, 7 Dec 2006 11:22:31 +0000 (UTC) (envelope-from xfb52@dial.pipex.com) Received: from smtp-out4.blueyonder.co.uk (smtp-out4.blueyonder.co.uk [195.188.213.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4953743E9A for ; Thu, 7 Dec 2006 11:16:47 +0000 (GMT) (envelope-from xfb52@dial.pipex.com) Received: from [172.23.170.147] (helo=anti-virus03-10) by smtp-out4.blueyonder.co.uk with smtp (Exim 4.52) id 1GsHFx-0000CL-Bi; Thu, 07 Dec 2006 11:17:37 +0000 Received: from [82.41.32.99] (helo=[192.168.0.2]) by asmtp-out5.blueyonder.co.uk with esmtp (Exim 4.52) id 1GsHFw-0003Dh-Pj; Thu, 07 Dec 2006 11:17:36 +0000 Message-ID: <4577F850.3080707@dial.pipex.com> Date: Thu, 07 Dec 2006 11:17:36 +0000 From: Alex Zbyslaw User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-GB; rv:1.7.13) Gecko/20061205 X-Accept-Language: en MIME-Version: 1.0 To: Garrett Cooper References: <457713C8.6020204@u.washington.edu> <45771F7D.8070006@gmail.com> In-Reply-To: <45771F7D.8070006@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-hackers@freebsd.org Subject: Re: Forcing C program to core dump X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Dec 2006 11:22:31 -0000 Niclas Zeising wrote: > Garrett Cooper wrote: > >> Hello, >> This may be obvious to some, but after some Googling (apparently >> with the wrong search terms, perhaps) and reading the gcc/gdb >> manpages, I can't seem to find out how to get a program to produce >> core dumps. >> So I was wondering, is there some simple means to produce core >> dumps or a set of conditions that I need to adhere to in order to get >> the OS to core dump the progrdam??? >> Thanks, >> -Garrett > > > Just kill it with the abort signal (SIGABRT) or some other signal that > makes the program dump core. Be aware though that if you are catching > or ignoring the signal, this won't work. > Regards! > //Niclas Which usually defaults to ctl-\ from the shell so it's easy to kill a foreground program with bothering to find process id's etc. OK, not what you actually wanted to do, but for completeness :-) --Alex