================
@@ -161,21 +162,51 @@ static ProcessSP CreateProcess(lldb::TargetSP target_sp) {
return process_sp;
}
-TEST_F(MemoryTest, TesetMemoryCacheRead) {
- ArchSpec arch("x86_64-apple-macosx-");
+// Builds the debugger, target and process a cache test needs and keeps them
+// alive.
+namespace {
+class CacheTestProcess {
+public:
+ explicit CacheTestProcess(const char *triple = "arm64-apple-macosx")
+ : m_arch(triple) {
+ Platform::SetHostPlatform(
+ PlatformRemoteMacOSX::CreateInstance(true, &m_arch));
+ m_debugger_sp = Debugger::CreateInstance();
+ if (!m_debugger_sp)
+ return;
+ m_target_sp = CreateTarget(m_debugger_sp, m_arch);
+ if (!m_target_sp)
+ return;
+ m_process_sp = CreateProcess(m_target_sp);
+ m_process = static_cast<DummyProcess *>(m_process_sp.get());
+ }
- Platform::SetHostPlatform(PlatformRemoteMacOSX::CreateInstance(true, &arch));
+ DummyProcess *process() const { return m_process; }
+ // Widened from uint32_t so tests can do address arithmetic with it.
----------------
qiyao wrote:
Correct, there is no widening. There are two functions with that name:
`Process::GetMemoryCacheLineSize` returns `uint64_t` and
`MemoryCache::GetMemoryCacheLineSize` returns `uint32_t`. The helper calls the
former, but I wrote the comment thinking of the latter. Comment remove.
https://github.com/llvm/llvm-project/pull/221015
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits