From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Robert Weiner Newsgroups: gmane.emacs.devel Subject: Need to get Lisp backtrace when error is in C code Date: Tue, 3 Oct 2017 12:43:20 -0400 Message-ID: Reply-To: rswgnu@gmail.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a113cccce2a07f1055aa73208" X-Trace: blaine.gmane.org 1507049045 30534 195.159.176.226 (3 Oct 2017 16:44:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 3 Oct 2017 16:44:05 +0000 (UTC) To: emacs-devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 03 18:44:00 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dzQIX-00071f-Hy for ged-emacs-devel@m.gmane.org; Tue, 03 Oct 2017 18:43:57 +0200 Original-Received: from localhost ([::1]:59492 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzQIe-0000hr-Vs for ged-emacs-devel@m.gmane.org; Tue, 03 Oct 2017 12:44:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44391) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzQIX-0000h7-C9 for emacs-devel@gnu.org; Tue, 03 Oct 2017 12:43:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dzQIS-000723-H9 for emacs-devel@gnu.org; Tue, 03 Oct 2017 12:43:57 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:36417) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dzQIS-00071k-Cq for emacs-devel@gnu.org; Tue, 03 Oct 2017 12:43:52 -0400 Original-Received: from mail-oi0-f48.google.com ([209.85.218.48]:52046) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1dzQIS-0001qZ-3O for emacs-devel@gnu.org; Tue, 03 Oct 2017 12:43:52 -0400 Original-Received: by mail-oi0-f48.google.com with SMTP id n82so15289368oib.8 for ; Tue, 03 Oct 2017 09:43:51 -0700 (PDT) X-Gm-Message-State: AMCzsaW1TCyi5X12VksLvTtpV2ACAkPLRF8/r82NdoMdfxn4Ges89roT dNX1lJfFfTb4fek3KfiAPRAdUYwIGuxoNlcV0IY= X-Google-Smtp-Source: AOwi7QAM0Wkoqm6GjdwhfujhP4BP1FVMOFFY2KCx0jl0DhXEz1nmVyDA9kWwzhMv1FW1Gt6VzaRQcvgs3owXaKuHDSY= X-Received: by 10.157.29.228 with SMTP id w33mr11049630otw.41.1507049031204; Tue, 03 Oct 2017 09:43:51 -0700 (PDT) Original-Received: by 10.157.86.251 with HTTP; Tue, 3 Oct 2017 09:43:20 -0700 (PDT) X-Gmail-Original-Message-ID: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219042 Archived-At: --001a113cccce2a07f1055aa73208 Content-Type: text/plain; charset="UTF-8" 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 --001a113cccce2a07f1055aa73208 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Every so often when using Emacs, I get an error from C code similar = to this:
=C2=A0 =C2=A0let: Wrong type argument: markerp, nil

which gives no indication of where the error is coming from.=C2=A0 I have = debug-on-error set to t.=C2=A0 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 tra= ce to the point of C function entry.=C2=A0=C2=A0But why can't I have something like this au= tomatically?

The C code is raising an erro= r.=C2=A0 The Lisp stack exists.=C2=A0 Why can't the C error routine for= ce the backtrace with some notion that the error exists further in C code?= =C2=A0 This would at least narrow down the cause of the error greatly by sh= owing a lot of the path in code taken.

Per= sonally, for errors like this, I would typically include the function name = reference so that the location is obvious and users without debug symbols i= n their Emacs could still report a more useful error.

Is this doable?=C2=A0 A good idea?

How do others debug such situations (no C debug symbols)?
=

Bob



--001a113cccce2a07f1055aa73208--