Skip to content

Commit ab60978

Browse files
authored
Merge pull request #135 from JuliaDebug/teh/fix_132
Enclose signatures_at in try/catch (fixes #132)
2 parents 02a8d3c + 7454432 commit ab60978

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/breakpoints.jl

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,15 @@ end
203203
Set a breakpoint at the specified file and line number.
204204
"""
205205
function breakpoint(filename::AbstractString, line::Integer, args...)
206-
sigs = signatures_at(filename, line)
206+
local sigs
207+
try
208+
sigs = signatures_at(filename, line)
209+
catch
210+
sigs = nothing
211+
end
207212
if sigs === nothing
208213
# TODO: build a Revise-free fallback. Note this won't work well for methods with keywords.
209-
error("no signatures found at $filename, $line. Restarting and `using Revise` may fix this problem.")
214+
error("no signatures found at $filename, $line.\nRestarting and `using Revise` and the relevant package may fix this problem.")
210215
end
211216
for sig in sigs
212217
method = JuliaInterpreter.whichtt(sig)

test/breakpoints.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ end
110110
var = JuliaInterpreter.locals(leaf(frame))
111111
@test !any(v->v.name == :b, var)
112112
@test filter(v->v.name == :a, var)[1].value == 2
113+
else
114+
try
115+
breakpoint(pathof(JuliaInterpreter.CodeTracking), 5)
116+
catch err
117+
@test isa(err, ErrorException)
118+
@test occursin("Revise", err.msg)
119+
end
113120
end
114121

115122
# Direct return

0 commit comments

Comments
 (0)