Skip to content

Commit f9d6d8d

Browse files
authored
use the exported break_on from JuliaInterpretr (#104)
1 parent f755c3f commit f9d6d8d

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ About to run: (abs_float)(2.0)
8484
8585
#### Breakpoint on error
8686
87-
It is possible to halt execution when an error is thrown. This is done by calling the exported function `break_on_error(true)`.
87+
It is possible to halt execution when an error is thrown. This is done by calling the exported function `break_on(:error)`.
8888
8989
```jl
9090
julia> using Debugger
9191
92-
julia> break_on_error(true)
92+
julia> break_on(:error)
9393
9494
julia> f() = "αβ"[2];
9595
@@ -116,6 +116,13 @@ About to run: (throw)(StringIndexError("αβ", 2))
116116
| b::UInt8 = 0xb1
117117
| u::UInt32 = 0xb1000000
118118
[4] f() at REPL[17]:1
119+
120+
julia> JuliaInterpreter.break_off(:error)
121+
122+
julia> @run f()
123+
ERROR: StringIndexError("αβ", 2)
124+
Stacktrace:
125+
[...]
119126
```
120127
121128
### Syntax highlighting

src/Debugger.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ function __init__()
2323
return nothing
2424
end
2525

26-
export @enter, @run, break_on_error
26+
export @enter, @run
2727

2828
# reexport some useful things from JuliaInterpreter
29-
using JuliaInterpreter: @bp, @breakpoint, breakpoint
30-
export @bp, @breakpoint, breakpoint
29+
using JuliaInterpreter: @bp, @breakpoint, breakpoint, break_on, break_off
30+
export @bp, @breakpoint, breakpoint, break_on, break_off
3131

3232
include("LineNumbers.jl")
3333
using .LineNumbers: SourceFile, compute_line
@@ -60,7 +60,7 @@ function active_frame(state)
6060
return frame
6161
end
6262

63-
break_on_error(v::Bool) = JuliaInterpreter.break_on_error[] = v
63+
@deprecate break_on_error(v::Bool) (v ? break_on(:error) : break_off(:error))
6464

6565
include("locationinfo.jl")
6666
include("repl.jl")

0 commit comments

Comments
 (0)