Skip to content

Commit e2650e8

Browse files
authored
fix fr showing the correct frame (#132)
1 parent 6d622d7 commit e2650e8

File tree

2 files changed

+47
-41
lines changed

2 files changed

+47
-41
lines changed

src/commands.jl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,13 @@ function execute_command(state::DebuggerState, ::Union{Val{:f}, Val{:fr}}, cmd)
9090
end
9191

9292
if subcmds[1] == "fr"
93-
print_frame(Base.pipe_writer(state.terminal), new_level, state.frame)
93+
old_level = state.level
94+
try
95+
state.level = new_level
96+
print_frame(Base.pipe_writer(state.terminal), new_level, active_frame(state))
97+
finally
98+
state.level = old_level
99+
end
94100
return false
95101
else
96102
state.level = new_level

test/ui/history_gcd.multiout

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,9 +1219,9 @@
12191219
| | y::Int64 = 0
12201220
| | T::DataType = Int64
12211221
|1|debug> fr 2
1222-
|[2] ==(x, y) at promotion.jl:403
1223-
| | x::Int64 = 20
1224-
| | y::Int64 = 0
1222+
|[2] my_gcd(a, b) at ui.jl:5
1223+
| | a::Int64 = 10
1224+
| | b::Int64 = 20
12251225
| | T::DataType = Int64
12261226
|1|debug>
12271227
--------------------------------------------------
@@ -1287,9 +1287,9 @@
12871287
|AAAAAAAAAAAAAAAA
12881288
|AAAAAAAAAAAAAAAAAAAAAAA
12891289
|CCCCCCCCCAAAA
1290-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1290+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
1291+
|AAAAAAAAAAAAAAAAA
12911292
|AAAAAAAAAAAAAAAAA
1292-
|AAAAAAAAAAAAAAAA
12931293
|AAAAAAAAAAAAAAAAAAAAAAA
12941294
|CCCCCCCCC
12951295
++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -1355,9 +1355,9 @@
13551355
| | y::Int64 = 0
13561356
| | T::DataType = Int64
13571357
|1|debug> fr 2
1358-
|[2] ==(x, y) at promotion.jl:403
1359-
| | x::Int64 = 20
1360-
| | y::Int64 = 0
1358+
|[2] my_gcd(a, b) at ui.jl:5
1359+
| | a::Int64 = 10
1360+
| | b::Int64 = 20
13611361
| | T::DataType = Int64
13621362
|1|debug> f 2
13631363
|In my_gcd(a, b) at ui.jl:5
@@ -1433,9 +1433,9 @@
14331433
|AAAAAAAAAAAAAAAA
14341434
|AAAAAAAAAAAAAAAAAAAAAAA
14351435
|CCCCCCCCCAAAA
1436-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1436+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
1437+
|AAAAAAAAAAAAAAAAA
14371438
|AAAAAAAAAAAAAAAAA
1438-
|AAAAAAAAAAAAAAAA
14391439
|AAAAAAAAAAAAAAAAAAAAAAA
14401440
|CCCCCCCCCAAA
14411441
|AAAAAAAAAAAAAAAAAAAAAAAAAA
@@ -1511,9 +1511,9 @@
15111511
| | y::Int64 = 0
15121512
| | T::DataType = Int64
15131513
|1|debug> fr 2
1514-
|[2] ==(x, y) at promotion.jl:403
1515-
| | x::Int64 = 20
1516-
| | y::Int64 = 0
1514+
|[2] my_gcd(a, b) at ui.jl:5
1515+
| | a::Int64 = 10
1516+
| | b::Int64 = 20
15171517
| | T::DataType = Int64
15181518
|1|debug> f 2
15191519
|In my_gcd(a, b) at ui.jl:5
@@ -1594,9 +1594,9 @@
15941594
|AAAAAAAAAAAAAAAA
15951595
|AAAAAAAAAAAAAAAAAAAAAAA
15961596
|CCCCCCCCCAAAA
1597-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1597+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
1598+
|AAAAAAAAAAAAAAAAA
15981599
|AAAAAAAAAAAAAAAAA
1599-
|AAAAAAAAAAAAAAAA
16001600
|AAAAAAAAAAAAAAAAAAAAAAA
16011601
|CCCCCCCCCAAA
16021602
|AAAAAAAAAAAAAAAAAAAAAAAAAA
@@ -1677,9 +1677,9 @@
16771677
| | y::Int64 = 0
16781678
| | T::DataType = Int64
16791679
|1|debug> fr 2
1680-
|[2] ==(x, y) at promotion.jl:403
1681-
| | x::Int64 = 20
1682-
| | y::Int64 = 0
1680+
|[2] my_gcd(a, b) at ui.jl:5
1681+
| | a::Int64 = 10
1682+
| | b::Int64 = 20
16831683
| | T::DataType = Int64
16841684
|1|debug> f 2
16851685
|In my_gcd(a, b) at ui.jl:5
@@ -1769,9 +1769,9 @@
17691769
|AAAAAAAAAAAAAAAA
17701770
|AAAAAAAAAAAAAAAAAAAAAAA
17711771
|CCCCCCCCCAAAA
1772-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1772+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
1773+
|AAAAAAAAAAAAAAAAA
17731774
|AAAAAAAAAAAAAAAAA
1774-
|AAAAAAAAAAAAAAAA
17751775
|AAAAAAAAAAAAAAAAAAAAAAA
17761776
|CCCCCCCCCAAA
17771777
|AAAAAAAAAAAAAAAAAAAAAAAAAA
@@ -1861,9 +1861,9 @@
18611861
| | y::Int64 = 0
18621862
| | T::DataType = Int64
18631863
|1|debug> fr 2
1864-
|[2] ==(x, y) at promotion.jl:403
1865-
| | x::Int64 = 20
1866-
| | y::Int64 = 0
1864+
|[2] my_gcd(a, b) at ui.jl:5
1865+
| | a::Int64 = 10
1866+
| | b::Int64 = 20
18671867
| | T::DataType = Int64
18681868
|1|debug> f 2
18691869
|In my_gcd(a, b) at ui.jl:5
@@ -1958,9 +1958,9 @@
19581958
|AAAAAAAAAAAAAAAA
19591959
|AAAAAAAAAAAAAAAAAAAAAAA
19601960
|CCCCCCCCCAAAA
1961-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
1961+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
1962+
|AAAAAAAAAAAAAAAAA
19621963
|AAAAAAAAAAAAAAAAA
1963-
|AAAAAAAAAAAAAAAA
19641964
|AAAAAAAAAAAAAAAAAAAAAAA
19651965
|CCCCCCCCCAAA
19661966
|AAAAAAAAAAAAAAAAAAAAAAAAAA
@@ -2055,9 +2055,9 @@
20552055
| | y::Int64 = 0
20562056
| | T::DataType = Int64
20572057
|1|debug> fr 2
2058-
|[2] ==(x, y) at promotion.jl:403
2059-
| | x::Int64 = 20
2060-
| | y::Int64 = 0
2058+
|[2] my_gcd(a, b) at ui.jl:5
2059+
| | a::Int64 = 10
2060+
| | b::Int64 = 20
20612061
| | T::DataType = Int64
20622062
|1|debug> f 2
20632063
|In my_gcd(a, b) at ui.jl:5
@@ -2152,9 +2152,9 @@
21522152
|AAAAAAAAAAAAAAAA
21532153
|AAAAAAAAAAAAAAAAAAAAAAA
21542154
|CCCCCCCCCAAAA
2155-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2155+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
2156+
|AAAAAAAAAAAAAAAAA
21562157
|AAAAAAAAAAAAAAAAA
2157-
|AAAAAAAAAAAAAAAA
21582158
|AAAAAAAAAAAAAAAAAAAAAAA
21592159
|CCCCCCCCCAAA
21602160
|AAAAAAAAAAAAAAAAAAAAAAAAAA
@@ -2249,9 +2249,9 @@
22492249
| | y::Int64 = 0
22502250
| | T::DataType = Int64
22512251
|1|debug> fr 2
2252-
|[2] ==(x, y) at promotion.jl:403
2253-
| | x::Int64 = 20
2254-
| | y::Int64 = 0
2252+
|[2] my_gcd(a, b) at ui.jl:5
2253+
| | a::Int64 = 10
2254+
| | b::Int64 = 20
22552255
| | T::DataType = Int64
22562256
|1|debug> f 2
22572257
|In my_gcd(a, b) at ui.jl:5
@@ -2360,9 +2360,9 @@
23602360
|AAAAAAAAAAAAAAAA
23612361
|AAAAAAAAAAAAAAAAAAAAAAA
23622362
|CCCCCCCCCAAAA
2363-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2363+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
2364+
|AAAAAAAAAAAAAAAAA
23642365
|AAAAAAAAAAAAAAAAA
2365-
|AAAAAAAAAAAAAAAA
23662366
|AAAAAAAAAAAAAAAAAAAAAAA
23672367
|CCCCCCCCCAAA
23682368
|AAAAAAAAAAAAAAAAAAAAAAAAAA
@@ -2471,9 +2471,9 @@
24712471
| | y::Int64 = 0
24722472
| | T::DataType = Int64
24732473
|1|debug> fr 2
2474-
|[2] ==(x, y) at promotion.jl:403
2475-
| | x::Int64 = 20
2476-
| | y::Int64 = 0
2474+
|[2] my_gcd(a, b) at ui.jl:5
2475+
| | a::Int64 = 10
2476+
| | b::Int64 = 20
24772477
| | T::DataType = Int64
24782478
|1|debug> f 2
24792479
|In my_gcd(a, b) at ui.jl:5
@@ -2582,9 +2582,9 @@
25822582
|AAAAAAAAAAAAAAAA
25832583
|AAAAAAAAAAAAAAAAAAAAAAA
25842584
|CCCCCCCCCAAAA
2585-
|AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
2585+
|AAAAAAAAAAAAAAAAAAAAAAAAAAA
2586+
|AAAAAAAAAAAAAAAAA
25862587
|AAAAAAAAAAAAAAAAA
2587-
|AAAAAAAAAAAAAAAA
25882588
|AAAAAAAAAAAAAAAAAAAAAAA
25892589
|CCCCCCCCCAAA
25902590
|AAAAAAAAAAAAAAAAAAAAAAAAAA

0 commit comments

Comments
 (0)