Juno.@run doesn't stop at breakpoints in package code

I’m trying to debug my package with Juno’s builtin debugger, but it ignores the breakpoints I put in the files. The package is ]dev-ed, and using Revise is called before using it. Debugging works, I can step through the lines, but neither of Juno.@run or Juno.@enter stops at the breakpoint. I debug in compiled mode, otherwise it’s really slow.
I tried to work out an example:
The package is dev-ed, and Revise is added, then:

using Logging

using Revise
using RANSAC

global_logger(nosource_IterInflog())

pv, pn, _ = examplepc6();
pcr = PointCloud(pv, pn, 1);
p = RANSACParameters{Float64}(ϵ_sphere=0.5,
                                α_sphere=deg2rad(5),
                                τ=300,
                                itermax=20,
                                shape_types=[:sphere],
                                prob_det=0.9);
# to compile
ransac(pcr, p, true, reset_rand=true);

Then I put a breakpoint to for example src/shapes/sphere.jl line 86:

...
    @assert pl > 2 "Size must be at least 3."
    # "forcefit" a sphere
    sp = fit2pointsphere(p, n, params) # <------ this line
    # also put a println here of you want to see, that this part of the code is running
    println("Here's the point.")
    # check if real sphere
    sp.issphere || return sp
...

If I call Juno.@run ransac(pcr, p, true, reset_rand=true); it doesn’t stop at the breakpoint (the messages are printed). Also if I use Juno.@enter ransac(pcr, p, true, reset_rand=true); then neither Continue or Debug: Step to selected line stops at the breakpoint, but the function runs correctly.

Is this a bug? Or debugging works only in the top level file/function?
(I know that I could step through the lines to get there, but it takes too much time.)

Hope my description and MWE is clear enough to describe the issue, if not please tell me.

Almost forget the versions:
Julia Version 1.3.0-rc4.1, Atom 1.40.1, julia-client 0.11.3

Full debug info
# Atom:
Version: 1.40.1
Dev Mode: false
Official Release: true
{
  "http_parser": "2.8.0",
  "node": "10.2.0",
  "v8": "6.6.346.32",
  "uv": "1.20.3",
  "zlib": "1.2.11",
  "ares": "1.14.0",
  "modules": "64",
  "nghttp2": "1.29.0",
  "napi": "3",
  "openssl": "1.1.0h",
  "electron": "3.1.10",
  "chrome": "66.0.3359.181"
}
# julia-client:
Version: 0.11.3
Config:
{
  "consoleOptions": {
    "cursorBlink": true,
    "cursorStyle": "underline"
  },
  "firstBoot": false,
  "juliaOptions": {},
  "uiOptions": {
    "enableMenu": true,
    "enableToolBar": true,
    "errorInRepl": true,
    "layouts": {
      "defaultPanes": {
        "documentation": false,
        "plotPane": false,
        "workspace": false
      }
    }
  }
}


# ink:
Version: 0.11.6
Config:
undefined


# uber-juno:
Version: 0.3.0
Config:
{
  "disable": true
}


# language-julia:
Version: 0.19.2
Config:
undefined


# language-weave:
Version: 0.6.5
Config:
undefined


# indent-detective:
Version: 0.4.0
Config:
undefined


# latex-completions:
Version: 0.3.6
Config:
undefined


