Skip to content

Commit

Permalink
work around problem with finding stdlib files (#146)
Browse files Browse the repository at this point in the history
* work around problem with finding stdlib files
  • Loading branch information
KristofferC authored Mar 16, 2019
1 parent 351a081 commit c0a3c75
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[CodeTracking]]
deps = ["Test", "UUIDs"]
git-tree-sha1 = "12aa4d41c7926afd7a71af5af603a4d8b94292c2"
deps = ["InteractiveUtils", "Test", "UUIDs"]
git-tree-sha1 = "983f5f7a57c604322917ab8bc5b86ba914d3c345"
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
version = "0.3.1"
version = "0.3.2"

[[Distributed]]
deps = ["Random", "Serialization", "Sockets"]
Expand Down
10 changes: 5 additions & 5 deletions docs/Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"

[[CodeTracking]]
deps = ["Test", "UUIDs"]
git-tree-sha1 = "591b73b37c92ed7d55d3a14e266829c21aa3a7eb"
deps = ["InteractiveUtils", "Test", "UUIDs"]
git-tree-sha1 = "983f5f7a57c604322917ab8bc5b86ba914d3c345"
uuid = "da1fd8a2-8d9e-5ec2-8556-3022fb5608a2"
version = "0.3.0"
version = "0.3.2"

[[Dates]]
deps = ["Printf"]
Expand All @@ -19,9 +19,9 @@ uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"

[[DocStringExtensions]]
deps = ["LibGit2", "Markdown", "Pkg", "Test"]
git-tree-sha1 = "1df01539a1c952cef21f2d2d1c092c2bcf0177d7"
git-tree-sha1 = "4d30e889c9f106a51ffa4791a88ffd4765bf20c3"
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
version = "0.6.0"
version = "0.7.0"

[[Documenter]]
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "LibGit2", "Logging", "Markdown", "Pkg", "REPL", "Random", "Test", "Unicode"]
Expand Down
3 changes: 2 additions & 1 deletion src/types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,8 @@ function truncate!(frame)
end

function Base.show(io::IO, frame::Frame)
println(io, "Frame for ", scopeof(frame))
frame_loc = CodeTracking.replace_buildbot_stdlibpath(repr(scopeof(frame)))
println(io, "Frame for ", frame_loc)
pc = frame.pc
ns = nstatements(frame.framecode)
range = get(io, :limit, false) ? (max(1, pc-2):min(ns, pc+2)) : (1:ns)
Expand Down
2 changes: 1 addition & 1 deletion src/utils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ function lineoffset(framecode::FrameCode)
end

getline(ln) = isexpr(ln, :line) ? ln.args[1] : ln.line
getfile(ln) = String(isexpr(ln, :line) ? ln.args[2] : ln.file)
getfile(ln) = CodeTracking.maybe_fixup_stdlib_path(String(isexpr(ln, :line) ? ln.args[2] : ln.file))

"""
loc = whereis(frame, pc=frame.pc)
Expand Down
7 changes: 7 additions & 0 deletions test/interpret.jl
Original file line number Diff line number Diff line change
Expand Up @@ -394,3 +394,10 @@ fr = JuliaInterpreter.enter_call(f)
file, line = JuliaInterpreter.whereis(fr)
@test file == @__FILE__
@test line == (@__LINE__() - 4)

# Test path to files in stdlib
fr = JuliaInterpreter.enter_call(Test.eval, 1)
file, line = JuliaInterpreter.whereis(fr)
@test isfile(file)
@test isfile(JuliaInterpreter.getfile(fr.framecode.src.linetable[1]))
@test occursin(Sys.STDLIB, repr(fr))

0 comments on commit c0a3c75

Please sign in to comment.