(dbg-test1.sh:22):
22:	x=22
+# Test break, watch, watche, step, next, continue and stack handling
+#
+### Try a simple line number breakpoint...
+break 23
Breakpoint 1 set in file dbg-test1.sh, line 23.
+info break
Num Type       Disp Enb What
----------------------------
1   breakpoint keep y   dbg-test1.sh:23
+continue
Breakpoint 1 hit (1 times).
(dbg-test1.sh:23):
23:	y=23
+info program
Program stopped.
It stopped at breakpoint 1.
Next statement to be run is:
	y=23
+#
+### Try watch...
+watch x
 0: ($x)==22 arith: 0
+info watchpoints
Num Type       Enb  Expression
------------------------------
0   watchpoint y    $x
+c
Watchpoint 0: $x changed:
  old value: '22'
  new value: '23'
(dbg-test1.sh:24):
24:	for i in 0 1 3 ; do
+info program
Program stopped.
It stopped on a watch trigger.
Next statement to be run is:
	for i in 0 1 3
+### Try disable expression...
+disable 1w
Watchpoint entry 0 disabled.
+watche x > 26
 1: (x > 26)==0 arith: 1
+info break
Num Type       Disp Enb What
----------------------------
1   breakpoint keep y   dbg-test1.sh:23
	breakpoint already hit 1 time
+### Continuing with a one-time line break (but will watch expression)...
+cont 30
One-time breakpoint 2 set in file dbg-test1.sh, line 30.
Watchpoint 1: x > 26 changed:
  old value: '0'
  new value: '1'
(dbg-test1.sh:28):
28:	y=b
+L
Num Type       Disp Enb What
----------------------------
1   breakpoint keep y   dbg-test1.sh:23
	breakpoint already hit 1 time
2   breakpoint del  y   dbg-test1.sh:30
Num Type       Enb  Expression
------------------------------
0   watchpoint n    $x
	breakpoint already hit 1 time
1   watchpoint y    x > 26
	breakpoint already hit 1 time
No actions have been set.
+### Try deleting a watchpoint...
+delete 1W
+L
Num Type       Disp Enb What
----------------------------
1   breakpoint keep y   dbg-test1.sh:23
	breakpoint already hit 1 time
2   breakpoint del  y   dbg-test1.sh:30
Num Type       Enb  Expression
------------------------------
0   watchpoint n    $x
	breakpoint already hit 1 time
No actions have been set.
+### Try break with a function...
+break fn1
Breakpoint 3 set in file dbg-test1.sh, line 5.
+### Stepping 2...
+step 2
(dbg-test1.sh:30):
30:	echo $(fn3 30)
+### Try continue with a line number...
+cont 34
One-time breakpoint 4 set in file dbg-test1.sh, line 34.

