@@ -24,6 +24,7 @@ export @profview, warntype_clicked, descend_clicked, ascend_clicked
24
24
@deprecate warntype_last warntype_clicked
25
25
26
26
const clicked = Ref {Any} (nothing ) # for getting access to the clicked bar
27
+ const clicked_trace = Ref {Any} (nothing )
27
28
28
29
const _graphtype = Ref {Symbol} (Symbol (@load_preference (" graphtype" , " flame" )))
29
30
const _theme = Ref {Symbol} (Symbol (@load_preference (" theme" , " light" )))
@@ -433,6 +434,15 @@ function viewprof_func(fcolor, c, g, fontsize, tb_items, graphtype)
433
434
elseif btn. button == 3
434
435
edit (string (sf. file), sf. line)
435
436
end
437
+ # Also collect the trace
438
+ Y = size (tagimg, 2 )
439
+ trace = [sf]
440
+ yu += 1
441
+ while yu < Y
442
+ push! (trace, gettag (tagimg, xu, yu))
443
+ yu += 1
444
+ end
445
+ clicked_trace[] = trace
436
446
end
437
447
end
438
448
end
@@ -550,7 +560,11 @@ function __init__()
550
560
@warn " the bar you clicked on might have been inlined and unavailable for inspection. Click on a non-inlined bar to `descend`."
551
561
return nothing
552
562
end
553
- return Cthulhu. ascend (st. linfo; hide_type_stable, kwargs... )
563
+ if hasmethod (Cthulhu. buildframes, Tuple{Vector{StackTraces. StackFrame}})
564
+ return Cthulhu. ascend (clicked_trace[]; hide_type_stable, kwargs... )
565
+ else
566
+ return Cthulhu. ascend (st. linfo; hide_type_stable, kwargs... )
567
+ end
554
568
end
555
569
end
556
570
Base. Experimental. register_error_hint (MethodError) do io, exc, argtypes, kwargs
0 commit comments