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

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Mon Jan 5 06:40:19 PST 2026


================
@@ -138,6 +138,17 @@ class Architecture : public PluginInterface {
       std::shared_ptr<const UnwindPlan> current_unwindplan) {
     return lldb::UnwindPlanSP();
   }
+
+  /// Returns whether a given byte sequence is a valid breakpoint for the
+  /// architecture. Some architectures have breakpoint instructions that
+  /// have immediates that can take on any value, resulting in a family
+  /// of valid byte sequences. Bases the size comparison on the reference.
+  virtual bool IsValidBreakpointInstruction(llvm::ArrayRef<uint8_t> reference,
+                                            llvm::ArrayRef<uint8_t> observed) const {
+    if (reference.size() > observed.size())
----------------
DavidSpickett wrote:

I was going to ask why the check isn't more strict. Why it couldn't be "not equal".

I think part of the answer might be that the reference can be smaller than the observed if we had for example a single byte intel breakpoint, and are on a 4 byte instruction.

Is this the idea?

And if reference is fewer bytes than observed, we still want to check as it may be a small break encoding used to patch a larger instruction.

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


More information about the lldb-commits mailing list