[Lldb-commits] [lldb] [lldb] [NFC] [by AI] Add class documentation for the `PlugIn` base classes (PR #188619)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Thu Mar 26 03:53:59 PDT 2026
================
@@ -16,6 +16,37 @@
namespace lldb_private {
+/// \class Architecture Architecture.h "lldb/Core/Architecture.h"
+/// An abstract base class for architecture-specific behavior overrides.
+///
+/// Architecture plugins provide hooks to customize LLDB's behavior for
+/// specific CPU architectures in ways that go beyond the ABI. While ABI
+/// plugins handle calling conventions and register layouts, Architecture
+/// plugins handle architecture-specific quirks in:
+///
+/// - Instruction semantics (e.g., ARM IT blocks, delay slots)
+/// - Address manipulation (e.g., Thumb bit, pointer authentication)
+/// - Breakpoint placement (e.g., adjusting breakpoint addresses)
+/// - Function prologue handling (e.g., multiple entry points)
+/// - Stack unwinding customization
+/// - Memory tagging extensions (e.g., ARM MTE, SPARC ADI)
+/// - Dynamic register reconfiguration (e.g., SVE vector length changes)
+///
+/// Architecture plugins are typically selected based on the target's
+/// architecture and are instantiated as needed. Unlike ABI plugins which
+/// are tied to a process, Architecture plugins can be used in various
+/// contexts throughout LLDB.
+///
+/// The plugin is selected via PluginManager callbacks, typically when
+/// creating a Target or during execution context setup. Multiple architecture
+/// plugins may be registered, and the first one that supports the given
+/// ArchSpec will be used.
+///
+/// Implementations should be careful about:
+/// - Not duplicating functionality that belongs in ABI plugins
+/// - Ensuring thread-safety as methods may be called concurrently
+/// - Minimizing performance overhead as these methods are in hot paths
+/// - Only overriding methods when truly necessary for the architecture
----------------
DavidSpickett wrote:
These may be true but I do not think they are significant enough to include.
These are rules one could apply to almost any selection of classes, and I would hope that developers learn to apply them generically, in code they write, and code they review.
https://github.com/llvm/llvm-project/pull/188619
More information about the lldb-commits
mailing list