From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19821 invoked by alias); 20 Jul 2005 02:37:04 -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 19806 invoked by uid 22791); 20 Jul 2005 02:37:01 -0000 Received: from c-24-61-23-223.hsd1.ma.comcast.net (HELO cgf.cx) (24.61.23.223) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 20 Jul 2005 02:37:01 +0000 Received: by cgf.cx (Postfix, from userid 201) id C93C713C261; Tue, 19 Jul 2005 22:36:59 -0400 (EDT) Date: Wed, 20 Jul 2005 02:37:00 -0000 From: Christopher Faylor To: gdb@sources.redhat.com Subject: Re: gdb on cygwin and debugging assert() or program segmentation faults Message-ID: <20050720023659.GG26817@trixie.casa.cgf.cx> Mail-Followup-To: gdb@sources.redhat.com References: <42DDB33D.434A6CB2@dessent.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <42DDB33D.434A6CB2@dessent.net> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-07/txt/msg00205.txt.bz2 On Tue, Jul 19, 2005 at 07:13:17PM -0700, Brian Dessent wrote: >Kris Thielemans wrote: > >> I need to debug a C++ program that throws up an assert(). On Linux, I'm used to >> be able to run the program in gdb, and when the assert happens, the program >> stops (in the assert function) and I can do a back trace (e.g. info stack). >> On cygwin on the other hand, I just get the assert message, and then gdb >> says "Program exited normally". No backtrace possible. > >Set the error_start parameter of the CYGWIN variable to gdb and then run >the program, and you should gdb launched and attached to the process >when it encounters a SEGV or abort(). See the users manual section >about $CYGWIN. And, FWIW, gdb *does* do the right thing (i.e., the same thing as any UNIX system) when the program generates a genuine SIGSEGV. It just doesn't do anything for cygwin-specific signals like SIGABRT. It also won't stop if you do something like "kill (getpid (), SIGSEGV)" since that just sends a "cygwin signal". cgf