From: Robert Weiner <rsw@gnu.org>
To: emacs-devel <emacs-devel@gnu.org>
Subject: Need to get Lisp backtrace when error is in C code
Date: Tue, 3 Oct 2017 12:43:20 -0400 [thread overview]
Message-ID: <CA+OMD9jCE2W9Yg_mJwrLF7wuVzrdt0+UF4cMNHT-=ZQsPXE8vw@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1072 bytes --]
Every so often when using Emacs, I get an error from C code similar to this:
let: Wrong type argument: markerp, nil
which gives no indication of where the error is coming from. I have
debug-on-error set to t. I might not have Emacs built with debugging
symbols at times.
Were I to know the source of the error, I could set debug-on-entry to some
Lisp-exposed C function and get a Lisp stack trace to the point of C
function entry. But why can't I have something like this automatically?
The C code is raising an error. The Lisp stack exists. Why can't the C
error routine force the backtrace with some notion that the error exists
further in C code? This would at least narrow down the cause of the error
greatly by showing a lot of the path in code taken.
Personally, for errors like this, I would typically include the function
name reference so that the location is obvious and users without debug
symbols in their Emacs could still report a more useful error.
Is this doable? A good idea?
How do others debug such situations (no C debug symbols)?
Bob
[-- Attachment #2: Type: text/html, Size: 2691 bytes --]
next reply other threads:[~2017-10-03 16:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-03 16:43 Robert Weiner [this message]
2017-10-03 17:01 ` Need to get Lisp backtrace when error is in C code Eli Zaretskii
2017-10-03 17:50 ` Stefan Monnier
2017-10-03 18:02 ` Robert Weiner
2017-10-03 19:30 ` Stefan Monnier
2017-10-03 20:58 ` Robert Weiner
2017-10-04 3:25 ` Stefan Monnier
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CA+OMD9jCE2W9Yg_mJwrLF7wuVzrdt0+UF4cMNHT-=ZQsPXE8vw@mail.gmail.com' \
--to=rsw@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=rswgnu@gmail.com \
/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.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.