[Lldb-commits] [lldb] [lldb][NFC] Remove unused macro ENABLE_MEMORY_CACHING (PR #142231)
via lldb-commits
lldb-commits at lists.llvm.org
Fri May 30 15:52:40 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-lldb
Author: Alex Langford (bulbazord)
<details>
<summary>Changes</summary>
This macro does not do what is described. The only thing it actually does control is whether or not the process's memory cache gets flushed when writing to an address. It does not override the setting `target.process.disable-memory-cache`.
Instead of making it work as intended, I chose to remove the macro. I don't see much value in being able to override the setting with a preprocessor macro.
---
Full diff: https://github.com/llvm/llvm-project/pull/142231.diff
1 Files Affected:
- (modified) lldb/source/Target/Process.cpp (-12)
``````````diff
diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp
index c377feec86c16..84299f5f9a775 100644
--- a/lldb/source/Target/Process.cpp
+++ b/lldb/source/Target/Process.cpp
@@ -80,16 +80,6 @@ using namespace lldb;
using namespace lldb_private;
using namespace std::chrono;
-// Comment out line below to disable memory caching, overriding the process
-// setting target.process.disable-memory-cache
-#define ENABLE_MEMORY_CACHING
-
-#ifdef ENABLE_MEMORY_CACHING
-#define DISABLE_MEM_CACHE_DEFAULT false
-#else
-#define DISABLE_MEM_CACHE_DEFAULT true
-#endif
-
class ProcessOptionValueProperties
: public Cloneable<ProcessOptionValueProperties, OptionValueProperties> {
public:
@@ -2297,9 +2287,7 @@ size_t Process::WriteMemory(addr_t addr, const void *buf, size_t size,
if (ABISP abi_sp = GetABI())
addr = abi_sp->FixAnyAddress(addr);
-#if defined(ENABLE_MEMORY_CACHING)
m_memory_cache.Flush(addr, size);
-#endif
if (buf == nullptr || size == 0)
return 0;
``````````
</details>
https://github.com/llvm/llvm-project/pull/142231
More information about the lldb-commits
mailing list