forked from rocky/rb-trepanning
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
continue.rb: chase API change. validate.rb: remove crud.
- Loading branch information
Showing
4 changed files
with
90 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
#!/usr/bin/env ruby | ||
require 'test/unit' | ||
require 'trace' | ||
require_relative 'fn_helper' | ||
require_relative '../../app/breakpoint' | ||
|
||
class TestBreakLong < Test::Unit::TestCase | ||
|
||
include FnTestHelper | ||
|
||
def setup | ||
Trepan::Breakpoint::reset | ||
end | ||
|
||
def test_break_same_level | ||
|
||
# See that we can stop at a breakpoint | ||
cmds = ['set basename on', | ||
'break ' + (__LINE__ + 7).to_s, | ||
'continue'] | ||
d = strarray_setup(cmds) | ||
d.start | ||
########### b1 ############### | ||
x = 5 | ||
y = 6 | ||
z = 7 | ||
############################## | ||
d.stop | ||
out = ['-- ', | ||
'x = 5', | ||
'basename is on.', | ||
"Breakpoint 1 set at VM offset 55 of instruction sequence \"test_break_same_level\", | ||
\tline 55 in file foo.rb", | ||
'xx ', | ||
'z = 7'] | ||
compare_output(out, d, cmds) | ||
|
||
# Try a disabling the breakpoint | ||
cmds = ['set basename on', | ||
'break ' + (__LINE__ + 8).to_s, | ||
'break ' + (__LINE__ + 8).to_s, | ||
'disable 1', | ||
'continue'] | ||
d = strarray_setup(cmds) | ||
d.start | ||
########### b2 ############### | ||
x = 7 | ||
y = 8 | ||
z = 8+1 | ||
############################## | ||
d.stop | ||
out = ['-- ', | ||
'x = 7', | ||
"basename is on.", | ||
"Breakpoint 1 set at VM offset 55 of instruction sequence \"test_break_same_level\", | ||
\tline 55 in file foo.rb", | ||
"Breakpoint 2 set at VM offset 55 of instruction sequence \"test_break_same_level\", | ||
\tline 55 in file foo.rb", | ||
"Breakpoint 1 disabled.", | ||
'xx ', | ||
'z = 8+1'] | ||
compare_output(out, d, cmds) | ||
|
||
# Stepping after a breakpoint should not stay at same location. | ||
cmds = ['set basename on', | ||
'continue ' + (__LINE__ + 8).to_s, | ||
'continue'] | ||
dbg = strarray_setup(cmds) | ||
dbg.start | ||
########### b3 ############### | ||
a = 1 | ||
b = 2 | ||
c = 3 | ||
d = 4 | ||
e = 5 | ||
############################## | ||
dbg.stop | ||
out = ['-- ', | ||
'a = 1', | ||
'basename is on.', | ||
'xx ', | ||
'd = 4' ] | ||
compare_output(out, dbg, cmds) | ||
end | ||
|
||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters