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