[all-commits] [llvm/llvm-project] 6aa963: [lldb] Do not bump memory modificator ID when "int...

Mikhail Zakharov via All-commits all-commits at lists.llvm.org
Thu May 1 11:11:02 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 6aa963f780d63d4c8fa80de97dd79c932bc35f4e
      https://github.com/llvm/llvm-project/commit/6aa963f780d63d4c8fa80de97dd79c932bc35f4e
  Author: Mikhail Zakharov <zmish1993 at gmail.com>
  Date:   2025-05-01 (Thu, 01 May 2025)

  Changed paths:
    M lldb/include/lldb/Target/Memory.h
    M lldb/include/lldb/Target/Process.h
    M lldb/source/Commands/CommandObjectProcess.cpp
    M lldb/source/Commands/Options.td
    M lldb/source/Target/Memory.cpp
    M lldb/source/Target/Process.cpp
    M lldb/source/Target/TargetProperties.td
    M lldb/test/API/commands/settings/TestSettings.py
    A lldb/test/Shell/Expr/TestExprWithSideEffect.cpp
    A lldb/test/Shell/Expr/TestExprWithSideEffectOnConvenienceVar.cpp
    A lldb/test/Shell/Expr/TestExprWithSideEffectOnConvenienceVarWindows.cpp
    A lldb/test/Shell/Expr/TestProcessModificationIdOnExpr.cpp

  Log Message:
  -----------
  [lldb] Do not bump memory modificator ID when "internal" debugger memory is updated (#129092)

This change adds a setting `target.process.track-memory-cache-changes`.
Disabling this setting prevents invalidating and updating values in
`ValueObject::UpdateValueIfNeeded` when only "internal" debugger memory
is updated. Writing to "internal" debugger memory happens when, for
instance, expressions are evaluated by visualizers (pretty printers).
One of the examples when cache invalidation has a particularly heavy
impact is visualizations of some collections: in some collections
getting collection size is an expensive operation (it requires traversal
of the collection).
At the same time evaluating user expression with side effects (visible
to target, not only to debugger) will still bump memory ID because:

- If expression is evaluated via interpreter: it will cause write to
"non-internal" memory
- If expression is JIT-compiled: then to call the function LLDB will
write to "non-internal" stack memory

The downside of disabled `target.process.track-memory-cache-changes`
setting is that convenience variables won't reevaluate synthetic
children automatically.

---------

Co-authored-by: Mikhail Zakharov <mikhail.zakharov at jetbrains.com>



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