[Lldb-commits] [lldb] [lldb] Step over non-lldb breakpoints (PR #174348)

Duncan McBain via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 30 07:28:32 PST 2026


================
@@ -842,28 +842,6 @@ bool DNBArchMachARM64::NotifyException(MachException::Data &exc) {
 
       return true;
     }
-    // detect a __builtin_debugtrap instruction pattern ("brk #0xf000")
-    // and advance the $pc past it, so that the user can continue execution.
-    // Generally speaking, this knowledge should be centralized in lldb,
-    // recognizing the builtin_trap instruction and knowing how to advance
-    // the pc past it, so that continue etc work.
-    if (exc.exc_data.size() == 2 && exc.exc_data[0] == EXC_ARM_BREAKPOINT) {
-      nub_addr_t pc = GetPC(INVALID_NUB_ADDRESS);
-      if (pc != INVALID_NUB_ADDRESS && pc > 0) {
-        DNBBreakpoint *bp =
-            m_thread->Process()->Breakpoints().FindByAddress(pc);
-        if (bp == nullptr) {
-          uint8_t insnbuf[4];
-          if (m_thread->Process()->ReadMemory(pc, 4, insnbuf) == 4) {
-            uint8_t builtin_debugtrap_insn[4] = {0x00, 0x00, 0x3e,
-                                                 0xd4}; // brk #0xf000
-            if (memcmp(insnbuf, builtin_debugtrap_insn, 4) == 0) {
-              SetPC(pc + 4);
-            }
-          }
-        }
-      }
-    }
----------------
DuncanMcBain wrote:

Nothing at all, I believe (looking at the execution flow in this bit of lldb) that with this code still active, my code won't run on Mac platforms, but as you say that can be pushed later. I'll undo this for now.

https://github.com/llvm/llvm-project/pull/174348


More information about the lldb-commits mailing list