emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH]: Re: Early backtrace.


From: Alan Mackenzie
Subject: Re: [PATCH]: Re: Early backtrace.
Date: Tue, 1 Feb 2022 19:14:49 +0000

Hello, Stefan.

On Sun, Jan 30, 2022 at 11:31:30 -0500, Stefan Monnier wrote:
> Alan Mackenzie [2022-01-30 11:07:32] wrote:

[ .... ]

> > Are there any objections to me committing this to master?

> See my comments below.

[ .... dealt with by your subsequent post .... ]

> > (defalias 'debug-early-backtrace
> >   #'(lambda ()
> >   "Print a trace of Lisp function calls currently active.
> > The output stream used is the value of `standard-output'.

> > This is a simplified version of the standard `backtrace'
> > function, intended for use in debugging the early parts
> > of the build process."
> >   (princ "\n")
> >   (mapbacktrace
> >    #'(lambda (evald func args _flags)
> >        (let ((args args))
> >      (if evald
> >          (progn
> >            (princ "  ")
> >            (prin1 func)
> >            (princ " (")
> >            (while args
> >              (prin1 (car args))
> >              (setq args (cdr args))
> >              (if args
> >                  (princ " ")))
> >            (princ ")\n"))
> >        (while args
> >          (princ "  ")
> >          (prin1 (car args))
> >          (princ "\n")
> >          (setq args (cdr args)))))))))

> > (defalias 'debug-early
> >   #'(lambda (&rest args)
> >   "Print a trace of Lisp function calls currently active.
> > The output stream used is the value of `standard-output'.

> > There should be two ARGS, the symbol `error' and a cons of
> > the error symbol and its data.

> > This is a simplified version of `debug', intended for use
> > in debugging the early parts of the build process."
> >   (princ "\nError: ")
> >   (prin1 (car (car (cdr args))))    ; The error symbol.
> >   (princ " ")
> >   (prin1 (cdr (car (cdr args))))    ; The error data.
> >   (debug-early-backtrace)))

> I'm curious: why did you split this into two functions?

Since debug-early-backtrace is potentially useful in its own right, just
as backtrace is.

> > (setq debugger #'debug-early)

> Could we make `debug-early` the default/initial value of `debugger` in
> the C code, so that reloading `debug-early.el` can be done safely?

I'm not sure what you're asking here.  Do you mean set Vdebugger to
debug-early in syms_of_eval?  How would that make reloading
debug-early.el safe?

>         Stefan

-- 
Alan Mackenzie (Nuremberg, Germany).



reply via email to

[Prev in Thread] Current Thread [Next in Thread]