================
@@ -1694,6 +1694,29 @@ class CommandObjectMemoryRegion : public 
CommandObjectParsed {
     MemoryRegionInfo::OptionalBool is_shadow_stack = 
range_info.IsShadowStack();
     if (is_shadow_stack == MemoryRegionInfo::OptionalBool::eYes)
       result.AppendMessage("shadow stack: yes");
+    if (std::optional<unsigned> protection_key =
+            range_info.GetProtectionKey()) {
+      result.AppendMessageWithFormat("protection key: %" PRIu32,
+                                     *protection_key);
+
+      if (const lldb::ABISP &abi = target.GetProcessSP()->GetABI()) {
+        uint32_t base_permissions = range_info.GetLLDBPermissions();
+        if (auto permissions =
+                abi->GetMemoryPermissions(*m_exe_ctx.GetRegisterContext(),
+                                          *protection_key, base_permissions)) {
+          result.AppendMessageWithFormatv(
----------------
DavidSpickett wrote:

Confusingly, WithFormatV *does* add a newline for you but WithFormat does not. 
Here were are happy to have the newline so FormatV is fine.

I'm going to look at migrating a lot of the WithFormat calls because a lot of 
them include a newline anyway.

https://github.com/llvm/llvm-project/pull/184115
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to