unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Nicolas Richard <theonewiththeevillook@yahoo.fr>
To: Marcin Borkowski <mbork@wmi.amu.edu.pl>
Cc: Help Gnu Emacs mailing list <help-gnu-emacs@gnu.org>
Subject: Re: Debugger output: where to look for its explanation?
Date: Mon, 30 Mar 2015 09:00:07 +0200	[thread overview]
Message-ID: <87zj6vug08.fsf@yahoo.fr> (raw)
In-Reply-To: <874mp4iv1g.fsf@wmi.amu.edu.pl> (Marcin Borkowski's message of "Sun, 29 Mar 2015 00:03:55 +0100")

Marcin Borkowski <mbork@wmi.amu.edu.pl> 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.



      parent reply	other threads:[~2015-03-30  7:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-28 23:03 Debugger output: where to look for its explanation? Marcin Borkowski
2015-03-29  1:01 ` Drew Adams
2015-03-29 13:03   ` Marcin Borkowski
2015-03-30  7:00 ` Nicolas Richard [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zj6vug08.fsf@yahoo.fr \
    --to=theonewiththeevillook@yahoo.fr \
    --cc=help-gnu-emacs@gnu.org \
    --cc=mbork@wmi.amu.edu.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).