[Lldb-commits] [lldb] [lldb] Step over non-lldb breakpoints (PR #174348)
Jonas Devlieghere via lldb-commits
lldb-commits at lists.llvm.org
Mon Feb 9 02:44:42 PST 2026
================
@@ -330,6 +330,43 @@ class Platform : public PluginInterface {
virtual std::vector<ArchSpec>
GetSupportedArchitectures(const ArchSpec &process_host_arch) = 0;
+ /// Get the bytes of the platform's software interrupt instruction. If there
+ /// are multiple possible encodings, for example where there are immediate
+ /// values encoded in the instruction, this will return the instruction with
+ /// those bits set as 0.
+ ///
+ /// \param[in] arch
+ /// The architecture of the inferior.
+ /// \param size_hint
+ /// A hint to disambiguate which instruction is used on platforms where
+ /// there are multiple interrupts with different sizes in the ISA (e.g
+ /// ARM Thumb, RISC-V).
+ ///
+ /// \return
+ /// The bytes of the interrupt instruction, with any immediate value
+ /// bits set to 0.
+ llvm::ArrayRef<uint8_t> SoftwareTrapOpcodeBytes(const ArchSpec &arch,
+ size_t size_hint = 0);
+
+ /// Get the suggested size hint for a trap instruction on the given target.
+ /// Some platforms have a compressed instruction set which can be used
+ /// instead of the "normal" encoding. This function attempts to determine
+ /// a size hint for the size of the instruction at address \a addr, and
+ /// return 0, 2 or 4, with 2 and 4 corresponding to the estimated size
+ /// and zero meaning no applicable hint.
+ ///
+ /// \param[in] target
+ /// The target of the inferior.
+ /// \param addr
+ /// The address of the instruction.
+ /// \param bytes
+ /// The raw bytes of the instruction.
+ /// \return
+ /// The estimated size in bytes of the instruction for this target at
+ /// the given address, or 0 if no estimate is available.
----------------
JDevlieghere wrote:
The website hasn't updated yet (not sure why), but I think this is a good example of what motivated https://github.com/llvm/llvm-project/pull/179898. We're documenting 3 "obvious" parameters to document the return value. Would we lose anything by dropping this and describing the return value in prose in the first paragraph?
```suggestion
/// Get the suggested size hint for a trap instruction on the given target.
/// Some platforms have a compressed instruction set which can be used
/// instead of the "normal" encoding. This function attempts to determine
/// a size hint for the size of the instruction at address \a addr, and
/// return 0, 2 or 4, with 2 and 4 corresponding to the estimated size
/// and zero meaning no applicable hint. Returns the estimated size in bytes
/// of the instruction for this target at the given address, or 0 if no
/// estimate is available.
```
https://github.com/llvm/llvm-project/pull/174348
More information about the lldb-commits
mailing list