[all-commits] [llvm/llvm-project] 7d01b8: Reland "[lldb] Do not bump memory modificator ID w...

David Spickett via All-commits all-commits at lists.llvm.org
Fri May 2 06:01:06 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 7d01b85c2a0aa8bc91f731cfeb2a7b6885b8d04a
      https://github.com/llvm/llvm-project/commit/7d01b85c2a0aa8bc91f731cfeb2a7b6885b8d04a
  Author: David Spickett <david.spickett at linaro.org>
  Date:   2025-05-02 (Fri, 02 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:
  -----------
  Reland "[lldb] Do not bump memory modificator ID when "internal" debugger memory is updated (#129092)"

This reverts commit daa4061d61216456baa83ab404e096200e327fb4.

Original PR https://github.com/llvm/llvm-project/pull/129092.

I have restricted the test to X86 Windows because it turns out the only
reason that `expr x.get()` would change m_memory_id is that on x86 we
have to write the return address to the stack in ABIWindows_X86_64::PrepareTrivialCall:
```
  // Save return address onto the stack
  if (!process_sp->WritePointerToMemory(sp, return_addr, error))
    return false;
```

This is not required on AArch64 so m_memory_id was not changed:
```
(lldb) expr x.get()
(int) $0 = 0
(lldb) process status -d
Process 15316 stopped
* thread #1, stop reason = Exception 0x80000003 encountered at address 0x7ff764a31034
    frame #0: 0x00007ff764a31038 TestProcessModificationIdOnExpr.cpp.tmp`main at TestProcessModificationIdOnExpr.cpp:35
   32     __builtin_debugtrap();
   33     __builtin_debugtrap();
   34     return 0;
-> 35   }
   36
   37   // CHECK-LABEL: process status -d
   38   // CHECK: m_stop_id: 2
ProcessModID:
  m_stop_id: 3
  m_last_natural_stop_id: 0
  m_resume_id: 0
  m_memory_id: 0
```

Really we should find a better way to force a memory write here, but
I can't think of one right now.



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