Re: master: Define some debug specials as either global or thread-local

Stas Boukarev <[email protected]> Sat, 28 Feb 2026 22:03:32 +0300
Newsgroups gmane.lisp.steel-bank.cvs,gmane.lisp.steel-bank.devel
Message-ID <CAF63=11Hk9n00+mXW60cfLiULScFbVK7w77sQTpJauX3Oy5A5Q@mail.gmail.com>
On x86, compiling INIT-THREAD-LOCAL-STORAGE

[297/298] src/code/target-format (0.392 sec)
While evaluating the form starting at line 201, column 0
of #P"/home/runner/work/sbcl/sbcl/src/cold/compile-cold-sbcl.lisp":
While evaluating the form starting at line 34, column 0
of #P"/home/runner/work/sbcl/sbcl/make-host-2.lisp":
Unhandled SIMPLE-ERROR in thread #<HOST-SB-THREAD:THREAD tid=4151
"main thread" RUNNING
{1000B88133}>:
#<SB-C:TN '0!1 :CONSTANT> is not valid as the first argument to VOP:
%SET-SAP-REF-LISPOBJ,
since the TN's primitive type SB-VM::POSITIVE-FIXNUM doesn't allow any
of the SCs
allowed by the operand restriction:
(SB-VM::DESCRIPTOR-REG)
Current cost info inconsistent with that in effect at compile time. Recompile.
Compilation order may be incorrect.

On Sat, Feb 28, 2026 at 9:56 PM snuglas via Sbcl-commits
<[email protected]> wrote:
>
> The branch "master" has been updated in SBCL:
>        via  dde6211989e797e31825472a6642158c49f3b0b1 (commit)
>       from  787f9b2db2bf908691ab563f4f65a170662eb250 (commit)
>
> - Log -----------------------------------------------------------------
> commit dde6211989e797e31825472a6642158c49f3b0b1
> Author: Douglas Katzman <[email protected]>
> Date:   Sat Feb 28 13:45:36 2026 -0500
>
>     Define some debug specials as either global or thread-local
> ---
>  src/code/debug.lisp | 23 +++++++++++------------
>  1 file changed, 11 insertions(+), 12 deletions(-)
>
> diff --git a/src/code/debug.lisp b/src/code/debug.lisp
> index 9fd5cec98..cb9905258 100644
> --- a/src/code/debug.lisp
> +++ b/src/code/debug.lisp
> @@ -56,18 +56,17 @@ provide bindings for printer control variables.")
>    nil
>    "*READTABLE* for the debugger")
>
> -(defvar *in-the-debugger* nil
> +(sb-impl:define-thread-local *in-the-debugger* nil
>    "This is T while in the debugger.")
>
>  ;;; nestedness inside debugger command loops
> -(defvar *debug-command-level* 0)
> +(sb-impl:define-thread-local *debug-command-level* 0)
>
>  ;;; If this is bound before the debugger is invoked, it is used as the stack
>  ;;; top by the debugger. It can either be the first interesting frame, or the
>  ;;; name of the last uninteresting frame.
> -(defvar *stack-top-hint* nil)
> -(defvar *current-frame* nil)
> -(declaim (always-bound *stack-top-hint* *current-frame*))
> +(sb-impl:define-thread-local *stack-top-hint* nil)
> +(sb-impl:define-thread-local *current-frame* nil)
>
>  ;;; Beginner-oriented help messages are important because you end up
>  ;;; in the debugger whenever something bad happens, or if you try to
> @@ -174,21 +173,21 @@ Other commands:
>
>  ;;; a list of the types of code-locations that should not be stepped
>  ;;; to and should not be listed when listing breakpoints
> -(defvar *bad-code-location-types* '(:call-site :internal-error))
> +(define-load-time-global *bad-code-location-types* '(:call-site :internal-error))
>  (declaim (type list *bad-code-location-types*))
>
>  ;;; code locations of the possible breakpoints
> -(defvar *possible-breakpoints*)
> +(declaim (global *possible-breakpoints*))
>  (declaim (type list *possible-breakpoints*))
>
>  ;;; a list of the made and active breakpoints, each is a
>  ;;; BREAKPOINT-INFO structure
> -(defvar *breakpoints* nil)
> +(define-load-time-global *breakpoints* nil)
>  (declaim (type list *breakpoints*))
>
>  ;;; a list of BREAKPOINT-INFO structures of the made and active step
>  ;;; breakpoints
> -(defvar *step-breakpoints* nil)
> +(define-load-time-global *step-breakpoints* nil)
>  (declaim (type list *step-breakpoints*))
>
>  ;;; the number of times left to step
> @@ -1165,9 +1164,9 @@ the current thread are replaced with dummy objects which can safely escape."
>     around the invocation.")
>
>  ;;; These are bound on each invocation of INVOKE-DEBUGGER.
> -(defvar *debug-restarts*)
> -(defvar *debug-condition*)
> -(defvar *nested-debug-condition*)
> +(sb-impl:define-thread-local *debug-restarts*)
> +(sb-impl:define-thread-local *debug-condition*)
> +(sb-impl:define-thread-local *nested-debug-condition*)
>
>  ;;; Oh, what a tangled web we weave when we preserve backwards
>  ;;; compatibility with 1968-style use of global variables to control
>
> -----------------------------------------------------------------------
>
>
> hooks/post-receive
> --
> SBCL
>
>
> _______________________________________________
> Sbcl-commits mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/sbcl-commits


_______________________________________________
Sbcl-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sbcl-commits