Add qemu 2.4.0
[kvmfornfv.git] / qemu / roms / openbios / forth / debugging / firmware.fs
1 \ 7.5 Firmware Debugging command group
2
3
4 \ 7.5.1    Automatic stack display
5
6 : (.s
7   depth 0 ?do
8     depth i - 1- pick .
9   loop
10   depth 0<> if ascii < emit space then
11   ;
12
13 : showstack    ( -- )
14   ['] (.s to status
15   ;
16   
17 : noshowstack    ( -- )
18   ['] noop to status
19   ;
20
21 \ 7.5.2    Serial download
22
23 : dl    ( -- )
24   ;
25
26   
27 \ 7.5.3    Dictionary
28
29 \ 7.5.3.1    Dictionary search
30 : .calls    ( xt -- )
31   ;
32   
33 : $sift    ( text-addr text-len -- )
34   ;
35   
36 : sifting    ( "text< >" -- )
37   ;
38
39 \ : words    ( -- )
40 \   \ Implemented in forth bootstrap.
41 \   ;
42
43   
44 \ 7.5.3.2    Decompiler
45
46 \ implemented in see.fs
47
48 \ : see    ( "old-name< >" -- )
49 \   ;
50   
51 \ : (see)    ( xt -- )
52 \   ;
53
54   
55 \ 7.5.3.3    Patch
56
57 : patch ( "new-name< >old-name< >word-to-patch< >" -- )
58   ;
59
60 : (patch)    ( new-n1 num1? old-n2 num2? xt -- )
61   ;
62
63
64 \ 7.5.3.4    Forth source-level debugger
65  
66 : debug    ( "old-name< >" -- )
67   parse-word            \ Look up word CFA in dictionary
68   $find
69   0 = if
70     ." could not locate word for debugging"
71     2drop
72   else
73     (debug
74   then
75   ;
76   
77 : stepping    ( -- )
78   ;
79   
80 : tracing    ( -- )
81   ;
82   
83 : debug-off    ( -- )
84   (debug-off)
85   ;
86   
87 : resume    ( -- )
88   \ Set interpreter termination flag
89   1 to terminate?
90   ;