# versioninfo():
Julia Version 1.3.0-rc4.1
Commit 8c4656b97a (2019-10-15 14:08 UTC)
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: Intel(R) Core(TM) i7-3632QM CPU @ 2.20GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, ivybridge)
Environment:
  JULIA_EDITOR = "C:\Users\cstamas\AppData\Local\atom\app-1.40.1\atom.exe"  -a
  JULIA_NUM_THREADS = 4

    Status `C:\Users\cstamas\.julia\environments\v1.3\Project.toml`
  [537997a7] AbstractPlotting v0.9.10
  [1520ce14] AbstractTrees v0.2.1
  [c52e3926] Atom v0.11.3 [`C:\Users\cstamas\.julia\dev\Atom`]
  [fbb218c0] BSON v0.2.4
  [6e4b80f9] BenchmarkTools v0.4.3
  [ad839575] Blink v0.12.0
  [a69a8ca4] CSGBuilding v0.1.0 [`C:\Users\cstamas\.julia\dev\CSGBuilding`]
  [336ed68f] CSV v0.5.18
  [159f3aea] Cairo v0.6.0
  [53a63b46] CodeTools v0.6.5 [`C:\Users\cstamas\.julia\dev\CodeTools`]
  [35d6a980] ColorSchemes v3.5.0
  [c3611d14] ColorVectorSpace v0.7.1
  [5ae59095] Colors v0.9.6
  [a6e380b2] ControlSystems v0.5.4
  [e3df1716] D3Trees v0.3.1+ #master (https://github.com/cserteGT3/D3Trees.jl)
  [a93c6f00] DataFrames v0.19.4
  [864edb3b] DataStructures v0.17.5
  [67fdca37] Displaz v1.0.0
  [e30172f5] Documenter v0.23.4
  [cd674d7a] DocumenterLaTeX v0.2.0
  [5789e2e9] FileIO v1.0.7
  [069b7b12] FunctionWrappers v1.0.0
  [d0ad255c] GPlot v0.0.0 [`C:\Users\cstamas\.julia\dev\GPlot`]
  [28b8d3ca] GR v0.39.0 ⚲
  [6b9d7cbe] GeneralizedGenerated v0.2.0
  [4d00f742] GeometryTypes v0.7.6
  [bc5e4493] GitHub v5.1.3
  [a2cc645c] GraphPlot v0.3.1
  [bd48cda9] GraphRecipes v0.4.0
  [7073ff75] IJulia v1.20.2
  [6218d12a] ImageMagick v0.7.5
  [86fae568] ImageView v0.9.0
  [916415d5] Images v0.18.0
  [c601a237] Interact v0.10.3
  [b6b21f68] Ipopt v0.6.1
  [4ca9428c] JuDoc v0.3.8 #master (https://github.com/tlienart/JuDoc.jl.git)
  [6793090a] JuDocTemplates v0.2.10
  [4076af6c] JuMP v0.20.1
  [2ddba703] Juniper v0.5.2
  [e5e0dc1b] Juno v0.7.2 [`C:\Users\cstamas\.julia\dev\Juno`]
  [fc18253b] LazyJSON v0.1.1
  [093fc24a] LightGraphs v1.3.0
  [16fef848] LiveServer v0.3.3
  [ee78f7c6] Makie v0.9.5
  [dbd62bd0] MakieGallery v0.1.0
  [7269a6da] MeshIO v0.3.1
  [b8a86587] NearestNeighbors v0.4.3
  [510215fc] Observables v0.2.3
  [e4faabce] PProf v0.3.1
  [d96e819e] Parameters v0.12.0
  [32113eaa] PkgBenchmark v0.2.6
  [d254efa0] PkgSkeleton v0.3.1
  [91a5bcdd] Plots v0.27.0
  [08abe8d2] PrettyTables v0.7.0
  [c46f51b8] ProfileView v0.5.0
  [5eb323a6] PropertyFiles v0.1.0 [`C:\Users\cstamas\.julia\dev\PropertyFiles`]
  [d330b81b] PyPlot v2.8.2
  [d6bc97e0] RANSAC v0.1.0 [`C:\Users\cstamas\.julia\dev\RANSAC`]
  [d8b64869] RANSACVisualizer v0.1.1 [`C:\Users\cstamas\.julia\dev\RANSACVisualizer`]
  [731186ca] RecursiveArrayTools v1.0.2
  [dee08c22] RegionTrees v0.3.0
  [295af30f] Revise v2.3.1
  [6038ab10] Rotations v0.12.0
  [82193955] SCIP v0.9.2
  [efcf1570] Setfield v0.5.2
  [d3496432] SignedDistanceFields v0.1.1 #master (https://github.com/freemin7/SignedDistanceFields.jl)
  [90137ffa] StaticArrays v0.11.1
  [65254759] StatsMakie v0.0.6
  [b4f28e30] TikzGraphs v1.1.0
  [37f6aa50] TikzPictures v3.0.5
  [39424ebd] TreeView v0.3.1
  [99c6138d] UnionFind v0.1.0 #master (https://github.com/epatters/UnionFind.jl)
  [112f6efa] VegaLite v1.0.0

That’s expected behaviour – breakpoints in inner functions simply don’t work when you’re in compiled mode. You should be getting a tooltip that says as much:
image

For now I’d recommend Infiltrator.jl. There are plans to integrate something like that into Juno/Debugger.jl, but we’re not quite there yet.

2 Likes

Thanks! Should have hold my mouse longer over there :slight_smile:.
I’ll take a look at Inflitrator!