[Lldb-commits] [lldb] [lldb][Linux] Read memory protection keys for memory regions (PR #182246)

David Spickett via lldb-commits lldb-commits at lists.llvm.org
Tue Mar 24 08:14:56 PDT 2026


================
@@ -29,11 +29,13 @@ class MemoryRegionInfo {
                    OptionalBool execute, OptionalBool shared,
                    OptionalBool mapped, ConstString name, OptionalBool flash,
                    lldb::offset_t blocksize, OptionalBool memory_tagged,
-                   OptionalBool stack_memory, OptionalBool shadow_stack)
+                   OptionalBool stack_memory, OptionalBool shadow_stack,
+                   std::optional<unsigned> protection_key)
----------------
DavidSpickett wrote:

Which should be fine given that that allows for 4 billion protection keys. Unless Linux adds flags or namespacing or whatever in there.

The man page is not strict about what it is, but a reasonable reading says that it's an integer and will remain so: https://man7.org/linux/man-pages/man5/proc_pid_smaps.5.html

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


More information about the lldb-commits mailing list