From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Nicolas Richard Newsgroups: gmane.emacs.help Subject: Re: Debugger output: where to look for its explanation? Date: Mon, 30 Mar 2015 09:00:07 +0200 Message-ID: <87zj6vug08.fsf@yahoo.fr> References: <874mp4iv1g.fsf@wmi.amu.edu.pl> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1427698775 10882 80.91.229.3 (30 Mar 2015 06:59:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Mar 2015 06:59:35 +0000 (UTC) Cc: Help Gnu Emacs mailing list To: Marcin Borkowski Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Mar 30 08:59:27 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YcTfJ-0004LT-Ru for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Mar 2015 08:59:18 +0200 Original-Received: from localhost ([::1]:59720 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcTfI-0001tG-Sw for geh-help-gnu-emacs@m.gmane.org; Mon, 30 Mar 2015 02:59:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59472) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcTf5-0001t9-Sm for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 02:59:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YcTf2-0003Th-Jy for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 02:59:03 -0400 Original-Received: from mxin.ulb.ac.be ([164.15.128.112]:44663) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YcTf2-0003TX-Dy for help-gnu-emacs@gnu.org; Mon, 30 Mar 2015 02:59:00 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArkEAI/zGFWkD4Xx/2dsb2JhbABcDoQmgkWvSAaZEQKBdwEBAQEBAX2EFQEEASdSBQsIAw4TJQ8BBEkTiBoBDAiyapBEAYYhAQEBBwEBAQEehg+CM4JnhHgHhC0BBIYalDaGeI09IoMxPzwxgkMBAQE Original-Received: from mathsrv4.ulb.ac.be (HELO localhost) ([164.15.133.241]) by smtp.ulb.ac.be with ESMTP; 30 Mar 2015 08:58:58 +0200 In-Reply-To: <874mp4iv1g.fsf@wmi.amu.edu.pl> (Marcin Borkowski's message of "Sun, 29 Mar 2015 00:03:55 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 164.15.128.112 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:103441 Archived-At: Marcin Borkowski writes: > Hi all, > > so I got this as a *Backtrace*: > > --8<---------------cut here---------------start------------->8--- > Debugger entered--Lisp error: (scan-error "Containing expression ends prematurely" 2959 2959) > scan-sexps(2980 -3) > forward-sexp(-3) > backward-sexp(3) > (let ((beg-string (nth 8 (syntax-ppss))) (current-line (line-number-at-pos))) (goto-char beg-string) (backward-sexp 3) (if (and (member (symbol-at-point) symbols-with-docstrings) (looking-back "^(")) (progn (goto-char beg-string) (forward-sexp) (or (> (line-number-at-pos) current-line) (is-current-line-comment-only-p))))) > (if (and (eq major-mode (quote emacs-lisp-mode)) (nth 3 (syntax-ppss))) (let ((beg-string (nth 8 (syntax-ppss))) (current-line (line-number-at-pos))) (goto-char beg-string) (backward-sexp 3) (if (and (member (symbol-at-point) symbols-with-docstrings) (looking-back "^(")) (progn (goto-char beg-string) (forward-sexp) (or (> (line-number-at-pos) current-line) (is-current-line-comment-only-p)))))) > (save-excursion (skip-syntax-forward "\"-") (if (and (eq major-mode (quote emacs-lisp-mode)) (nth 3 (syntax-ppss))) (let ((beg-string (nth 8 (syntax-ppss))) (current-line (line-number-at-pos))) (goto-char beg-string) (backward-sexp 3) (if (and (member (symbol-at-point) symbols-with-docstrings) (looking-back "^(")) (progn (goto-char beg-string) (forward-sexp) (or (> (line-number-at-pos) current-line) (is-current-line-comment-only-p))))))) > is-current-line-docstring-p() > eval((is-current-line-docstring-p) nil) > eval-expression((is-current-line-docstring-p) nil) > funcall-interactively(eval-expression (is-current-line-docstring-p) nil) > call-interactively(eval-expression nil nil) > command-execute(eval-expression) > --8<---------------cut here---------------end--------------->8--- The following descriptions is from my experience, not from the source, but I'm fairly confident it is right (modulo me not being able to express myself correctly) : - The first line is a special one: it shows you which error was thrown. Look into the source code, it happens in scan_lists (a C function) : xsignal3 (Qscan_error, build_string ("Containing expression ends prematurely"), make_number (last_good), make_number (from)); This also tells you the meaning of the numbers. - Each line below that one is "something" that was evaluated by emacs, with the latest at the top (second line). A line that begins with a symbol means a function call, and if it begins with an opening paren it's evaluation of a form. - Most lines are of the "function call" kind when you run byte-compiled code. When the code was evalled from the source file, you get to see more of the "evaluated form" kind (they represent the steps between function calls). - In each "function call" kind, you see the name of the function and the value of its arguments. - In the "evaluated form" kind of line, you can see precisely which form was called, which allows you to follow the execution path. E.g. above is-current-line-docstring-p, you see a (save-excursion ...) form which corresponds to the definition of that function. The line above that one is an (if ...), precisely the one that's in the save-excursion. etc. Btw that buffer is more than just a backtrace : you're in a debugger where you can e.g. eval things in the context (with `e'). See C-h m as usual. HTH, Nicolas.