Skip to content

Commit f72931e

Browse files
authored
Merge pull request #436 from JuliaDebug/teh/fix_nightly
Various fixes on nightly
2 parents 2f5f800 + bc2968f commit f72931e

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

src/breakpoints.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ macro breakpoint(call_expr, args...)
409409
end
410410
args = Base.tail(args)
411411
end
412-
condexpr = condition === nothing ? nothing : Expr(:quote, condition)
412+
condexpr = condition === nothing ? nothing : esc(Expr(:quote, condition))
413413
if haveline
414414
return quote
415415
local method = $whichexpr

src/utils.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -310,19 +310,19 @@ function firstline(ex::Expr)
310310
end
311311

312312
"""
313-
loc = whereis(frame, pc=frame.pc)
313+
loc = whereis(frame, pc::Int=frame.pc)
314314
315315
Return the file and line number for `frame` at `pc`. If this cannot be
316316
determined, `loc == nothing`. Otherwise `loc == (filepath, line)`.
317317
"""
318-
function CodeTracking.whereis(framecode::FrameCode, pc)
318+
function CodeTracking.whereis(framecode::FrameCode, pc::Int)
319319
codeloc = codelocation(framecode.src, pc)
320320
codeloc == 0 && return nothing
321321
lineinfo = linetable(framecode, codeloc)
322322
return isa(framecode.scope, Method) ?
323323
whereis(lineinfo, framecode.scope) : (getfile(lineinfo), getline(lineinfo))
324324
end
325-
CodeTracking.whereis(frame::Frame, pc=frame.pc) = whereis(frame.framecode, pc)
325+
CodeTracking.whereis(frame::Frame, pc::Int=frame.pc) = whereis(frame.framecode, pc)
326326

327327
"""
328328
line = linenumber(framecode, pc)
@@ -345,7 +345,7 @@ function getfile(framecode::FrameCode, pc)
345345
end
346346
getfile(frame::Frame, pc=frame.pc) = getfile(frame.framecode, pc)
347347

348-
function codelocation(code::CodeInfo, idx)
348+
function codelocation(code::CodeInfo, idx::Int)
349349
codeloc = codelocs(code)[idx]
350350
while codeloc == 0 && (code.code[idx] === nothing || isexpr(code.code[idx], :meta)) && idx < length(code.code)
351351
idx += 1

test/debug.jl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
using JuliaInterpreter, Test
1+
using CodeTracking, JuliaInterpreter, Test
22
using JuliaInterpreter: enter_call, enter_call_expr, get_return, @lookup
33
using Base.Meta: isexpr
4+
include("utils.jl")
45

56
const ALL_COMMANDS = (:n, :s, :c, :finish, :nc, :se, :si, :until)
67

@@ -143,7 +144,8 @@ end
143144
frame = enter_call_expr(:($(callgenerated)()))
144145
f, pc = debug_command(frame, :sg)
145146
# Aside: generators can have `Expr(:line, ...)` in their line tables, test that this is OK
146-
@test isexpr(JuliaInterpreter.linetable(f, 2), :line)
147+
lt = JuliaInterpreter.linetable(f, 2)
148+
@test isexpr(lt, :line) || isa(lt, Core.LineInfoNode)
147149
@test isa(pc, BreakpointRef)
148150
@test JuliaInterpreter.scopeof(f).name == :generatedfoo
149151
stmt = JuliaInterpreter.pc_expr(f)

0 commit comments

Comments
 (0)