================
@@ -169,25 +173,28 @@ kern_return_t DNBArchMachARM64::GetGPRState(bool force) {
                          (thread_state_t)&m_state.context.gpr, &count);
   if (DNBLogEnabledForAny(LOG_THREAD)) {
     uint64_t *x = &m_state.context.gpr.__x[0];
+
+#if defined(DEBUGSERVER_IS_ARM64E)
     DNBLogThreaded("thread_get_state signed regs "
                    "\n   fp=%16.16llx"
                    "\n   lr=%16.16llx"
                    "\n   sp=%16.16llx"
                    "\n   pc=%16.16llx",
-#if __has_feature(ptrauth_calls) && defined(__LP64__)
                    reinterpret_cast<uint64_t>(m_state.context.gpr.__opaque_fp),
                    reinterpret_cast<uint64_t>(m_state.context.gpr.__opaque_lr),
                    reinterpret_cast<uint64_t>(m_state.context.gpr.__opaque_sp),
-                   reinterpret_cast<uint64_t>(m_state.context.gpr.__opaque_pc)
+                   
reinterpret_cast<uint64_t>(m_state.context.gpr.__opaque_pc));
 #else
-                   m_state.context.gpr.__fp,
-                   m_state.context.gpr.__lr, 
-                   m_state.context.gpr.__sp,
-                   m_state.context.gpr.__pc
+    DNBLogThreaded("thread_get_state signed regs "
+                   "\n   fp=%16.16llx"
+                   "\n   lr=%16.16llx"
+                   "\n   sp=%16.16llx"
+                   "\n   pc=%16.16llx",
+                   m_state.context.gpr.__fp, m_state.context.gpr.__lr,
+                   m_state.context.gpr.__sp, m_state.context.gpr.__pc);
----------------
bulbazord wrote:

Suggestion: The format string is the same between these two, why not pull out 
the common factor? 
```
const char *format = "thread_get_state signed regs\n   fp=%16.16llx\n   
lr=%16.16llx\n   sp=%16.16llx\n   pc=%16.16llx";
#if defined(...)
    DNBLogThreaded(format, ...);
#else
    DNBLogThreaded(format, ...);
#endif
```

You could also pull out the arguments.

https://github.com/llvm/llvm-project/pull/90808
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to