Breakpoint 3 hit (1 times).
(dbg-test1.sh:5):
5:	fn1() {
+info program
Program stopped.
It stopped at breakpoint 3.
Next statement to be run is:
	fn1
+L
Num Type       Disp Enb What
----------------------------
1   breakpoint keep y   dbg-test1.sh:23
	breakpoint already hit 1 time
3   breakpoint keep y   dbg-test1.sh:5
	breakpoint already hit 1 time
4   breakpoint del  y   dbg-test1.sh:34
Num Type       Enb  Expression
------------------------------
0   watchpoint n    $x
	breakpoint already hit 1 time
No actions have been set.
+### List stack frame...
+where 2
->0 in file `dbg-test1.sh' at line 5
##1 fn1() called from file `dbg-test1.sh' at line 32
+### Try up...
+up
->1 in file `dbg-test1.sh' at line 32
(dbg-test1.sh:32):
32:	fn1;
+list>
 32:    fn1;
 33:    fn3 33
 34:    source ../example/dbg-test1.sub
 35:    exit 0;
+### Try down 1...
+down 1
->0 in file `dbg-test1.sh' at line 5
(dbg-test1.sh:5):
5:	fn1() {
+list>
  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
+### frame 0...
+frame 0
->0 in file `dbg-test1.sh' at line 5
(dbg-test1.sh:5):
5:	fn1() {
+### Try step (twice)...
+step
(dbg-test1.sh:6):
6:	    echo "fn1 here"
+info program
Program stopped.
It stopped after being stepped.
Next statement to be run is:
	echo "fn1 here"
+step
fn1 here
(dbg-test1.sh:7):
7:	    x=5
+### Try next and check that it jumps over fn3
+next
(dbg-test1.sh:8):
8:	    fn3
+### Try continue file:line (but will hit another breakpoint)...
+cont ../example/dbg-test1.sh:35
One-time breakpoint 5 set in file dbg-test1.sh, line 35.
(dbg-test1.sh:34):
34:	source ../example/dbg-test1.sub
+step 2
SOURCED LINENO 19
(dbg-test1.sub:20):
20:	filename=${BASH_SOURCE[0]##*/}
+T 2
->0 in file `dbg-test1.sub' at line 20
##1 source("dbg-test1.sub") called from file `dbg-test1.sh' at line 34
+step 10
SOURCED BASH_SOURCE[0] dbg-test1.sub
SOURCED FN LINENO 5
(dbg-test1.sub:11):
11:	        local -i j=i+1
+T 2
->0 in file `dbg-test1.sub' at line 11
##1 sourced_fn() called from file `dbg-test1.sub' at line 22
+### Try x command...
+x j
j
+### Try continue break no args (here)...
+break
Breakpoint 6 set in file dbg-test1.sub, line 11.
+cont
FUNCNAME[0]: sourced_fn called from dbg-test1.sub at line 22
Breakpoint 6 hit (1 times).
(dbg-test1.sub:11):
11:	        local -i j=i+1
+### another x command...
+x j
declare -i j="1"
+### another x command (+5 than value above) ...
+x j+5
6
+### x command of string y
+x y
declare -- y="b"
+### x of a function ...
+x fn2
fn2 ()
{
    name="fn2";
    echo "$name here";
    x=6
}
+### Bad x expressions ...
+x bogus
bogus
+x bogus+
bogus+
+x fn2+fn3
fn2+fn3
+x fn2+3
3
+### another continue. Count on breakpoint should go up.
+cont
FUNCNAME[1]: source called from dbg-test1.sh at line 34
Breakpoint 6 hit (2 times).
(dbg-test1.sub:11):
11:	        local -i j=i+1
+print "j: $j, name: $name"
j: 2, name: fn2
+### Try disable of break
+disable 5
Breakpoint entry 5 disabled.
+L
Num Type       Disp Enb What
----------------------------
1   breakpoint keep y   dbg-test1.sh:23
	breakpoint already hit 1 time
3   breakpoint keep y   dbg-test1.sh:5
	breakpoint already hit 1 time
5   breakpoint del  n   dbg-test1.sh:35
6   breakpoint keep y   dbg-test1.sub:11
Num Type       Enb  Expression
------------------------------
0   watchpoint n    $x
	breakpoint already hit 1 time
No actions have been set.
+cont
FUNCNAME[2]: source called from bashdb at line 107
Breakpoint 6 hit (3 times).
(dbg-test1.sub:11):
11:	        local -i j=i+1
+### Test temporary break and its reporting
+cont 13
One-time breakpoint 7 set in file dbg-test1.sub, line 13.
(dbg-test1.sub:13):
13:		local filename=${BASH_SOURCE[$j]##*/}
+info program
Program stopped.
It stopped at a breakpoint that has since been deleted.
Next statement to be run is:
	local filename=${BASH_SOURCE[$j]##*/}
+### Should hit end of script but stay in debugger...
+cont
FUNCNAME[3]: main called from bashdb at line 0
Debugged program terminated normally. Use q to quit or R to restart.
+### quitting...
+quit
bashdb: That's all, folks...
