[all-commits] [llvm/llvm-project] d5b40c: [lldb] Avoid force loading symbols in statistics c...

royitaqi via All-commits all-commits at lists.llvm.org
Mon Apr 21 16:53:35 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d5b40c71f6be972f677de5d9886f91866df007b5
      https://github.com/llvm/llvm-project/commit/d5b40c71f6be972f677de5d9886f91866df007b5
  Author: royitaqi <royitaqi at users.noreply.github.com>
  Date:   2025-04-21 (Mon, 21 Apr 2025)

  Changed paths:
    M lldb/include/lldb/Symbol/ObjectFile.h
    M lldb/include/lldb/Symbol/SymbolFile.h
    M lldb/include/lldb/Symbol/SymbolFileOnDemand.h
    M lldb/source/Core/Module.cpp
    M lldb/source/Symbol/ObjectFile.cpp
    M lldb/source/Symbol/SymbolFile.cpp
    M lldb/test/API/commands/statistics/basic/TestStats.py
    M lldb/unittests/Symbol/LineTableTest.cpp
    M lldb/unittests/Symbol/SymtabTest.cpp

  Log Message:
  -----------
  [lldb] Avoid force loading symbols in statistics collection (#136236)

Currently, `DebuggerStats::ReportStatistics()` calls
`Module::GetSymtab(/*can_create=*/false)`, but then the latter calls
`SymbolFile::GetSymtab()`. This will load symbols if haven't yet. See
stacktrace below.

The problem is that `DebuggerStats::ReportStatistics` should be
read-only. This is especially important because it reports stats for
symtab parsing/indexing time, which could be affected by the reporting
itself if it's not read-only.

This patch fixes this problem by adding an optional parameter
`SymbolFile::GetSymtab(bool can_create = true)` and receive the `false`
value passed down from `Module::GetSymtab(/*can_create=*/false)` when
the call was initiated from `DebuggerStats::ReportStatistics()`.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list