diff options
Diffstat (limited to 'lldb/tools/debugserver/source')
| -rw-r--r-- | lldb/tools/debugserver/source/MacOSX/MachThread.cpp | 53 | ||||
| -rw-r--r-- | lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp | 58 | ||||
| -rw-r--r-- | lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h | 16 |
3 files changed, 1 insertions, 126 deletions
diff --git a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp index a32161f4eb0..5a8b79a19e9 100644 --- a/lldb/tools/debugserver/source/MacOSX/MachThread.cpp +++ b/lldb/tools/debugserver/source/MacOSX/MachThread.cpp @@ -453,18 +453,7 @@ MachThread::ShouldStop(bool &step_more) bool MachThread::IsStepping() { -#if ENABLE_AUTO_STEPPING_OVER_BP - // Return true if this thread is currently being stepped. - // MachThread::ThreadWillResume currently determines this by looking if we - // have been asked to single step, or if we are at a breakpoint instruction - // and have been asked to resume. In the latter case we need to disable the - // breakpoint we are at, single step, re-enable and continue. - nub_state_t state = GetState(); - return ((state == eStateStepping) || - (state == eStateRunning && NUB_BREAK_ID_IS_VALID(CurrentBreakpoint()))); -#else return GetState() == eStateStepping; -#endif } @@ -493,52 +482,10 @@ MachThread::ThreadDidStop() // Update the basic information for a thread MachThread::GetBasicInfo(m_mach_port_number, &m_basic_info); -#if ENABLE_AUTO_STEPPING_OVER_BP - // See if we were at a breakpoint when we last resumed that we disabled, - // re-enable it. - nub_break_t breakID = CurrentBreakpoint(); - - if (NUB_BREAK_ID_IS_VALID(breakID)) - { - m_process->EnableBreakpoint(breakID); - if (m_basic_info.suspend_count > 0) - { - SetState(eStateSuspended); - } - else - { - // If we last were at a breakpoint and we single stepped, our state - // will be "running" to indicate we need to continue after stepping - // over the breakpoint instruction. If we step over a breakpoint - // instruction, we need to stop. - if (GetState() == eStateRunning) - { - // Leave state set to running so we will continue automatically - // from this breakpoint - } - else - { - SetState(eStateStopped); - } - } - } - else - { - if (m_basic_info.suspend_count > 0) - { - SetState(eStateSuspended); - } - else - { - SetState(eStateStopped); - } - } -#else if (m_basic_info.suspend_count > 0) SetState(eStateSuspended); else SetState(eStateStopped); -#endif return true; } diff --git a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp index a2fb43796d3..7a0ac7b1091 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp +++ b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.cpp @@ -422,51 +422,7 @@ DNBArchMachARM::ThreadDidStop() // We are single stepping, was this the primary thread? if (m_thread->IsStepping()) { - // Are we software single stepping? - if (NUB_BREAK_ID_IS_VALID(m_sw_single_step_break_id) || m_sw_single_step_itblock_break_count) - { - // Remove any software single stepping breakpoints that we have set - - // Do we have a normal software single step breakpoint? - if (NUB_BREAK_ID_IS_VALID(m_sw_single_step_break_id)) - { - DNBLogThreadedIf(LOG_STEP, "%s: removing software single step breakpoint (breakID=%d)", __FUNCTION__, m_sw_single_step_break_id); - success = m_thread->Process()->DisableBreakpoint(m_sw_single_step_break_id, true); - m_sw_single_step_break_id = INVALID_NUB_BREAK_ID; - } - - // Do we have any Thumb IT breakpoints? - if (m_sw_single_step_itblock_break_count > 0) - { - // See if we hit one of our Thumb IT breakpoints? - DNBBreakpoint *step_bp = m_thread->Process()->Breakpoints().FindByAddress(m_state.context.gpr.__pc); - - if (step_bp) - { - // We did hit our breakpoint, tell the breakpoint it was - // hit so that it can run its callback routine and fixup - // the PC. - DNBLogThreadedIf(LOG_STEP, "%s: IT software single step breakpoint hit (breakID=%u)", __FUNCTION__, step_bp->GetID()); - step_bp->BreakpointHit(m_thread->Process()->ProcessID(), m_thread->ThreadID()); - } - - // Remove all Thumb IT breakpoints - for (int i = 0; i < m_sw_single_step_itblock_break_count; i++) - { - if (NUB_BREAK_ID_IS_VALID(m_sw_single_step_itblock_break_id[i])) - { - DNBLogThreadedIf(LOG_STEP, "%s: removing IT software single step breakpoint (breakID=%d)", __FUNCTION__, m_sw_single_step_itblock_break_id[i]); - success = m_thread->Process()->DisableBreakpoint(m_sw_single_step_itblock_break_id[i], true); - m_sw_single_step_itblock_break_id[i] = INVALID_NUB_BREAK_ID; - } - } - m_sw_single_step_itblock_break_count = 0; - - } - - } - else - success = EnableHardwareSingleStep(false) == KERN_SUCCESS; + success = EnableHardwareSingleStep(false) == KERN_SUCCESS; } else { @@ -701,18 +657,6 @@ DNBArchMachARM::ConditionPassed(uint8_t condition, uint32_t cpsr) return false; } -nub_bool_t -DNBArchMachARM::BreakpointHit (nub_process_t pid, nub_thread_t tid, nub_break_t breakID, void *baton) -{ - nub_addr_t bkpt_pc = (nub_addr_t)baton; - DNBLogThreadedIf(LOG_STEP | LOG_VERBOSE, "%s(pid = %i, tid = %4.4x, breakID = %u, baton = %p): Setting PC to 0x%8.8x", __FUNCTION__, pid, tid, breakID, baton, bkpt_pc); - - DNBRegisterValue pc_value; - DNBThreadGetRegisterValueByID (pid, tid, REGISTER_SET_GENERIC, GENERIC_REGNUM_PC, &pc_value); - pc_value.value.uint32 = bkpt_pc; - return DNBThreadSetRegisterValueByID (pid, tid, REGISTER_SET_GENERIC, GENERIC_REGNUM_PC, &pc_value); -} - uint32_t DNBArchMachARM::NumSupportedHardwareBreakpoints() { diff --git a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h index 39f5088d22e..c13b607c2e9 100644 --- a/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h +++ b/lldb/tools/debugserver/source/MacOSX/arm/DNBArchImpl.h @@ -29,9 +29,6 @@ public: m_thread(thread), m_state(), m_hw_single_chained_step_addr(INVALID_NUB_ADDRESS), - m_sw_single_step_next_pc(INVALID_NUB_ADDRESS), - m_sw_single_step_break_id(INVALID_NUB_BREAK_ID), - m_sw_single_step_itblock_break_count(0), m_last_decode_pc(INVALID_NUB_ADDRESS), m_watchpoint_hw_index(-1), m_watchpoint_did_occur(false), @@ -41,8 +38,6 @@ public: #if defined (USE_ARM_DISASSEMBLER_FRAMEWORK) ThumbStaticsInit(&m_last_decode_thumb); #endif - for (int i = 0; i < kMaxNumThumbITBreakpoints; i++) - m_sw_single_step_itblock_break_id[i] = INVALID_NUB_BREAK_ID; } virtual ~DNBArchMachARM() @@ -100,7 +95,6 @@ protected: void DecodeITBlockInstructions(nub_addr_t curr_pc); #endif void EvaluateNextInstructionForSoftwareBreakpointSetup(nub_addr_t currentPC, uint32_t cpsr, bool currentPCIsThumb, nub_addr_t *nextPC, bool *nextPCIsThumb); - static nub_bool_t BreakpointHit (nub_process_t pid, nub_thread_t tid, nub_break_t breakID, void *baton); typedef enum RegisterSetTag { @@ -249,16 +243,6 @@ protected: State m_state; DBG m_dbg_save; nub_addr_t m_hw_single_chained_step_addr; - // Software single stepping support - nub_addr_t m_sw_single_step_next_pc; - nub_break_t m_sw_single_step_break_id; - nub_break_t m_sw_single_step_itblock_break_id[kMaxNumThumbITBreakpoints]; - nub_addr_t m_sw_single_step_itblock_break_count; - // Disassembler state -#if defined (USE_ARM_DISASSEMBLER_FRAMEWORK) - thumb_static_data_t m_last_decode_thumb; - arm_decoded_instruction_t m_last_decode_arm; -#endif nub_addr_t m_last_decode_pc; // The following member variables should be updated atomically. |

