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 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172
|
(dbg-test1.sh:22):
22: x=22
+# Test of debugger 'list' command
+#
+### List default location
+list
22:==>x=22
23: y=23
24: for i in 0 1 3 ; do
25: ((x += i))
26: done
27: x=27
28: y=b
29: x=29
30: echo $(fn3 30)
31: fn3 31
+### Should list next set of lines
+l
32: fn1;
33: fn3 33
34: source dbg-test1.sub
35: exit 0;
36: #;;; Local Variables: ***
37: #;;; mode:shell-script ***
38: #;;; End: ***
+#
+# Should not see anything since we ran off the top
+#
+list 999
Line 999 is too large. File dbg-test1.sh has only 38 lines.
+#########################################################
+### 'list file:line' and canonicalization of filenames...
+list ./dbg-test1.sh:1
1: #!/usr/bin/env bash
2: # Note: no CVS Id line since it would mess up regression testing.
3: # This code is used for various debugger testing.
4:
5: fn1() {
6: echo "fn1 here"
7: x=5
8: fn3
9: }
10:
+list ../test/dbg-test1.sh:20
20: }
21:
22:==>x=22
23: y=23
24: for i in 0 1 3 ; do
25: ((x += i))
26: done
27: x=27
28: y=b
29: x=29
+list dbg-test1.sh:30
30: echo $(fn3 30)
31: fn3 31
32: fn1;
33: fn3 33
34: source dbg-test1.sub
35: exit 0;
36: #;;; Local Variables: ***
37: #;;; mode:shell-script ***
38: #;;; End: ***
+list ./dbg-test1.sh:999
Line 999 is too large. File dbg-test1.sh has only 38 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
5: fn1() {
6: echo "fn1 here"
7: x=5
8: fn3
9: }
10:
11: fn2() {
12: name="fn2"
13: echo "$name here"
14: x=6
+list bogus
Invalid line specification: bogus
File not found in read-in files.
See 'info files' for a list of known files and
'load' to read in a file.
+#########################################################
+### Testing window command..."
+window
17: fn3() {
18: name="fn3"
19: x=$1
20: }
21:
22:==>x=22
23: y=23
24: for i in 0 1 3 ; do
25: ((x += i))
26: done
+### Testing '.'
+l .
27: x=27
28: y=b
29: x=29
30: echo $(fn3 30)
31: fn3 31
32: fn1;
33: fn3 33
34: source dbg-test1.sub
35: exit 0;
36: #;;; Local Variables: ***
+#
+# Should see lines up to current execution line.
+### Trying '-'...
+-
13: echo "$name here"
14: x=6
15: }
16:
17: fn3() {
18: name="fn3"
19: x=$1
20: }
21:
22:==>x=22
+### Testing set/show listsize
+show listsize
Number of source lines bashdb will list by default is 10.
+### Setting listsize to 3...
+set listsize 3
+l 10
10:
11: fn2() {
12: name="fn2"
+### Window command...
+w
21:
22:==>x=22
23: y=23
+p "- command..."
- command...
+-
20: }
21:
22:==>x=22
+### Setting listsize to 4...
+set listsize 4
+show listsize
Number of source lines bashdb will list by default is 4.
+l 10
10:
11: fn2() {
12: name="fn2"
13: echo "$name here"
+### Window command...
+w
20: }
21:
22:==>x=22
23: y=23
+### '-' command...
+-
19: x=$1
20: }
21:
22:==>x=22
+#<-This comment doesn't have a space after
+#the initial `#'
+quit
|