[Lldb-commits] [lldb] c48ccb6 - Simplify conditionals in DNBArchMachARM64::EnableHardwareSingleStep

Jason Molenda via lldb-commits lldb-commits at lists.llvm.org
Mon Jun 29 14:05:11 PDT 2020


Author: Jason Molenda
Date: 2020-06-29T14:04:44-07:00
New Revision: c48ccb6b4e513e467b22fab1de57a25c23af4361

URL: https://github.com/llvm/llvm-project/commit/c48ccb6b4e513e467b22fab1de57a25c23af4361
DIFF: https://github.com/llvm/llvm-project/commit/c48ccb6b4e513e467b22fab1de57a25c23af4361.diff

LOG: Simplify conditionals in DNBArchMachARM64::EnableHardwareSingleStep

Added: 
    

Modified: 
    lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
index 3e7bda88e6af..7e1af7a75021 100644
--- a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
+++ b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp
@@ -590,23 +590,21 @@ kern_return_t DNBArchMachARM64::EnableHardwareSingleStep(bool enable) {
     return err.Status();
   }
 
-  if (enable) {
-    DNBLogThreadedIf(LOG_STEP,
-                     "%s: Setting MDSCR_EL1 Single Step bit at pc 0x%llx",
 #if defined(__LP64__)
-                     __FUNCTION__, (uint64_t)arm_thread_state64_get_pc (m_state.context.gpr));
+  uint64_t pc = arm_thread_state64_get_pc (m_state.context.gpr);
 #else
-                     __FUNCTION__, (uint64_t)m_state.context.gpr.__pc);
+  uint64_t pc = m_state.context.gpr.__pc;
 #endif
+
+  if (enable) {
+    DNBLogThreadedIf(LOG_STEP,
+                     "%s: Setting MDSCR_EL1 Single Step bit at pc 0x%llx",
+                     __FUNCTION__, pc);
     m_state.dbg.__mdscr_el1 |= SS_ENABLE;
   } else {
     DNBLogThreadedIf(LOG_STEP,
                      "%s: Clearing MDSCR_EL1 Single Step bit at pc 0x%llx",
-#if defined(__LP64__)
-                     __FUNCTION__, (uint64_t)arm_thread_state64_get_pc (m_state.context.gpr));
-#else
-                     __FUNCTION__, (uint64_t)m_state.context.gpr.__pc);
-#endif
+                     __FUNCTION__, pc);
     m_state.dbg.__mdscr_el1 &= ~(SS_ENABLE);
   }
 


        


More information about the lldb-commits mailing list