1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
;; MODULE : debug-menu.scm
;; DESCRIPTION : the debug menu
;; COPYRIGHT : (C) 1999 Joris van der Hoeven
;;
;; This software falls under the GNU general public license version 3 or later.
;; It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
;; in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(texmacs-module (texmacs menus debug-menu))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Memory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (show-memory-information s)
(string-append s "#[" (number->string (texmacs-memory)) "#bytes]"))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Guile
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (debug-backtrace-errors?) (in? 'backtrace (debug-options)))
(tm-define (debug-toggle-backtrace-errors)
(:synopsis "Toggle scheme backtracing of errors.")
(:check-mark "v" debug-backtrace-errors?)
(if (debug-backtrace-errors?)
(debug-disable 'backtrace 'debug)
(debug-enable 'backtrace 'debug)))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; General debugging options
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(tm-define (debug-toggle s)
(:check-mark "v" debug-get)
(debug-set s (not (debug-get s))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Memory
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(menu-bind debug-menu
(-> "Guile"
("Backtrace errors" (debug-toggle-backtrace-errors)))
(-> "Status"
("Tree" (show-tree))
("Path" (show-path))
("Cursors" (show-cursor))
("Selection" (show-selection))
("Environment" (show-env))
("History" (show-history))
("Memory usage" (show-meminfo)))
(-> "Timings"
("All" (bench-print-all)))
(-> "Memory"
("Memory usage" (show-meminfo))
("Collect garbage" (gc))
---
(group "Permanent")
("Show memory usage" (set! footer-hook show-memory-information))
("Garbage collection" (delayed (:idle 1000) (gc))))
(-> "Miscellaneous"
("Provoke error" (oops))
("Test routine" (edit-test)))
---
("auto" (debug-toggle "auto"))
("verbose" (debug-toggle "verbose"))
("events" (debug-toggle "events"))
("std" (debug-toggle "std"))
("io" (debug-toggle "io"))
("bench" (debug-toggle "bench"))
("history" (debug-toggle "history"))
("qt" (debug-toggle "qt"))
("keyboard" (debug-toggle "keyboard"))
("packrat" (debug-toggle "packrat")))
|