Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- ThreadPlanCallFunction.cpp ------------------------------*- C++ -*-===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | #include "lldb/Target/ThreadPlanCallFunction.h" |
| 11 | |
| 12 | // C Includes |
| 13 | // C++ Includes |
| 14 | // Other libraries and framework includes |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 15 | #include "llvm/Support/MachO.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 16 | // Project includes |
| 17 | #include "lldb/lldb-private-log.h" |
Jim Ingham | 988ddbc | 2010-10-26 00:27:45 +0000 | [diff] [blame] | 18 | #include "lldb/Breakpoint/Breakpoint.h" |
| 19 | #include "lldb/Breakpoint/BreakpointLocation.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 20 | #include "lldb/Core/Address.h" |
| 21 | #include "lldb/Core/Log.h" |
| 22 | #include "lldb/Core/Stream.h" |
Sean Callanan | 29756d4 | 2010-11-03 22:19:38 +0000 | [diff] [blame] | 23 | #include "lldb/Target/LanguageRuntime.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 24 | #include "lldb/Target/Process.h" |
| 25 | #include "lldb/Target/RegisterContext.h" |
Jim Ingham | 988ddbc | 2010-10-26 00:27:45 +0000 | [diff] [blame] | 26 | #include "lldb/Target/StopInfo.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 27 | #include "lldb/Target/Target.h" |
| 28 | #include "lldb/Target/Thread.h" |
| 29 | #include "lldb/Target/ThreadPlanRunToAddress.h" |
| 30 | |
| 31 | using namespace lldb; |
| 32 | using namespace lldb_private; |
| 33 | |
| 34 | //---------------------------------------------------------------------- |
| 35 | // ThreadPlanCallFunction: Plan to call a single function |
| 36 | //---------------------------------------------------------------------- |
| 37 | |
| 38 | ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread, |
| 39 | Address &function, |
| 40 | lldb::addr_t arg, |
| 41 | bool stop_other_threads, |
Sean Callanan | 3c9c5eb | 2010-09-21 00:44:12 +0000 | [diff] [blame] | 42 | bool discard_on_error, |
Sean Callanan | 3aa7da5 | 2010-12-13 22:46:15 +0000 | [diff] [blame] | 43 | lldb::addr_t *this_arg, |
| 44 | lldb::addr_t *cmd_arg) : |
Jim Ingham | 5a47e8b | 2010-06-19 04:45:32 +0000 | [diff] [blame] | 45 | ThreadPlan (ThreadPlan::eKindCallFunction, "Call function plan", thread, eVoteNoOpinion, eVoteNoOpinion), |
Benjamin Kramer | 36a0810 | 2010-07-16 12:32:33 +0000 | [diff] [blame] | 46 | m_valid (false), |
| 47 | m_stop_other_threads (stop_other_threads), |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 48 | m_arg_addr (arg), |
| 49 | m_args (NULL), |
Benjamin Kramer | 36a0810 | 2010-07-16 12:32:33 +0000 | [diff] [blame] | 50 | m_process (thread.GetProcess()), |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 51 | m_thread (thread), |
| 52 | m_takedown_done (false) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 53 | { |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 54 | SetOkayToDiscard (discard_on_error); |
| 55 | |
| 56 | Process& process = thread.GetProcess(); |
| 57 | Target& target = process.GetTarget(); |
| 58 | const ABI *abi = process.GetABI(); |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 59 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 60 | if (!abi) |
| 61 | return; |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 62 | |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 63 | LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); |
| 64 | |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 65 | SetBreakpoints(); |
| 66 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 67 | lldb::addr_t spBelowRedZone = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize(); |
| 68 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 69 | ModuleSP executableModuleSP (target.GetExecutableModule()); |
| 70 | |
Jim Ingham | 2877594 | 2011-03-07 23:44:08 +0000 | [diff] [blame] | 71 | if (!executableModuleSP) |
| 72 | { |
| 73 | log->Printf ("Can't execute code without an executable module."); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 74 | return; |
Jim Ingham | 2877594 | 2011-03-07 23:44:08 +0000 | [diff] [blame] | 75 | } |
| 76 | else |
| 77 | { |
| 78 | ObjectFile *objectFile = executableModuleSP->GetObjectFile(); |
| 79 | if (!objectFile) |
| 80 | { |
| 81 | log->Printf ("Could not find object file for module \"%s\".", |
| 82 | executableModuleSP->GetFileSpec().GetFilename().AsCString()); |
| 83 | return; |
| 84 | } |
| 85 | m_start_addr = objectFile->GetEntryPointAddress(); |
| 86 | if (!m_start_addr.IsValid()) |
| 87 | { |
| 88 | log->Printf ("Could not find entry point address for executable module \"%s\".", |
| 89 | executableModuleSP->GetFileSpec().GetFilename().AsCString()); |
| 90 | return; |
| 91 | } |
| 92 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 93 | |
Greg Clayton | eea2640 | 2010-09-14 23:36:40 +0000 | [diff] [blame] | 94 | lldb::addr_t StartLoadAddr = m_start_addr.GetLoadAddress(&target); |
Jim Ingham | 2877594 | 2011-03-07 23:44:08 +0000 | [diff] [blame] | 95 | |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 96 | // Checkpoint the thread state so we can restore it later. |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 97 | if (log && log->GetVerbose()) |
| 98 | ReportRegisterState ("About to checkpoint thread before function call. Original register state was:"); |
| 99 | |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 100 | if (!thread.CheckpointThreadState (m_stored_thread_state)) |
| 101 | { |
| 102 | if (log) |
| 103 | log->Printf ("Setting up ThreadPlanCallFunction, failed to checkpoint thread state."); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 104 | return; |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 105 | } |
| 106 | // Now set the thread state to "no reason" so we don't run with whatever signal was outstanding... |
| 107 | thread.SetStopInfoToNothing(); |
| 108 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 109 | m_function_addr = function; |
Greg Clayton | eea2640 | 2010-09-14 23:36:40 +0000 | [diff] [blame] | 110 | lldb::addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&target); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 111 | |
| 112 | if (!abi->PrepareTrivialCall(thread, |
| 113 | spBelowRedZone, |
| 114 | FunctionLoadAddr, |
| 115 | StartLoadAddr, |
Sean Callanan | 3c9c5eb | 2010-09-21 00:44:12 +0000 | [diff] [blame] | 116 | m_arg_addr, |
Sean Callanan | 3aa7da5 | 2010-12-13 22:46:15 +0000 | [diff] [blame] | 117 | this_arg, |
| 118 | cmd_arg)) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 119 | return; |
| 120 | |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 121 | ReportRegisterState ("Function call was set up. Register state was:"); |
| 122 | |
| 123 | m_valid = true; |
| 124 | } |
| 125 | |
| 126 | ThreadPlanCallFunction::~ThreadPlanCallFunction () |
| 127 | { |
| 128 | } |
| 129 | |
| 130 | void |
| 131 | ThreadPlanCallFunction::ReportRegisterState (const char *message) |
| 132 | { |
| 133 | LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); |
Sean Callanan | 6dff827 | 2010-11-08 03:49:50 +0000 | [diff] [blame] | 134 | if (log) |
| 135 | { |
Greg Clayton | 08d7d3a | 2011-01-06 22:15:06 +0000 | [diff] [blame] | 136 | RegisterContext *reg_ctx = m_thread.GetRegisterContext().get(); |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 137 | |
| 138 | log->PutCString(message); |
| 139 | |
Sean Callanan | 6dff827 | 2010-11-08 03:49:50 +0000 | [diff] [blame] | 140 | for (uint32_t register_index = 0, num_registers = reg_ctx->GetRegisterCount(); |
| 141 | register_index < num_registers; |
| 142 | ++register_index) |
| 143 | { |
| 144 | const char *register_name = reg_ctx->GetRegisterName(register_index); |
| 145 | uint64_t register_value = reg_ctx->ReadRegisterAsUnsigned(register_index, LLDB_INVALID_ADDRESS); |
| 146 | |
| 147 | log->Printf(" %s = 0x%llx", register_name, register_value); |
| 148 | } |
| 149 | } |
Sean Callanan | 14a97ff | 2010-11-04 01:51:38 +0000 | [diff] [blame] | 150 | } |
| 151 | |
| 152 | void |
| 153 | ThreadPlanCallFunction::DoTakedown () |
| 154 | { |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 155 | LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); |
| 156 | if (!m_takedown_done) |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 157 | { |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 158 | if (log) |
| 159 | log->Printf ("DoTakedown called for thread 0x%4.4x, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); |
| 160 | m_takedown_done = true; |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 161 | m_thread.RestoreThreadStateFromCheckpoint(m_stored_thread_state); |
| 162 | SetPlanComplete(); |
| 163 | ClearBreakpoints(); |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 164 | if (log && log->GetVerbose()) |
| 165 | ReportRegisterState ("Restoring thread state after function call. Restored register state:"); |
Jim Ingham | 78108e6 | 2011-01-26 19:13:09 +0000 | [diff] [blame] | 166 | |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 167 | } |
| 168 | else |
| 169 | { |
| 170 | if (log) |
| 171 | log->Printf ("DoTakedown called as no-op for thread 0x%4.4x, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete()); |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 172 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 173 | } |
| 174 | |
| 175 | void |
Jim Ingham | 6c9662e | 2011-01-18 01:58:06 +0000 | [diff] [blame] | 176 | ThreadPlanCallFunction::WillPop () |
| 177 | { |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 178 | DoTakedown(); |
Jim Ingham | 6c9662e | 2011-01-18 01:58:06 +0000 | [diff] [blame] | 179 | } |
| 180 | |
| 181 | void |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 182 | ThreadPlanCallFunction::GetDescription (Stream *s, lldb::DescriptionLevel level) |
| 183 | { |
| 184 | if (level == lldb::eDescriptionLevelBrief) |
| 185 | { |
| 186 | s->Printf("Function call thread plan"); |
| 187 | } |
| 188 | else |
| 189 | { |
| 190 | if (m_args) |
Greg Clayton | eea2640 | 2010-09-14 23:36:40 +0000 | [diff] [blame] | 191 | s->Printf("Thread plan to call 0x%llx with parsed arguments", m_function_addr.GetLoadAddress(&m_process.GetTarget()), m_arg_addr); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 192 | else |
Greg Clayton | eea2640 | 2010-09-14 23:36:40 +0000 | [diff] [blame] | 193 | s->Printf("Thread plan to call 0x%llx void * argument at: 0x%llx", m_function_addr.GetLoadAddress(&m_process.GetTarget()), m_arg_addr); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 194 | } |
| 195 | } |
| 196 | |
| 197 | bool |
| 198 | ThreadPlanCallFunction::ValidatePlan (Stream *error) |
| 199 | { |
| 200 | if (!m_valid) |
| 201 | return false; |
| 202 | |
| 203 | return true; |
| 204 | } |
| 205 | |
| 206 | bool |
| 207 | ThreadPlanCallFunction::PlanExplainsStop () |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 208 | { |
Jim Ingham | 988ddbc | 2010-10-26 00:27:45 +0000 | [diff] [blame] | 209 | // If our subplan knows why we stopped, even if it's done (which would forward the question to us) |
| 210 | // we answer yes. |
| 211 | if(m_subplan_sp.get() != NULL && m_subplan_sp->PlanExplainsStop()) |
| 212 | return true; |
Sean Callanan | ba8547d | 2010-10-19 22:24:06 +0000 | [diff] [blame] | 213 | |
Sean Callanan | 94fb543 | 2010-11-03 19:36:28 +0000 | [diff] [blame] | 214 | // Check if the breakpoint is one of ours. |
| 215 | |
| 216 | if (BreakpointsExplainStop()) |
| 217 | return true; |
| 218 | |
Jim Ingham | 988ddbc | 2010-10-26 00:27:45 +0000 | [diff] [blame] | 219 | // If we don't want to discard this plan, than any stop we don't understand should be propagated up the stack. |
| 220 | if (!OkayToDiscard()) |
| 221 | return false; |
| 222 | |
| 223 | // Otherwise, check the case where we stopped for an internal breakpoint, in that case, continue on. |
| 224 | // If it is not an internal breakpoint, consult OkayToDiscard. |
| 225 | lldb::StopInfoSP stop_info_sp = GetPrivateStopReason(); |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 226 | |
Jim Ingham | 988ddbc | 2010-10-26 00:27:45 +0000 | [diff] [blame] | 227 | if (stop_info_sp && stop_info_sp->GetStopReason() == eStopReasonBreakpoint) |
| 228 | { |
| 229 | uint64_t break_site_id = stop_info_sp->GetValue(); |
| 230 | lldb::BreakpointSiteSP bp_site_sp = m_thread.GetProcess().GetBreakpointSiteList().FindByID(break_site_id); |
| 231 | if (bp_site_sp) |
| 232 | { |
| 233 | uint32_t num_owners = bp_site_sp->GetNumberOfOwners(); |
| 234 | bool is_internal = true; |
| 235 | for (uint32_t i = 0; i < num_owners; i++) |
| 236 | { |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 237 | Breakpoint &bp = bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint(); |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 238 | |
| 239 | if (!bp.IsInternal()) |
Jim Ingham | 988ddbc | 2010-10-26 00:27:45 +0000 | [diff] [blame] | 240 | { |
| 241 | is_internal = false; |
| 242 | break; |
| 243 | } |
| 244 | } |
| 245 | if (is_internal) |
| 246 | return false; |
| 247 | } |
| 248 | |
| 249 | return OkayToDiscard(); |
| 250 | } |
| 251 | else |
| 252 | { |
| 253 | // If the subplan is running, any crashes are attributable to us. |
Jim Ingham | 78108e6 | 2011-01-26 19:13:09 +0000 | [diff] [blame] | 254 | // If we want to discard the plan, then we say we explain the stop |
| 255 | // but if we are going to be discarded, let whoever is above us |
| 256 | // explain the stop. |
| 257 | return ((m_subplan_sp.get() != NULL) && !OkayToDiscard()); |
Jim Ingham | 988ddbc | 2010-10-26 00:27:45 +0000 | [diff] [blame] | 258 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | bool |
| 262 | ThreadPlanCallFunction::ShouldStop (Event *event_ptr) |
| 263 | { |
| 264 | if (PlanExplainsStop()) |
| 265 | { |
Jim Ingham | 2f6267f | 2011-01-22 01:27:23 +0000 | [diff] [blame] | 266 | ReportRegisterState ("Function completed. Register state was:"); |
Sean Callanan | f5857a0 | 2010-07-31 01:32:05 +0000 | [diff] [blame] | 267 | |
Sean Callanan | 14a97ff | 2010-11-04 01:51:38 +0000 | [diff] [blame] | 268 | DoTakedown(); |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 269 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 270 | return true; |
| 271 | } |
| 272 | else |
| 273 | { |
| 274 | return false; |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | bool |
| 279 | ThreadPlanCallFunction::StopOthers () |
| 280 | { |
| 281 | return m_stop_other_threads; |
| 282 | } |
| 283 | |
| 284 | void |
| 285 | ThreadPlanCallFunction::SetStopOthers (bool new_value) |
| 286 | { |
| 287 | if (m_subplan_sp) |
| 288 | { |
| 289 | ThreadPlanRunToAddress *address_plan = static_cast<ThreadPlanRunToAddress *>(m_subplan_sp.get()); |
| 290 | address_plan->SetStopOthers(new_value); |
| 291 | } |
| 292 | m_stop_other_threads = new_value; |
| 293 | } |
| 294 | |
| 295 | StateType |
Jim Ingham | 745ac7a | 2010-11-11 19:26:09 +0000 | [diff] [blame] | 296 | ThreadPlanCallFunction::GetPlanRunState () |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 297 | { |
| 298 | return eStateRunning; |
| 299 | } |
| 300 | |
| 301 | void |
| 302 | ThreadPlanCallFunction::DidPush () |
| 303 | { |
Sean Callanan | c2c6f77 | 2010-10-26 00:31:56 +0000 | [diff] [blame] | 304 | //#define SINGLE_STEP_EXPRESSIONS |
| 305 | |
| 306 | #ifndef SINGLE_STEP_EXPRESSIONS |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 307 | m_subplan_sp.reset(new ThreadPlanRunToAddress(m_thread, m_start_addr, m_stop_other_threads)); |
| 308 | |
| 309 | m_thread.QueueThreadPlan(m_subplan_sp, false); |
Jim Ingham | 15dcb7c | 2011-01-20 02:03:18 +0000 | [diff] [blame] | 310 | m_subplan_sp->SetPrivate (true); |
Sean Callanan | c2c6f77 | 2010-10-26 00:31:56 +0000 | [diff] [blame] | 311 | #endif |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 312 | } |
| 313 | |
| 314 | bool |
| 315 | ThreadPlanCallFunction::WillStop () |
| 316 | { |
| 317 | return true; |
| 318 | } |
| 319 | |
| 320 | bool |
| 321 | ThreadPlanCallFunction::MischiefManaged () |
| 322 | { |
| 323 | if (IsPlanComplete()) |
| 324 | { |
Greg Clayton | e005f2c | 2010-11-06 01:53:30 +0000 | [diff] [blame] | 325 | LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP)); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 326 | |
| 327 | if (log) |
| 328 | log->Printf("Completed call function plan."); |
| 329 | |
| 330 | ThreadPlan::MischiefManaged (); |
| 331 | return true; |
| 332 | } |
| 333 | else |
| 334 | { |
| 335 | return false; |
| 336 | } |
| 337 | } |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 338 | |
| 339 | void |
| 340 | ThreadPlanCallFunction::SetBreakpoints () |
| 341 | { |
Sean Callanan | 29756d4 | 2010-11-03 22:19:38 +0000 | [diff] [blame] | 342 | m_cxx_language_runtime = m_process.GetLanguageRuntime(eLanguageTypeC_plus_plus); |
| 343 | m_objc_language_runtime = m_process.GetLanguageRuntime(eLanguageTypeObjC); |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 344 | |
Sean Callanan | 29756d4 | 2010-11-03 22:19:38 +0000 | [diff] [blame] | 345 | if (m_cxx_language_runtime) |
| 346 | m_cxx_language_runtime->SetExceptionBreakpoints(); |
| 347 | if (m_objc_language_runtime) |
| 348 | m_objc_language_runtime->SetExceptionBreakpoints(); |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 349 | } |
| 350 | |
| 351 | void |
| 352 | ThreadPlanCallFunction::ClearBreakpoints () |
| 353 | { |
Sean Callanan | 29756d4 | 2010-11-03 22:19:38 +0000 | [diff] [blame] | 354 | if (m_cxx_language_runtime) |
| 355 | m_cxx_language_runtime->ClearExceptionBreakpoints(); |
| 356 | if (m_objc_language_runtime) |
| 357 | m_objc_language_runtime->ClearExceptionBreakpoints(); |
Sean Callanan | 07f3d8d | 2010-11-03 01:37:52 +0000 | [diff] [blame] | 358 | } |
Sean Callanan | 94fb543 | 2010-11-03 19:36:28 +0000 | [diff] [blame] | 359 | |
| 360 | bool |
| 361 | ThreadPlanCallFunction::BreakpointsExplainStop() |
| 362 | { |
Sean Callanan | 94fb543 | 2010-11-03 19:36:28 +0000 | [diff] [blame] | 363 | lldb::StopInfoSP stop_info_sp = GetPrivateStopReason(); |
| 364 | |
Sean Callanan | 29756d4 | 2010-11-03 22:19:38 +0000 | [diff] [blame] | 365 | if (m_cxx_language_runtime && |
| 366 | m_cxx_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp)) |
| 367 | return true; |
Sean Callanan | 94fb543 | 2010-11-03 19:36:28 +0000 | [diff] [blame] | 368 | |
Sean Callanan | 29756d4 | 2010-11-03 22:19:38 +0000 | [diff] [blame] | 369 | if (m_objc_language_runtime && |
| 370 | m_objc_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp)) |
| 371 | return true; |
Sean Callanan | 94fb543 | 2010-11-03 19:36:28 +0000 | [diff] [blame] | 372 | |
| 373 | return false; |
| 374 | } |