unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Need to get Lisp backtrace when error is in C code
@ 2017-10-03 16:43 Robert Weiner
  2017-10-03 17:01 ` Eli Zaretskii
  2017-10-03 17:50 ` Stefan Monnier
  0 siblings, 2 replies; 7+ messages in thread
From: Robert Weiner @ 2017-10-03 16:43 UTC (permalink / raw)
  To: emacs-devel

[-- 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 --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-10-04  3:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-10-03 16:43 Need to get Lisp backtrace when error is in C code Robert Weiner
2017-10-03 17:01 ` 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

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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).