From c48ccb6b4e513e467b22fab1de57a25c23af4361 Mon Sep 17 00:00:00 2001 From: Jason Molenda Date: Mon, 29 Jun 2020 14:04:44 -0700 Subject: [PATCH] Simplify conditionals in DNBArchMachARM64::EnableHardwareSingleStep --- .../source/MacOSX/arm64/DNBArchImplARM64.cpp | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp b/lldb/tools/debugserver/source/MacOSX/arm64/DNBArchImplARM64.cpp index 3e7bda8..7e1af7a 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); } -- 2.7.4