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.devel Subject: Re: Early backtrace. Date: Tue, 11 Jan 2022 11:36:32 +0000 Message-ID: References: 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="33008"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 11 12:39:26 2022 Return-path: Envelope-to: ged-emacs-devel@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 1n7FUs-0008Un-5W for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Jan 2022 12:39:26 +0100 Original-Received: from localhost ([::1]:56576 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n7FUr-0002NS-5h for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Jan 2022 06:39:25 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:57770) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n7FS9-0000G9-He for emacs-devel@gnu.org; Tue, 11 Jan 2022 06:36:43 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:48275 helo=mail.muc.de) by eggs.gnu.org with smtp (Exim 4.90_1) (envelope-from ) id 1n7FS7-0006ze-GK for emacs-devel@gnu.org; Tue, 11 Jan 2022 06:36:37 -0500 Original-Received: (qmail 12047 invoked by uid 3782); 11 Jan 2022 11:36:33 -0000 Original-Received: from acm.muc.de (p4fe1582c.dip0.t-ipconnect.de [79.225.88.44]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 11 Jan 2022 12:36:32 +0100 Original-Received: (qmail 4739 invoked by uid 1000); 11 Jan 2022 11:36:32 -0000 Content-Disposition: inline In-Reply-To: X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de Received-SPF: pass client-ip=193.149.48.1; envelope-from=acm@muc.de; helo=mail.muc.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:284592 Archived-At: Hello, Stefan. On Mon, Jan 10, 2022 at 16:54:16 -0500, Stefan Monnier wrote: > > So I came up with the following, which has no Lisp dependencies. That > > is, absolutely none. I have used it as the first Lisp file loaded, > > immediately before byte-run.el. > I have a similar hack here for the same reason ;-) > So a +1 from me (tho I'd recommend using the `debugger-` namespace > rather than `early-`). Thanks! Maybe `debug-early' and `backtrace-early' would do for the two functions? There isn't really a debugger- prefix that early in the bootstrap. > > So, how about including this file in Emacs, amending eval.c to use it if > > backtrace.el isn't yet avaiable? Comments and criticism are welcome. > I don't see any need for a change to `eval.c`. Just put the > (setq debugger #'early-debug) > and > (setq debugger #'debug) > at the appropriate places inside `loadup.el`. No, inside signal_or_quit, Vdebugger gets bound to Qdebug, so as to bypass the setting made in ERT. Also it is filtered out by checking for not being in dump or bootstrap. Instead, we should check Ffboundp (Qdebug) || Ffboundp (Qdebug_early). Not difficult to do. > Stefan -- Alan Mackenzie (Nuremberg, Germany).