From f199db03e2bd950b612d9b5915533169cfe5fd0e Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Fri, 15 Mar 2019 04:07:26 -0500 Subject: [PATCH 1/2] Try harder to find the true path of a method Particularly on Julia binaries, the path may need correction. Tests are in Revise. --- src/CodeTracking.jl | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/CodeTracking.jl b/src/CodeTracking.jl index f59ff59..4d6efe1 100644 --- a/src/CodeTracking.jl +++ b/src/CodeTracking.jl @@ -30,6 +30,13 @@ is the first line of the method's body. """ function whereis(method::Method) lin = get(method_info, method.sig, nothing) + if lin === nothing + f = method_lookup_callback[] + if f !== nothing + Base.invokelatest(f, method) + end + lin = get(method_info, method.sig, nothing) + end if lin === nothing file, line = String(method.file), method.line else From 038f404e5597f0ec0eb1c5cd5f84398ea6d7b2c7 Mon Sep 17 00:00:00 2001 From: Tim Holy Date: Fri, 15 Mar 2019 04:07:37 -0500 Subject: [PATCH 2/2] Add a bit of precompilation --- src/CodeTracking.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/CodeTracking.jl b/src/CodeTracking.jl index 4d6efe1..a21fc46 100644 --- a/src/CodeTracking.jl +++ b/src/CodeTracking.jl @@ -201,4 +201,8 @@ were loaded to define the package that defined `mod`. """ pkgfiles(mod::Module) = pkgfiles(PkgId(mod)) +if ccall(:jl_generating_output, Cint, ()) == 1 + precompile(Tuple{typeof(setindex!), Dict{PkgId,PkgFiles}, PkgFiles, PkgId}) +end + end # module