From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jason Rumney Newsgroups: gmane.emacs.devel Subject: Re: Crashes on w32 and debugging Date: Thu, 28 Feb 2008 08:57:25 +0000 Message-ID: <47C67775.8060906@gnu.org> References: <47C6713B.6030309@gmail.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1204189082 2774 80.91.229.12 (28 Feb 2008 08:58:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Feb 2008 08:58:02 +0000 (UTC) Cc: Emacs Devel To: "Lennart Borgman (gmail)" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 28 09:58:27 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JUear-0004Ha-QN for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 09:58:22 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUeaL-0008KI-5g for ged-emacs-devel@m.gmane.org; Thu, 28 Feb 2008 03:57:49 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JUea3-0008C0-Jz for emacs-devel@gnu.org; Thu, 28 Feb 2008 03:57:31 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JUea2-0008BC-0g for emacs-devel@gnu.org; Thu, 28 Feb 2008 03:57:31 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JUea1-0008B2-Qd for emacs-devel@gnu.org; Thu, 28 Feb 2008 03:57:29 -0500 Original-Received: from mk-outboundfilter-4.mail.uk.tiscali.com ([212.74.114.32]) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1JUea1-0001rb-ED for emacs-devel@gnu.org; Thu, 28 Feb 2008 03:57:29 -0500 Original-X-Trace: 15326121/mk-outboundfilter-2.mail.uk.tiscali.com/F2S/$ACCEPTED/freedom2Surf-customers/83.67.23.108 X-SBRS: None X-RemoteIP: 83.67.23.108 X-IP-MAIL-FROM: jasonr@gnu.org X-IP-BHB: Once X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgAAABMGxkdTQxds/2dsb2JhbAAIrgU X-IronPort-AV: E=McAfee;i="5200,2160,5240"; a="15326121" X-IronPort-AV: E=Sophos;i="4.25,418,1199664000"; d="scan'208";a="15326121" X-IP-Direction: OUT Original-Received: from i-83-67-23-108.freedom2surf.net (HELO [127.0.0.1]) ([83.67.23.108]) by smtp.f2s.tiscali.co.uk with ESMTP/TLS/DHE-RSA-AES256-SHA; 28 Feb 2008 08:57:27 +0000 User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) In-Reply-To: <47C6713B.6030309@gmail.com> X-detected-kernel: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:90708 Archived-At: Lennart Borgman (gmail) wrote: > I looked in the documentation for how to start Emacs under gdb, but I > can't find anything about it in nt/INSTALL. 1. Rebuild emacs after configure --no-opt (with optimisations on, stepping through the code doesn't always act as you expect it, and some variables cannot be inspected). 2. cd ${emacs}/src (where ${emacs} is your checkout directory). This serves two purposes - it makes it easy for gdb to find the emacs sources, and it also loads the .gdbinit in that directory, which defines some useful functions for looking at Lisp variables and backtraces. 3. gdb oo/i386/emacs.exe 4. Set any breakpoints using "break function_name" or "break file.c:linenumber" 5. run -Q 6. After the breakpoint is hit, step over functions with "next"/"n", or step in with "step"/"s". Inspect C variables with "print VARIABLE", if it is a lisp variable, "pr" immediately after the print will print its lisp value. "bt" will get a backtrace, including the Lisp backtrace as well as C.