~ chicken-core (chicken-5) fe311473c6944692652e78dadd01d20bfeb35965
commit fe311473c6944692652e78dadd01d20bfeb35965 Author: Peter Bex <peter@more-magic.net> AuthorDate: Tue Mar 8 19:52:59 2016 +0100 Commit: Peter Bex <peter@more-magic.net> CommitDate: Tue Mar 8 19:52:59 2016 +0100 Preserve destination name when inserting C_DEBUG_GLOBAL_ASSIGN events Using a gensym for the let binding inserted by C_DEBUG_GLOBAL_ASSIGN events causes a different "dest" to be used when walking the assigned value, which (for procedures) means that the value's accompanying C_DEBUG_ENTRY event will use that temporary name rather than the procedure's real, assigned one. Signed-off-by: Peter Bex <peter@more-magic.net> diff --git a/core.scm b/core.scm index 9c424a89..9766c113 100644 --- a/core.scm +++ b/core.scm @@ -1060,11 +1060,10 @@ (mark-variable var '##compiler#always-bound-to-procedure) (mark-variable var '##compiler#always-bound)) (when emit-debug-info - (let ((tmp (gensym))) - (set! val - `(let ((,tmp ,val)) - (##core#debug-event "C_DEBUG_GLOBAL_ASSIGN" ',var) - ,tmp))))) + (set! val + `(let ((,var ,val)) + (##core#debug-event "C_DEBUG_GLOBAL_ASSIGN" ',var) + ,var)))) (cond ((##sys#macro? var) (warning (sprintf "assigned global variable `~S' is syntax ~A"Trap