[Lldb-commits] [lldb] r175241 - A little cleanup. {Disable/Enable}Breakpoint actually disables/enables BreakpointSites not breakpoints, it is confusing
Jim Ingham
jingham at apple.com
Thu Feb 14 18:06:30 PST 2013
Author: jingham
Date: Thu Feb 14 20:06:30 2013
New Revision: 175241
URL: http://llvm.org/viewvc/llvm-project?rev=175241&view=rev
Log:
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"...
Modified:
lldb/trunk/include/lldb/Target/Process.h
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
lldb/trunk/source/Target/Process.cpp
lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp
Modified: lldb/trunk/include/lldb/Target/Process.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Process.h?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Target/Process.h (original)
+++ lldb/trunk/include/lldb/Target/Process.h Thu Feb 14 20:06:30 2013
@@ -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());
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.cpp Thu Feb 14 20:06:30 2013
@@ -593,7 +593,7 @@ ProcessKDP::DoDeallocateMemory (lldb::ad
}
Error
-ProcessKDP::EnableBreakpoint (BreakpointSite *bp_site)
+ProcessKDP::EnableBreakpointSite (BreakpointSite *bp_site)
{
if (m_comm.LocalBreakpointsAreSupported ())
{
@@ -616,7 +616,7 @@ ProcessKDP::EnableBreakpoint (Breakpoint
}
Error
-ProcessKDP::DisableBreakpoint (BreakpointSite *bp_site)
+ProcessKDP::DisableBreakpointSite (BreakpointSite *bp_site)
{
if (m_comm.LocalBreakpointsAreSupported ())
{
Modified: lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h (original)
+++ lldb/trunk/source/Plugins/Process/MacOSX-Kernel/ProcessKDP.h Thu Feb 14 20:06:30 2013
@@ -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
Modified: lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp (original)
+++ lldb/trunk/source/Plugins/Process/Utility/StopInfoMachException.cpp Thu Feb 14 20:06:30 2013
@@ -345,8 +345,8 @@ StopInfoMachException::CreateStopReasonW
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::CreateStopReasonW
{
// 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::CreateStopReasonW
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::CreateStopReasonW
}
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::CreateStopReasonW
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::CreateStopReasonW
}
// 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);
}
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp Thu Feb 14 20:06:30 2013
@@ -2172,7 +2172,7 @@ ProcessGDBRemote::PutSTDIN (const char *
}
Error
-ProcessGDBRemote::EnableBreakpoint (BreakpointSite *bp_site)
+ProcessGDBRemote::EnableBreakpointSite (BreakpointSite *bp_site)
{
Error error;
assert (bp_site != NULL);
@@ -2181,12 +2181,12 @@ ProcessGDBRemote::EnableBreakpoint (Brea
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 (Brea
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 (Brea
}
Error
-ProcessGDBRemote::DisableBreakpoint (BreakpointSite *bp_site)
+ProcessGDBRemote::DisableBreakpointSite (BreakpointSite *bp_site)
{
Error error;
assert (bp_site != NULL);
@@ -2243,7 +2243,7 @@ ProcessGDBRemote::DisableBreakpoint (Bre
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 (Bre
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;
}
Modified: lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h (original)
+++ lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.h Thu Feb 14 20:06:30 2013
@@ -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
Modified: lldb/trunk/source/Target/Process.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Process.cpp?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/source/Target/Process.cpp (original)
+++ lldb/trunk/source/Target/Process.cpp Thu Feb 14 20:06:30 2013
@@ -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
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:
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 Bre
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 (
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 (Brea
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())
{
Modified: lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp?rev=175241&r1=175240&r2=175241&view=diff
==============================================================================
--- lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp (original)
+++ lldb/trunk/source/Target/ThreadPlanStepOverBreakpoint.cpp Thu Feb 14 20:06:30 2013
@@ -99,7 +99,7 @@ ThreadPlanStepOverBreakpoint::WillResume
{
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::MischiefMa
// 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;
}
More information about the lldb-commits
mailing list