[all-commits] [llvm/llvm-project] acae69: [lldb] Add new LLDB setting: use-source-cache

Emre Kultursay via All-commits all-commits at lists.llvm.org
Mon Apr 20 07:30:10 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: acae69d08c88b701e25318f8d4100f5542c44407
      https://github.com/llvm/llvm-project/commit/acae69d08c88b701e25318f8d4100f5542c44407
  Author: Emre Kultursay <emrekultursay at google.com>
  Date:   2020-04-20 (Mon, 20 Apr 2020)

  Changed paths:
    M lldb/include/lldb/API/SBDebugger.h
    M lldb/include/lldb/Core/Debugger.h
    M lldb/include/lldb/Core/SourceManager.h
    M lldb/source/API/SBDebugger.cpp
    M lldb/source/Core/CoreProperties.td
    M lldb/source/Core/Debugger.cpp
    M lldb/source/Core/SourceManager.cpp

  Log Message:
  -----------
  [lldb] Add new LLDB setting: use-source-cache

Summary:
LLDB memory-maps large source files, and at the same time, caches
all source files in the Source Cache.

On Windows, memory-mapped source files are not writeable, causing
bad user experience in IDEs (such as errors when saving edited files).
IDEs should have the ability to disable the Source Cache at LLDB
startup, so that users can edit source files while debugging.

Bug: llvm.org/PR45310

Reviewers: labath, JDevlieghere, jingham

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76804


  Commit: 1f820fa4feda34d25e62762392c50049e5282330
      https://github.com/llvm/llvm-project/commit/1f820fa4feda34d25e62762392c50049e5282330
  Author: Emre Kultursay <emrekultursay at google.com>
  Date:   2020-04-20 (Mon, 20 Apr 2020)

  Changed paths:
    M lldb/source/Core/SourceManager.cpp
    M lldb/unittests/Core/CMakeLists.txt
    A lldb/unittests/Core/SourceManagerTest.cpp

  Log Message:
  -----------
  [lldb] Fix SourceManager::SourceFileCache insertion

Summary:
Lookup and subsequent insert was done using uninitialized
FileSpec object, which caused the cache to be a no-op.

Bug: llvm.org/PR45310

Depends on D76804.

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: mgorny, jingham, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76805


  Commit: 865996ddf626a4d6e2a9c401b1fffc731a1946aa
      https://github.com/llvm/llvm-project/commit/865996ddf626a4d6e2a9c401b1fffc731a1946aa
  Author: Emre Kultursay <emrekultursay at google.com>
  Date:   2020-04-20 (Mon, 20 Apr 2020)

  Changed paths:
    M lldb/include/lldb/Core/SourceManager.h
    M lldb/source/Core/SourceManager.cpp
    A lldb/test/API/commands/settings/use_source_cache/Makefile
    A lldb/test/API/commands/settings/use_source_cache/TestUseSourceCache.py
    A lldb/test/API/commands/settings/use_source_cache/main.cpp

  Log Message:
  -----------
  [lldb] Remove m_last_file_sp from SourceManager

Summary:
...and replace it with m_last_file_spec instead.

When Source Cache is enabled, the value stored in m_last_file_sp is
already in the Source Cache, and caching it again in SourceManager
brings no extra benefit. All we need is to "remember" the last used
file, and FileSpec can serve the same purpose.

When Source Cache is disabled, the user explicitly requested no caching
of source files, and therefore, m_last_file_sp should NOT be used.

Bug: llvm.org/PR45310

Depends on D76805.

Reviewers: labath, jingham

Reviewed By: jingham

Subscribers: labath, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D76806


Compare: https://github.com/llvm/llvm-project/compare/9cd9f3f1b8b7...865996ddf626


More information about the All-commits mailing list