Skip to content

Commit c0a3c75

Browse files
authored
work around problem with finding stdlib files (#146)
* work around problem with finding stdlib files
1 parent 351a081 commit c0a3c75

File tree

5 files changed

+18
-10
lines changed

5 files changed

+18
-10
lines changed

Manifest.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
55

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

1212
[[Distributed]]
1313
deps = ["Random", "Serialization", "Sockets"]

docs/Manifest.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
55

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

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

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

2626
[[Documenter]]
2727
deps = ["Base64", "DocStringExtensions", "InteractiveUtils", "LibGit2", "Logging", "Markdown", "Pkg", "REPL", "Random", "Test", "Unicode"]

src/types.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,8 @@ function truncate!(frame)
187187
end
188188

189189
function Base.show(io::IO, frame::Frame)
190-
println(io, "Frame for ", scopeof(frame))
190+
frame_loc = CodeTracking.replace_buildbot_stdlibpath(repr(scopeof(frame)))
191+
println(io, "Frame for ", frame_loc)
191192
pc = frame.pc
192193
ns = nstatements(frame.framecode)
193194
range = get(io, :limit, false) ? (max(1, pc-2):min(ns, pc+2)) : (1:ns)

src/utils.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ function lineoffset(framecode::FrameCode)
155155
end
156156

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

160160
"""
161161
loc = whereis(frame, pc=frame.pc)

test/interpret.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -394,3 +394,10 @@ fr = JuliaInterpreter.enter_call(f)
394394
file, line = JuliaInterpreter.whereis(fr)
395395
@test file == @__FILE__
396396
@test line == (@__LINE__() - 4)
397+
398+
# Test path to files in stdlib
399+
fr = JuliaInterpreter.enter_call(Test.eval, 1)
400+
file, line = JuliaInterpreter.whereis(fr)
401+
@test isfile(file)
402+
@test isfile(JuliaInterpreter.getfile(fr.framecode.src.linetable[1]))
403+
@test occursin(Sys.STDLIB, repr(fr))

0 commit comments

Comments
 (0)