From a527c8656b7eeb17ca5a96c0d92af1c86bd1982d Mon Sep 17 00:00:00 2001 From: Chris Hinsley Date: Fri, 21 Sep 2018 09:47:30 +0100 Subject: [PATCH] debug available from boot.inc --- apps/boing/app.lisp | 4 +--- class/lisp/boot.inc | 6 ++++++ sys/kernel/lisp.vp | 2 +- sys/lisp.inc | 1 - 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/apps/boing/app.lisp b/apps/boing/app.lisp index 7821482dd..17d48e381 100644 --- a/apps/boing/app.lisp +++ b/apps/boing/app.lisp @@ -41,20 +41,18 @@ (view-sub old_frame) (view-add-back backdrop frame) (view-dirty frame) - (debug (cat "Pos = " (str x) "," (str y) (char 10))) + (debug "Pos = " x "," y) (while (defq msg (mail-trymail)) (cond ((eq (setq id (read-long ev_msg_target_id msg)) event_win_close) (setq id nil)) ((eq id event_win_min) ;min button - (debug (cat "Min button pressed" (char 10))) (bind '(x y _ _) (view-get-bounds (view-dirty window))) (bind '(w h) (view-pref-size window)) (view-dirty-all (view-change window x y w h))) ((eq id event_win_max) ;max button - (debug (cat "Max button pressed" (char 10))) (bind '(x y _ _) (view-get-bounds (view-dirty window))) (bind '(w h) (view-pref-size window)) (view-dirty-all (view-change window x y (fmul w 1.5) (fmul h 1.5)))) diff --git a/class/lisp/boot.inc b/class/lisp/boot.inc index 1c5013919..e3b6a82a7 100644 --- a/class/lisp/boot.inc +++ b/class/lisp/boot.inc @@ -104,6 +104,8 @@ (ffi prin "class/lisp/func_prin" 0) (ffi print "class/lisp/func_print" 0) +(ffi kernel-debug "sys/kernel/lisp_debug" 0) + (defq t 't nil 'nil lisp_type_list (bit-shl 1 0) lisp_type_integer (bit-shl 1 1) @@ -153,6 +155,10 @@ ;(run path) `(repl (file-stream ,_) ,_)) +(defmacro debug (&rest _) + ;(debug [form] ...) + `(kernel-debug (apply cat (map str (list ~_ (char 10)))))) + ;;;;;;;; ; Scopes ;;;;;;;; diff --git a/sys/kernel/lisp.vp b/sys/kernel/lisp.vp index 21a8940ea..d89eac013 100644 --- a/sys/kernel/lisp.vp +++ b/sys/kernel/lisp.vp @@ -102,7 +102,7 @@ (errorcases (vp-label 'error1) - (f-call 'lisp 'repl_error {this, "(debug str)", error_msg_wrong_types, args} {_, value}) + (f-call 'lisp 'repl_error {this, "(kernel-debug str)", error_msg_wrong_types, args} {_, value}) (goto 'exit) (signature 'sig 'string)) diff --git a/sys/lisp.inc b/sys/lisp.inc index f65bc2359..dc78ceb0e 100644 --- a/sys/lisp.inc +++ b/sys/lisp.inc @@ -39,4 +39,3 @@ (ffi task-sleep "sys/task/lisp_sleep" 0) (ffi kernel-declare "sys/kernel/lisp_declare" 0) (ffi kernel-total "sys/kernel/lisp_total" 0) -(ffi debug "sys/kernel/lisp_debug" 0)