When interacting with TimerOutputs.jl, only displays lowered code

オープン
#362 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
julia
領域
devtools

調査の方向性

まず、@timeit と @enter を使用して、提供された MWE を Julia 1.11.3、Debugger 0.7.10、TimerOutputs 0.5.27 で再現します。Debugger が時間計測対象の関数とその lowering 後の表示をどのように扱うかを調べます。時間計測を有効にしたまま、元の関数のソースを通常どおりステップ実行できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

If I try to debug a function that I'm also timing using TimerOutputs, only lowered code is displayed, and I cannot step normally through the function.

MWE:

julia> using TimerOutputs

julia> using Debugger

julia> my_timer = TimerOutput()
────────────────────────────────────────────────────────────────────
                           Time                    Allocations      
                  ───────────────────────   ────────────────────────
Tot / % measured:     91.5ms /   0.0%           4.68MiB /   0.0%    

Section   ncalls     time    %tot     avg     alloc    %tot      avg
────────────────────────────────────────────────────────────────────
────────────────────────────────────────────────────────────────────

julia> @timeit my_timer foo() = begin
       println("hello")
       end
foo (generic function with 1 method)

julia> @enter foo()
In foo() at none:0
  3  │          Core.NewvarNode(:(b₀#233))
  4  │          Core.NewvarNode(:(accumulated_data#232))
  5  │          local_to#230 = Main.my_timer
  6  │    %6  = local_to#230
> 7  │          enabled#231 = Base.getproperty(%6, :enabled)
  8  │    %8  = enabled#231
  9  └───       goto #3 if not %8
 10  2 ── %10 = local_to#230
 11  └───       accumulated_data#232 = (push!)(%10, "foo")

About to run: <getproperty(─────────────────────────────...>
1|debug> n
hello
In foo() at none:0
 28  10 ┄ %28 = @_8 === 1
 29  └───       goto #12 if not %28
 30  11 ─       Base.rethrow()
 31  12 ┄ %31 = val#235
>32  └───       return %31

About to run: return
1|debug> 

julia> 

This using Julia-1.11.3, Debugger-0.7.10 and TimerOutputs-0.5.27.

Obvious workaround is to take out the timing while I'm debugging, but that's not ideal especially in a bigger code where there might be many timed functions.

主要言語
Julia
スター
515
フォーク
50
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

JuliaDebug/Debugger.jl のほかの issue

JuliaDebug/Debugger.jl の issue をすべて見る

似ている issue

Julia の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。