From 299c0c1c09ba8661cf58f8b5b11c5f69975645a5 Mon Sep 17 00:00:00 2001 From: Jim Ingham Date: Fri, 15 Feb 2013 02:06:30 +0000 Subject: [PATCH] A little cleanup. {Disable/Enable}Breakpoint actually disables/enables BreakpointSites not breakpoints, it is confusing to have it not named appropriately. Also in StopInfoMachException, we aren't testing for software or not software, just whether the thing is a breakpoint we set. So don't use "software"... llvm-svn: 175241 --- lldb/include/lldb/Target/Process.h | 4 ++-- .../Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp | 4 ++-- lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h | 4 ++-- .../Plugins/Process/Utility/StopInfoMachException.cpp | 18 +++++++++--------- .../Plugins/Process/gdb-remote/ProcessGDBRemote.cpp | 14 +++++++------- .../Plugins/Process/gdb-remote/ProcessGDBRemote.h | 4 ++-- lldb/source/Target/Process.cpp | 12 ++++++------ lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp | 6 +++--- 8 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lldb/include/lldb/Target/Process.h b/lldb/include/lldb/Target/Process.h index 3aefd95..ea163fb 100644 --- a/lldb/include/lldb/Target/Process.h +++ b/lldb/include/lldb/Target/Process.h @@ -3110,7 +3110,7 @@ public: GetSoftwareBreakpointTrapOpcode (BreakpointSite* bp_site); virtual Error - EnableBreakpoint (BreakpointSite *bp_site) + EnableBreakpointSite (BreakpointSite *bp_site) { Error error; error.SetErrorStringWithFormat("error: %s does not support enabling breakpoints", GetShortPluginName()); @@ -3119,7 +3119,7 @@ public: virtual Error - DisableBreakpoint (BreakpointSite *bp_site) + DisableBreakpointSite (BreakpointSite *bp_site) { Error error; error.SetErrorStringWithFormat("error: %s does not support disabling breakpoints", GetShortPluginName()); diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp index 7d33cce..da1e059 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp @@ -593,7 +593,7 @@ ProcessKDP::DoDeallocateMemory (lldb::addr_t addr) } Error -ProcessKDP::EnableBreakpoint (BreakpointSite *bp_site) +ProcessKDP::EnableBreakpointSite (BreakpointSite *bp_site) { if (m_comm.LocalBreakpointsAreSupported ()) { @@ -616,7 +616,7 @@ ProcessKDP::EnableBreakpoint (BreakpointSite *bp_site) } Error -ProcessKDP::DisableBreakpoint (BreakpointSite *bp_site) +ProcessKDP::DisableBreakpointSite (BreakpointSite *bp_site) { if (m_comm.LocalBreakpointsAreSupported ()) { diff --git a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h index bc26f6e..520c62e 100644 --- a/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h +++ b/lldb/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h @@ -174,10 +174,10 @@ public: // Process Breakpoints //---------------------------------------------------------------------- virtual lldb_private::Error - EnableBreakpoint (lldb_private::BreakpointSite *bp_site); + EnableBreakpointSite (lldb_private::BreakpointSite *bp_site); virtual lldb_private::Error - DisableBreakpoint (lldb_private::BreakpointSite *bp_site); + DisableBreakpointSite (lldb_private::BreakpointSite *bp_site); //---------------------------------------------------------------------- // Process Watchpoints diff --git a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp index 77bc711..58b6a4e 100644 --- a/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp +++ b/lldb/source/Plugins/Process/Utility/StopInfoMachException.cpp @@ -345,8 +345,8 @@ StopInfoMachException::CreateStopReasonWithMachException case 6: // EXC_BREAKPOINT { - bool is_software_breakpoint = false; - bool is_trace_if_software_breakpoint_missing = false; + bool is_actual_breakpoint = false; + bool is_trace_if_actual_breakpoint_missing = false; switch (cpu) { case llvm::Triple::x86: @@ -375,9 +375,9 @@ StopInfoMachException::CreateStopReasonWithMachException { // KDP returns EXC_I386_BPTFLT for trace breakpoints if (exc_code == 3) - is_trace_if_software_breakpoint_missing = true; + is_trace_if_actual_breakpoint_missing = true; - is_software_breakpoint = true; + is_actual_breakpoint = true; if (!pc_already_adjusted) pc_decrement = 1; } @@ -385,7 +385,7 @@ StopInfoMachException::CreateStopReasonWithMachException case llvm::Triple::ppc: case llvm::Triple::ppc64: - is_software_breakpoint = exc_code == 1; // EXC_PPC_BREAKPOINT + is_actual_breakpoint = exc_code == 1; // EXC_PPC_BREAKPOINT break; case llvm::Triple::arm: @@ -410,8 +410,8 @@ StopInfoMachException::CreateStopReasonWithMachException } else if (exc_code == 1) // EXC_ARM_BREAKPOINT { - is_software_breakpoint = true; - is_trace_if_software_breakpoint_missing = true; + is_actual_breakpoint = true; + is_trace_if_actual_breakpoint_missing = true; } break; @@ -419,7 +419,7 @@ StopInfoMachException::CreateStopReasonWithMachException break; } - if (is_software_breakpoint) + if (is_actual_breakpoint) { RegisterContextSP reg_ctx_sp (thread.GetRegisterContext()); addr_t pc = reg_ctx_sp->GetPC() - pc_decrement; @@ -447,7 +447,7 @@ StopInfoMachException::CreateStopReasonWithMachException } // Don't call this a trace if we weren't single stepping this thread. - if (is_trace_if_software_breakpoint_missing && thread.GetTemporaryResumeState() == eStateStepping) + if (is_trace_if_actual_breakpoint_missing && thread.GetTemporaryResumeState() == eStateStepping) { return StopInfo::CreateStopReasonToTrace (thread); } diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp index 96662f6..07f4d7b 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp @@ -2172,7 +2172,7 @@ ProcessGDBRemote::PutSTDIN (const char *src, size_t src_len, Error &error) } Error -ProcessGDBRemote::EnableBreakpoint (BreakpointSite *bp_site) +ProcessGDBRemote::EnableBreakpointSite (BreakpointSite *bp_site) { Error error; assert (bp_site != NULL); @@ -2181,12 +2181,12 @@ ProcessGDBRemote::EnableBreakpoint (BreakpointSite *bp_site) user_id_t site_id = bp_site->GetID(); const addr_t addr = bp_site->GetLoadAddress(); if (log) - log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %" PRIu64 ") address = 0x%" PRIx64, site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::EnableBreakpointSite (size_id = %" PRIu64 ") address = 0x%" PRIx64, site_id, (uint64_t)addr); if (bp_site->IsEnabled()) { if (log) - log->Printf ("ProcessGDBRemote::EnableBreakpoint (size_id = %" PRIu64 ") address = 0x%" PRIx64 " -- SUCCESS (already enabled)", site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::EnableBreakpointSite (size_id = %" PRIu64 ") address = 0x%" PRIx64 " -- SUCCESS (already enabled)", site_id, (uint64_t)addr); return error; } else @@ -2224,7 +2224,7 @@ ProcessGDBRemote::EnableBreakpoint (BreakpointSite *bp_site) if (log) { const char *err_string = error.AsCString(); - log->Printf ("ProcessGDBRemote::EnableBreakpoint() error for breakpoint at 0x%8.8" PRIx64 ": %s", + log->Printf ("ProcessGDBRemote::EnableBreakpointSite () error for breakpoint at 0x%8.8" PRIx64 ": %s", bp_site->GetLoadAddress(), err_string ? err_string : "NULL"); } @@ -2235,7 +2235,7 @@ ProcessGDBRemote::EnableBreakpoint (BreakpointSite *bp_site) } Error -ProcessGDBRemote::DisableBreakpoint (BreakpointSite *bp_site) +ProcessGDBRemote::DisableBreakpointSite (BreakpointSite *bp_site) { Error error; assert (bp_site != NULL); @@ -2243,7 +2243,7 @@ ProcessGDBRemote::DisableBreakpoint (BreakpointSite *bp_site) user_id_t site_id = bp_site->GetID(); LogSP log (ProcessGDBRemoteLog::GetLogIfAllCategoriesSet(GDBR_LOG_BREAKPOINTS)); if (log) - log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %" PRIu64 ") addr = 0x%8.8" PRIx64, site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::DisableBreakpointSite (site_id = %" PRIu64 ") addr = 0x%8.8" PRIx64, site_id, (uint64_t)addr); if (bp_site->IsEnabled()) { @@ -2272,7 +2272,7 @@ ProcessGDBRemote::DisableBreakpoint (BreakpointSite *bp_site) else { if (log) - log->Printf ("ProcessGDBRemote::DisableBreakpoint (site_id = %" PRIu64 ") addr = 0x%8.8" PRIx64 " -- SUCCESS (already disabled)", site_id, (uint64_t)addr); + log->Printf ("ProcessGDBRemote::DisableBreakpointSite (site_id = %" PRIu64 ") addr = 0x%8.8" PRIx64 " -- SUCCESS (already disabled)", site_id, (uint64_t)addr); return error; } diff --git a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h index 7684607..957a84f 100644 --- a/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h +++ b/lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h @@ -193,10 +193,10 @@ public: // Process Breakpoints //---------------------------------------------------------------------- virtual lldb_private::Error - EnableBreakpoint (lldb_private::BreakpointSite *bp_site); + EnableBreakpointSite (lldb_private::BreakpointSite *bp_site); virtual lldb_private::Error - DisableBreakpoint (lldb_private::BreakpointSite *bp_site); + DisableBreakpointSite (lldb_private::BreakpointSite *bp_site); //---------------------------------------------------------------------- // Process Watchpoints diff --git a/lldb/source/Target/Process.cpp b/lldb/source/Target/Process.cpp index d06a184..036da88 100644 --- a/lldb/source/Target/Process.cpp +++ b/lldb/source/Target/Process.cpp @@ -1948,7 +1948,7 @@ Process::DisableAllBreakpointSites () size_t num_sites = m_breakpoint_site_list.GetSize(); for (size_t i = 0; i < num_sites; i++) { - DisableBreakpoint (m_breakpoint_site_list.GetByIndex(i).get()); + DisableBreakpointSite (m_breakpoint_site_list.GetByIndex(i).get()); } } @@ -1971,7 +1971,7 @@ Process::DisableBreakpointSiteByID (lldb::user_id_t break_id) if (bp_site_sp) { if (bp_site_sp->IsEnabled()) - error = DisableBreakpoint (bp_site_sp.get()); + error = DisableBreakpointSite (bp_site_sp.get()); } else { @@ -1989,7 +1989,7 @@ Process::EnableBreakpointSiteByID (lldb::user_id_t break_id) if (bp_site_sp) { if (!bp_site_sp->IsEnabled()) - error = EnableBreakpoint (bp_site_sp.get()); + error = EnableBreakpointSite (bp_site_sp.get()); } else { @@ -2022,7 +2022,7 @@ Process::CreateBreakpointSite (const BreakpointLocationSP &owner, bool use_hardw bp_site_sp.reset (new BreakpointSite (&m_breakpoint_site_list, owner, load_addr, use_hardware)); if (bp_site_sp) { - if (EnableBreakpoint (bp_site_sp.get()).Success()) + if (EnableBreakpointSite (bp_site_sp.get()).Success()) { owner->SetBreakpointSite (bp_site_sp); return m_breakpoint_site_list.Add (bp_site_sp); @@ -2041,7 +2041,7 @@ Process::RemoveOwnerFromBreakpointSite (lldb::user_id_t owner_id, lldb::user_id_ uint32_t num_owners = bp_site_sp->RemoveOwner (owner_id, owner_loc_id); if (num_owners == 0) { - DisableBreakpoint(bp_site_sp.get()); + DisableBreakpointSite (bp_site_sp.get()); m_breakpoint_site_list.RemoveByAddress(bp_site_sp->GetLoadAddress()); } } @@ -2175,7 +2175,7 @@ Process::DisableSoftwareBreakpoint (BreakpointSite *bp_site) addr_t bp_addr = bp_site->GetLoadAddress(); lldb::user_id_t breakID = bp_site->GetID(); if (log) - log->Printf ("Process::DisableBreakpoint (breakID = %" PRIu64 ") addr = 0x%" PRIx64, breakID, (uint64_t)bp_addr); + log->Printf ("Process::DisableSoftwareBreakpoint (breakID = %" PRIu64 ") addr = 0x%" PRIx64, breakID, (uint64_t)bp_addr); if (bp_site->IsHardware()) { diff --git a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp index da67eae..502907c 100644 --- a/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp +++ b/lldb/source/Target/ThreadPlanStepOverBreakpoint.cpp @@ -99,7 +99,7 @@ ThreadPlanStepOverBreakpoint::WillResume (StateType resume_state, bool current_p { BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByAddress (m_breakpoint_addr)); if (bp_site_sp && bp_site_sp->IsEnabled()) - m_thread.GetProcess()->DisableBreakpoint (bp_site_sp.get()); + m_thread.GetProcess()->DisableBreakpointSite (bp_site_sp.get()); } return true; } @@ -109,7 +109,7 @@ ThreadPlanStepOverBreakpoint::WillStop () { BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByAddress (m_breakpoint_addr)); if (bp_site_sp) - m_thread.GetProcess()->EnableBreakpoint (bp_site_sp.get()); + m_thread.GetProcess()->EnableBreakpointSite (bp_site_sp.get()); return true; } @@ -132,7 +132,7 @@ ThreadPlanStepOverBreakpoint::MischiefManaged () // Otherwise, re-enable the breakpoint we were stepping over, and we're done. BreakpointSiteSP bp_site_sp (m_thread.GetProcess()->GetBreakpointSiteList().FindByAddress (m_breakpoint_addr)); if (bp_site_sp) - m_thread.GetProcess()->EnableBreakpoint (bp_site_sp.get()); + m_thread.GetProcess()->EnableBreakpointSite (bp_site_sp.get()); ThreadPlan::MischiefManaged (); return true; } -- 2.7.4