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 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
(dbg-test1.sh:4):
fn1 () { echo "fn1 here" x=5 fn3 }
+# Test of debugger 'list' command
+#
+help l
list [LOC|.|-] [COUNT] -- List COUNT lines of a script starting from LOC
START is the starting location or dot (.) for current file and
line. Subsequent list commands continue from the last line
listed. Frame switching however resets the line to dot.
If COUNT is omitted, use the setting LISTSIZE. Use "set listsize" to
change this setting.
Aliases for list: l
+### List default location
+list
4: => fn1() {
5: echo "fn1 here"
6: x=5
7: fn3
8: }
9:
10: fn2() {
11: name="fn2"
12: echo "$name here"
13: x=6
+### Should list next sets of lines
+list
14: }
15:
16: fn3() {
17: name="fn3"
18: x=$1
19: }
20:
21: x=22
22: y=23
23: for i in 0 1 3 ; do
+list
24: ((x += i))
25: done
26: x=27
27: y=b
28: x=29
29: echo $(fn3 30)
30: fn3 31
31: fn1;
32: fn3 33
33: source ./dbg-test1.sub
+list
34: exit 0
+### Original set and then beginning
+list .
4: => fn1() {
5: echo "fn1 here"
6: x=5
7: fn3
8: }
9:
10: fn2() {
11: name="fn2"
12: echo "$name here"
13: x=6
+list -
1: #!/bin/zsh -f
2: # This code is used for various debugger testing.
3:
+#
+# Should not see anything since we are out of bounds
+#
+list 999
** Line 999 is too large. File dbg-test1.sh has only 34 lines.
+#########################################################
+### 'list file:line' and canonicalization of filenames...
+list ../example/dbg-test1.sh:1
1: #!/bin/zsh -f
2: # This code is used for various debugger testing.
3:
4: => fn1() {
5: echo "fn1 here"
6: x=5
7: fn3
8: }
9:
10: fn2() {
+list ../example/dbg-test1.sh:20
20:
21: x=22
22: y=23
23: for i in 0 1 3 ; do
24: ((x += i))
25: done
26: x=27
27: y=b
28: x=29
29: echo $(fn3 30)
+list ../example/dbg-test1.sh:30
30: fn3 31
31: fn1;
32: fn3 33
33: source ./dbg-test1.sub
34: exit 0
+list ../example/dbg-test1.sh:999
** Line 999 is too large. File dbg-test1.sh has only 34 lines.
+list ./badfile:1
** File "badfile" not found in read-in files.
** See 'info files' for a list of known files and
** 'load' to read in a file.
+#########################################################
+set trace-commands on
+### list of functions...
+## list fn1
+## list bogus
+#########################################################
+### Testing window command..."
+## window
+### Testing '.'
+# l .
+#
+### Testing set/show listsize
+show listsize
Number of source lines zshdb will list by default is 10.
+### Setting listsize to 3...
+set listsize 3
+list 10
10: fn2() {
11: name="fn2"
12: echo "$name here"
+### Window command...
+## w
+## p "- command..."
+## -
+### Setting listsize to 4...
+set listsize 4
+show listsize
Number of source lines zshdb will list by default is 4.
+list 10
10: fn2() {
11: name="fn2"
12: echo "$name here"
13: x=6
+### Window command...
+## w
+### '-' command...
+### -
+#<-This comment doesn't have a space after
+#the initial `#'
+quit
|