From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#61847: debug-early-backtrace only works some of the time. Date: Wed, 1 Mar 2023 16:46:52 +0000 Message-ID: References: <83v8jkfz04.fsf@gnu.org> <83edq8fokr.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20265"; mail-complaints-to="usenet@ciao.gmane.io" Cc: monnier@iro.umontreal.ca, 61847@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Mar 01 17:47:20 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pXPbs-00050v-1H for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 01 Mar 2023 17:47:20 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pXPbc-00064Z-SL; Wed, 01 Mar 2023 11:47:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pXPbb-00064P-8H for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 11:47:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pXPba-0005ZW-W2 for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 11:47:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pXPba-0001tg-Eh for bug-gnu-emacs@gnu.org; Wed, 01 Mar 2023 11:47:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 01 Mar 2023 16:47:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61847 X-GNU-PR-Package: emacs Original-Received: via spool by 61847-submit@debbugs.gnu.org id=B61847.16776892217289 (code B ref 61847); Wed, 01 Mar 2023 16:47:02 +0000 Original-Received: (at 61847) by debbugs.gnu.org; 1 Mar 2023 16:47:01 +0000 Original-Received: from localhost ([127.0.0.1]:54774 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXPbZ-0001tR-C3 for submit@debbugs.gnu.org; Wed, 01 Mar 2023 11:47:01 -0500 Original-Received: from mx3.muc.de ([193.149.48.5]:13801) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pXPbX-0001tC-Ad for 61847@debbugs.gnu.org; Wed, 01 Mar 2023 11:47:00 -0500 Original-Received: (qmail 83783 invoked by uid 3782); 1 Mar 2023 17:46:53 +0100 Original-Received: from acm.muc.de (pd953ac29.dip0.t-ipconnect.de [217.83.172.41]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Wed, 01 Mar 2023 17:46:53 +0100 Original-Received: (qmail 27124 invoked by uid 1000); 1 Mar 2023 16:46:52 -0000 Content-Disposition: inline In-Reply-To: <83edq8fokr.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:257082 Archived-At: Hello, Eli. On Wed, Mar 01, 2023 at 18:01:24 +0200, Eli Zaretskii wrote: > > Date: Wed, 1 Mar 2023 15:22:29 +0000 > > Cc: monnier@iro.umontreal.ca, 61847@debbugs.gnu.org > > From: Alan Mackenzie > > > And what use is the meaningless stream of raw bytes that prin1 > > > produces? > > If that were indeed what was produced, none at all. Because > > debug-early-backtrace binds print-escape-control-characters to t, what > > actually gets produced is a mixture of ascii characters and octal > > escaped representations, just like you see when an .elc file is visited > > in Emacs. > Escaping raw bytes doesn't make them more comprehensible. It does, if they contain control characters which would otherwise corrupt the screen. > > > I think you should re-evaluate your preferences, and base them on real > > > advantages and disadvantages, not on imaginary ones. > > What makes you think I'm not doing this already? I wrote debug-early > > last year because I _needed_ it. I've a lot of experience using it, and > > the way it prints (or rather used to print) a compiled function is/was > > useful. > For you, maybe. Not for me. For me it's a nuisance. A useless waste > of screen estate. Yes, for me, and lots of other people too. Byte code is very compact, and we're talking about a very few lines of screen "wasted". > > You can see how many arguments it takes. > That information exists elsewhere. You're misunderstanding the situation. You see a lambda form represented in a backtrace, you don't know which lambda form it is. There are over 8,000 of them in Emacs. Knowing the number of arguments helps identify _which_ lambda form it is. > > You can see the byte code string, hence enabling you to compare it > > visually with the contents of a .elc file, should such already > > exist. > Let's be serious, okay? I'm being perfectly serious. I've done this. It enabled me to be sure that I'd identified the lambda form in question, removing the doubt. > > > If we want our backtraces to be more informative, not less, we > > > should move farther away of "dumb" output functions that just spill > > > the guts and towards more humanly-readable formatted description of > > > the called functions. > > A wholesome long term goal I fully agree with. For the here and now, > > outputting "#f(compiled-function () " and nothing > > else is not a step in that direction. > But using cl-prin1 _is_ a step in the right direction, because it > allows us to extend the feature. Well then, let's get cl-prin1 up to the state where it is better than bare prin1. As I keep saying cl-prin1 is useless for printing compiled lambda forms at the moment. > And that is why I said that if loading Lisp breaks something in > debug-early, we should solve this _now_, not fall back on prin1, which > by its very nature cannot be extended so easily. That it cannot be extended easily is not a disadvantage. It means there is always a dependable debug-early-backtrace. The attempt to load cl-prin1 into debug-early is precisely what caused this bug. > > Besides, the idea of debug-early is to generate a backtrace before all > > the fancy Lisp facilities are available. > Some fancy Lisp facilities are already available anyway. And I see no > reason for this requirement in this case. In a situation where Emacs does not bootstrap, instead crashing during the loading or compiling of the Lisp files, we need a debugging tool which isn't dependent upon those Lisp files. That is what debug-early.el is intended to be. -- Alan Mackenzie (Nuremberg, Germany).