llvm-locstats - 計算 DWARF 除錯位置統計數據

語法

llvm-locstats [選項] [檔名]

說明

llvm-locstats 的作用類似於 llvm-dwarfdump 的包裝器。它會解析 llvm-dwarfdump 有關除錯位置的統計數據,並以更易於閱讀的方式進行漂亮地列印。

第 0% 行顯示沒有位置資訊的 DIE 數量和百分比,但第 100% 行顯示在所有程式碼區段位元組(變數或參數在範圍內的位置)中都有位置資訊的 DIE 的資訊。[50%,60%] 行顯示位置資訊在其範圍覆蓋率介於 50% 到 60% 之間的 DIE 數量和百分比。

選項

--only-variables

僅計算區域變數的位置統計數據

--only-formal-parameters

僅計算形式參數的位置統計數據

--ignore-debug-entry-values

忽略包含除錯項目值 DWARF 操作的位置的統計數據

--draw-plot

製作生成的位置儲存區直方圖(需要 matplotlib)

--compare

比較兩個提供的檔案上的除錯位置覆蓋率,並繪製顯示差異的圖表(需要 matplotlib)

結束狀態

如果輸入檔案解析成功,llvm-locstats 會返回 0。否則,它會返回 1。

範例 1

在標準輸出上漂亮地列印位置覆蓋率。

llvm-locstats a.out

  =================================================
            Debug Location Statistics
  =================================================
        cov%          samples       percentage(~)
  -------------------------------------------------
     0%                    1              16%
     (0%,10%)              0               0%
     [10%,20%)             0               0%
     [20%,30%)             0               0%
     [30%,40%)             0               0%
     [40%,50%)             0               0%
     [50%,60%)             1              16%
     [60%,70%)             0               0%
     [70%,80%)             0               0%
     [80%,90%)             1              16%
     [90%,100%)            0               0%
     100%                  3              50%
  =================================================
  -the number of debug variables processed: 6
  -PC ranges covered: 81%
  -------------------------------------------------
  -total availability: 83%
  =================================================

範例 2

將圖表生成為影像檔案。

llvm-locstats --draw-plot file1.out
../_images/locstats-draw-plot.png

範例 3

將圖表生成為影像檔案,顯示除錯位置覆蓋率的差異。

llvm-locstats --compare file1.out file1.withentryvals.out
../_images/locstats-compare.png

另請參閱

llvm-dwarfdump(1)