diff options
author | Jim Ingham <jingham@apple.com> | 2012-02-08 05:23:15 +0000 |
---|---|---|
committer | Jim Ingham <jingham@apple.com> | 2012-02-08 05:23:15 +0000 |
commit | e6bc6cb96fbcbd77a80c8cb831a2bba2b4073cac (patch) | |
tree | 486e94a3918ba4ec21b6205d6dc1f7ae3d01cf81 /lldb/tools/driver/Driver.cpp | |
parent | fec9f8edb788aaca0d7b86f5b6d4163e5a6faa41 (diff) | |
download | bcm5719-llvm-e6bc6cb96fbcbd77a80c8cb831a2bba2b4073cac.tar.gz bcm5719-llvm-e6bc6cb96fbcbd77a80c8cb831a2bba2b4073cac.zip |
Send Breakpoint Changed events for all the relevant changes to breakpoints.
Also, provide and use accessors for the thread options on breakpoints so we
can control sending the appropriate events.
llvm-svn: 150057
Diffstat (limited to 'lldb/tools/driver/Driver.cpp')
-rw-r--r-- | lldb/tools/driver/Driver.cpp | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/lldb/tools/driver/Driver.cpp b/lldb/tools/driver/Driver.cpp index aaf582687df..5808f5f9c53 100644 --- a/lldb/tools/driver/Driver.cpp +++ b/lldb/tools/driver/Driver.cpp @@ -22,6 +22,7 @@ #include <string> #include "IOChannel.h" +#include "lldb/API/SBBreakpoint.h" #include "lldb/API/SBCommandInterpreter.h" #include "lldb/API/SBCommandReturnObject.h" #include "lldb/API/SBCommunication.h" @@ -824,6 +825,46 @@ Driver::UpdateSelectedThread () } } +// This function handles events that were broadcast by the process. +void +Driver::HandleBreakpointEvent (const SBEvent &event) +{ + using namespace lldb; + const uint32_t event_type = SBBreakpoint::GetBreakpointEventTypeFromEvent (event); + + if (event_type & eBreakpointEventTypeAdded + || event_type & eBreakpointEventTypeRemoved + || event_type & eBreakpointEventTypeEnabled + || event_type & eBreakpointEventTypeDisabled + || event_type & eBreakpointEventTypeCommandChanged + || event_type & eBreakpointEventTypeConditionChanged + || event_type & eBreakpointEventTypeIgnoreChanged + || event_type & eBreakpointEventTypeLocationsResolved) + { + // Don't do anything about these events, since the breakpoint commands already echo these actions. + } + else if (event_type & eBreakpointEventTypeLocationsAdded) + { + char message[256]; + uint32_t num_new_locations = SBBreakpoint::GetNumBreakpointLocationsFromEvent(event); + if (num_new_locations > 0) + { + SBBreakpoint breakpoint = SBBreakpoint::GetBreakpointFromEvent(event); + int message_len = ::snprintf (message, sizeof(message), "%d locations added to breakpoint %d\n", + num_new_locations, + breakpoint.GetID()); + m_io_channel_ap->OutWrite(message, message_len, ASYNC); + } + } + else if (event_type & eBreakpointEventTypeLocationsRemoved) + { + // These locations just get disabled, not sure it is worth spamming folks about this on the command line. + } + else if (event_type & eBreakpointEventTypeLocationsResolved) + { + // This might be an interesting thing to note, but I'm going to leave it quiet for now, it just looked noisy. + } +} // This function handles events that were broadcast by the process. void @@ -1348,10 +1389,14 @@ Driver::MainLoop () else done = HandleIOEvent (event); } - else if (event.BroadcasterMatchesRef (m_debugger.GetSelectedTarget().GetProcess().GetBroadcaster())) + else if (SBProcess::EventIsProcessEvent (event)) { HandleProcessEvent (event); } + else if (SBBreakpoint::EventIsBreakpointEvent (event)) + { + HandleBreakpointEvent (event); + } else if (event.BroadcasterMatchesRef (sb_interpreter.GetBroadcaster())) { if (event_type & SBCommandInterpreter::eBroadcastBitQuitCommandReceived) |