blob: a5180613f9e0105940f5f9855f317300c707f2d7 [file] [log] [blame]
Chris Lattner30fdc8d2010-06-08 16:52:241//===-- 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 Callanan6db73ca2010-11-03 01:37:5215#include "llvm/Support/MachO.h"
Chris Lattner30fdc8d2010-06-08 16:52:2416// Project includes
17#include "lldb/lldb-private-log.h"
Jim Ingham40d871f2010-10-26 00:27:4518#include "lldb/Breakpoint/Breakpoint.h"
19#include "lldb/Breakpoint/BreakpointLocation.h"
Chris Lattner30fdc8d2010-06-08 16:52:2420#include "lldb/Core/Address.h"
21#include "lldb/Core/Log.h"
22#include "lldb/Core/Stream.h"
Sean Callananf2115102010-11-03 22:19:3823#include "lldb/Target/LanguageRuntime.h"
Chris Lattner30fdc8d2010-06-08 16:52:2424#include "lldb/Target/Process.h"
25#include "lldb/Target/RegisterContext.h"
Jim Ingham40d871f2010-10-26 00:27:4526#include "lldb/Target/StopInfo.h"
Chris Lattner30fdc8d2010-06-08 16:52:2427#include "lldb/Target/Target.h"
28#include "lldb/Target/Thread.h"
29#include "lldb/Target/ThreadPlanRunToAddress.h"
30
31using namespace lldb;
32using namespace lldb_private;
33
34//----------------------------------------------------------------------
35// ThreadPlanCallFunction: Plan to call a single function
36//----------------------------------------------------------------------
37
38ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
39 Address &function,
Jim Inghamef651602011-12-22 19:12:4040 const ClangASTType &return_type,
Greg Clayton2a48f522011-05-14 01:50:3541 addr_t arg,
Chris Lattner30fdc8d2010-06-08 16:52:2442 bool stop_other_threads,
Sean Callananfc55f5d2010-09-21 00:44:1243 bool discard_on_error,
Greg Clayton2a48f522011-05-14 01:50:3544 addr_t *this_arg,
45 addr_t *cmd_arg) :
Jim Inghamb01e742a2010-06-19 04:45:3246 ThreadPlan (ThreadPlan::eKindCallFunction, "Call function plan", thread, eVoteNoOpinion, eVoteNoOpinion),
Benjamin Kramer1ee0d4f2010-07-16 12:32:3347 m_valid (false),
48 m_stop_other_threads (stop_other_threads),
Jim Ingham16e0c682011-08-12 23:34:3149 m_function_addr (function),
Peter Collingbourne6b5f17a2011-06-03 20:41:0950 m_function_sp (NULL),
Jim Inghamef651602011-12-22 19:12:4051 m_return_type (return_type),
Jim Inghamce553d82011-11-01 02:46:5452 m_takedown_done (false),
53 m_stop_address (LLDB_INVALID_ADDRESS)
Chris Lattner30fdc8d2010-06-08 16:52:2454{
Chris Lattner30fdc8d2010-06-08 16:52:2455 SetOkayToDiscard (discard_on_error);
56
57 Process& process = thread.GetProcess();
58 Target& target = process.GetTarget();
Greg Clayton31f1d2f2011-05-11 18:39:1859 const ABI *abi = process.GetABI().get();
Sean Callanan6db73ca2010-11-03 01:37:5260
Chris Lattner30fdc8d2010-06-08 16:52:2461 if (!abi)
62 return;
Sean Callanan6db73ca2010-11-03 01:37:5263
Jim Ingham77787032011-01-20 02:03:1864 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
65
Sean Callanan6db73ca2010-11-03 01:37:5266 SetBreakpoints();
67
Sean Callanane359d9b2011-05-09 22:04:3668 m_function_sp = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize();
Chris Lattner30fdc8d2010-06-08 16:52:2469
Greg Claytonaa149cb2011-08-11 02:48:4570 Module *exe_module = target.GetExecutableModulePointer();
Chris Lattner30fdc8d2010-06-08 16:52:2471
Greg Claytonaa149cb2011-08-11 02:48:4572 if (exe_module == NULL)
Jim Ingham672e6f52011-03-07 23:44:0873 {
Johnny Chen9e916e82011-08-10 17:58:1174 if (log)
75 log->Printf ("Can't execute code without an executable module.");
Chris Lattner30fdc8d2010-06-08 16:52:2476 return;
Jim Ingham672e6f52011-03-07 23:44:0877 }
78 else
79 {
Greg Claytonaa149cb2011-08-11 02:48:4580 ObjectFile *objectFile = exe_module->GetObjectFile();
Jim Ingham672e6f52011-03-07 23:44:0881 if (!objectFile)
82 {
Johnny Chen9e916e82011-08-10 17:58:1183 if (log)
84 log->Printf ("Could not find object file for module \"%s\".",
Greg Clayton0c02e4e2011-08-11 04:30:3985 exe_module->GetFileSpec().GetFilename().AsCString());
Jim Ingham672e6f52011-03-07 23:44:0886 return;
87 }
88 m_start_addr = objectFile->GetEntryPointAddress();
89 if (!m_start_addr.IsValid())
90 {
Johnny Chen9e916e82011-08-10 17:58:1191 if (log)
92 log->Printf ("Could not find entry point address for executable module \"%s\".",
Greg Clayton0c02e4e2011-08-11 04:30:3993 exe_module->GetFileSpec().GetFilename().AsCString());
Jim Ingham672e6f52011-03-07 23:44:0894 return;
95 }
96 }
Chris Lattner30fdc8d2010-06-08 16:52:2497
Greg Clayton2a48f522011-05-14 01:50:3598 addr_t start_load_addr = m_start_addr.GetLoadAddress(&target);
Jim Ingham672e6f52011-03-07 23:44:0899
Jim Ingham77787032011-01-20 02:03:18100 // Checkpoint the thread state so we can restore it later.
Jim Ingham9da36832011-01-22 01:27:23101 if (log && log->GetVerbose())
102 ReportRegisterState ("About to checkpoint thread before function call. Original register state was:");
103
Jim Ingham77787032011-01-20 02:03:18104 if (!thread.CheckpointThreadState (m_stored_thread_state))
105 {
106 if (log)
107 log->Printf ("Setting up ThreadPlanCallFunction, failed to checkpoint thread state.");
Chris Lattner30fdc8d2010-06-08 16:52:24108 return;
Jim Ingham77787032011-01-20 02:03:18109 }
110 // Now set the thread state to "no reason" so we don't run with whatever signal was outstanding...
111 thread.SetStopInfoToNothing();
112
Greg Clayton2a48f522011-05-14 01:50:35113 addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&target);
Chris Lattner30fdc8d2010-06-08 16:52:24114
Greg Claytonfdeb1562011-05-12 02:14:56115 if (this_arg && cmd_arg)
116 {
117 if (!abi->PrepareTrivialCall (thread,
118 m_function_sp,
119 FunctionLoadAddr,
Greg Clayton2a48f522011-05-14 01:50:35120 start_load_addr,
Greg Claytonfdeb1562011-05-12 02:14:56121 this_arg,
122 cmd_arg,
Greg Clayton2a48f522011-05-14 01:50:35123 &arg))
Greg Claytonfdeb1562011-05-12 02:14:56124 return;
125 }
126 else if (this_arg)
127 {
128 if (!abi->PrepareTrivialCall (thread,
129 m_function_sp,
130 FunctionLoadAddr,
Greg Clayton2a48f522011-05-14 01:50:35131 start_load_addr,
Greg Claytonfdeb1562011-05-12 02:14:56132 this_arg,
Greg Clayton2a48f522011-05-14 01:50:35133 &arg))
Greg Claytonfdeb1562011-05-12 02:14:56134 return;
135 }
136 else
137 {
138 if (!abi->PrepareTrivialCall (thread,
139 m_function_sp,
140 FunctionLoadAddr,
Greg Clayton2a48f522011-05-14 01:50:35141 start_load_addr,
142 &arg))
143 return;
144 }
145
146 ReportRegisterState ("Function call was set up. Register state was:");
147
148 m_valid = true;
149}
150
151
152ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
153 Address &function,
Jim Inghamef651602011-12-22 19:12:40154 const ClangASTType &return_type,
Greg Clayton2a48f522011-05-14 01:50:35155 bool stop_other_threads,
156 bool discard_on_error,
157 addr_t *arg1_ptr,
158 addr_t *arg2_ptr,
159 addr_t *arg3_ptr,
160 addr_t *arg4_ptr,
161 addr_t *arg5_ptr,
162 addr_t *arg6_ptr) :
163 ThreadPlan (ThreadPlan::eKindCallFunction, "Call function plan", thread, eVoteNoOpinion, eVoteNoOpinion),
164 m_valid (false),
165 m_stop_other_threads (stop_other_threads),
Jim Ingham16e0c682011-08-12 23:34:31166 m_function_addr (function),
Peter Collingbourne6b5f17a2011-06-03 20:41:09167 m_function_sp(NULL),
Jim Inghamef651602011-12-22 19:12:40168 m_return_type (return_type),
Peter Collingbourne6b5f17a2011-06-03 20:41:09169 m_takedown_done (false)
Greg Clayton2a48f522011-05-14 01:50:35170{
171 SetOkayToDiscard (discard_on_error);
172
173 Process& process = thread.GetProcess();
174 Target& target = process.GetTarget();
175 const ABI *abi = process.GetABI().get();
176
177 if (!abi)
178 return;
179
180 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
181
182 SetBreakpoints();
183
184 m_function_sp = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize();
185
Greg Claytonaa149cb2011-08-11 02:48:45186 Module *exe_module = target.GetExecutableModulePointer();
Greg Clayton2a48f522011-05-14 01:50:35187
Greg Claytonaa149cb2011-08-11 02:48:45188 if (exe_module == NULL)
Greg Clayton2a48f522011-05-14 01:50:35189 {
Johnny Chen9e916e82011-08-10 17:58:11190 if (log)
191 log->Printf ("Can't execute code without an executable module.");
Greg Clayton2a48f522011-05-14 01:50:35192 return;
193 }
194 else
195 {
Greg Claytonaa149cb2011-08-11 02:48:45196 ObjectFile *objectFile = exe_module->GetObjectFile();
Greg Clayton2a48f522011-05-14 01:50:35197 if (!objectFile)
198 {
Johnny Chen9e916e82011-08-10 17:58:11199 if (log)
200 log->Printf ("Could not find object file for module \"%s\".",
Greg Clayton0c02e4e2011-08-11 04:30:39201 exe_module->GetFileSpec().GetFilename().AsCString());
Greg Clayton2a48f522011-05-14 01:50:35202 return;
203 }
204 m_start_addr = objectFile->GetEntryPointAddress();
205 if (!m_start_addr.IsValid())
206 {
Greg Claytonaf247d72011-05-19 03:54:16207 if (log)
208 log->Printf ("Could not find entry point address for executable module \"%s\".",
Greg Claytonaa149cb2011-08-11 02:48:45209 exe_module->GetFileSpec().GetFilename().AsCString());
Greg Clayton2a48f522011-05-14 01:50:35210 return;
211 }
212 }
213
214 addr_t start_load_addr = m_start_addr.GetLoadAddress(&target);
215
216 // Checkpoint the thread state so we can restore it later.
217 if (log && log->GetVerbose())
218 ReportRegisterState ("About to checkpoint thread before function call. Original register state was:");
219
220 if (!thread.CheckpointThreadState (m_stored_thread_state))
221 {
222 if (log)
223 log->Printf ("Setting up ThreadPlanCallFunction, failed to checkpoint thread state.");
224 return;
225 }
226 // Now set the thread state to "no reason" so we don't run with whatever signal was outstanding...
227 thread.SetStopInfoToNothing();
228
Greg Clayton2a48f522011-05-14 01:50:35229 addr_t FunctionLoadAddr = m_function_addr.GetLoadAddress(&target);
230
231 if (!abi->PrepareTrivialCall (thread,
232 m_function_sp,
233 FunctionLoadAddr,
234 start_load_addr,
235 arg1_ptr,
236 arg2_ptr,
237 arg3_ptr,
238 arg4_ptr,
239 arg5_ptr,
240 arg6_ptr))
241 {
Greg Claytonfdeb1562011-05-12 02:14:56242 return;
243 }
Chris Lattner30fdc8d2010-06-08 16:52:24244
Jim Ingham9da36832011-01-22 01:27:23245 ReportRegisterState ("Function call was set up. Register state was:");
246
247 m_valid = true;
248}
249
250ThreadPlanCallFunction::~ThreadPlanCallFunction ()
251{
252}
253
254void
255ThreadPlanCallFunction::ReportRegisterState (const char *message)
256{
Greg Claytonaf247d72011-05-19 03:54:16257 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP | LIBLLDB_LOG_VERBOSE));
Sean Callananece96492010-11-08 03:49:50258 if (log)
259 {
Greg Claytonaf247d72011-05-19 03:54:16260 StreamString strm;
Greg Clayton5ccbd292011-01-06 22:15:06261 RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
Jim Ingham9da36832011-01-22 01:27:23262
263 log->PutCString(message);
264
Greg Claytonaf247d72011-05-19 03:54:16265 RegisterValue reg_value;
266
267 for (uint32_t reg_idx = 0, num_registers = reg_ctx->GetRegisterCount();
268 reg_idx < num_registers;
269 ++reg_idx)
Sean Callananece96492010-11-08 03:49:50270 {
Greg Claytonaf247d72011-05-19 03:54:16271 const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
272 if (reg_ctx->ReadRegister(reg_info, reg_value))
273 {
274 reg_value.Dump(&strm, reg_info, true, false, eFormatDefault);
275 strm.EOL();
276 }
Sean Callananece96492010-11-08 03:49:50277 }
Greg Claytonaf247d72011-05-19 03:54:16278 log->PutCString(strm.GetData());
Sean Callananece96492010-11-08 03:49:50279 }
Sean Callanan10af7c42010-11-04 01:51:38280}
281
282void
283ThreadPlanCallFunction::DoTakedown ()
284{
Jim Ingham9da36832011-01-22 01:27:23285 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
286 if (!m_takedown_done)
Jim Ingham77787032011-01-20 02:03:18287 {
Jim Inghamef651602011-12-22 19:12:40288 const ABI *abi = m_thread.GetProcess().GetABI().get();
289 if (abi && m_return_type.IsValid())
Greg Clayton70b57652011-05-15 01:25:55290 {
Jim Inghamef651602011-12-22 19:12:40291 m_return_valobj_sp = abi->GetReturnValueObject (m_thread, m_return_type);
Greg Clayton70b57652011-05-15 01:25:55292 }
Jim Inghamef651602011-12-22 19:12:40293
Jim Ingham9da36832011-01-22 01:27:23294 if (log)
Greg Clayton81c22f62011-10-19 18:09:39295 log->Printf ("DoTakedown called for thread 0x%4.4llx, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete());
Jim Ingham9da36832011-01-22 01:27:23296 m_takedown_done = true;
Jim Inghamce553d82011-11-01 02:46:54297 m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
Jim Ingham160f78c2011-05-17 01:10:11298 m_real_stop_info_sp = GetPrivateStopReason();
Jim Ingham77787032011-01-20 02:03:18299 m_thread.RestoreThreadStateFromCheckpoint(m_stored_thread_state);
300 SetPlanComplete();
301 ClearBreakpoints();
Jim Ingham9da36832011-01-22 01:27:23302 if (log && log->GetVerbose())
303 ReportRegisterState ("Restoring thread state after function call. Restored register state:");
Jim Ingham2c364392011-01-26 19:13:09304
Jim Ingham9da36832011-01-22 01:27:23305 }
306 else
307 {
308 if (log)
Greg Clayton81c22f62011-10-19 18:09:39309 log->Printf ("DoTakedown called as no-op for thread 0x%4.4llx, m_valid: %d complete: %d.\n", m_thread.GetID(), m_valid, IsPlanComplete());
Jim Ingham77787032011-01-20 02:03:18310 }
Chris Lattner30fdc8d2010-06-08 16:52:24311}
312
313void
Jim Inghambda4e5eb2011-01-18 01:58:06314ThreadPlanCallFunction::WillPop ()
315{
Jim Ingham77787032011-01-20 02:03:18316 DoTakedown();
Jim Inghambda4e5eb2011-01-18 01:58:06317}
318
319void
Greg Clayton2a48f522011-05-14 01:50:35320ThreadPlanCallFunction::GetDescription (Stream *s, DescriptionLevel level)
Chris Lattner30fdc8d2010-06-08 16:52:24321{
Greg Clayton2a48f522011-05-14 01:50:35322 if (level == eDescriptionLevelBrief)
Chris Lattner30fdc8d2010-06-08 16:52:24323 {
324 s->Printf("Function call thread plan");
325 }
326 else
327 {
Jim Inghamce553d82011-11-01 02:46:54328 s->Printf("Thread plan to call 0x%llx", m_function_addr.GetLoadAddress(&m_thread.GetProcess().GetTarget()));
Chris Lattner30fdc8d2010-06-08 16:52:24329 }
330}
331
332bool
333ThreadPlanCallFunction::ValidatePlan (Stream *error)
334{
335 if (!m_valid)
336 return false;
337
338 return true;
339}
340
341bool
342ThreadPlanCallFunction::PlanExplainsStop ()
Sean Callanan6db73ca2010-11-03 01:37:52343{
Jim Ingham160f78c2011-05-17 01:10:11344 m_real_stop_info_sp = GetPrivateStopReason();
345
Jim Ingham40d871f2010-10-26 00:27:45346 // If our subplan knows why we stopped, even if it's done (which would forward the question to us)
347 // we answer yes.
Enrico Granata20edcdb2011-07-19 18:03:25348 if (m_subplan_sp.get() != NULL && m_subplan_sp->PlanExplainsStop())
Jim Ingham40d871f2010-10-26 00:27:45349 return true;
Sean Callanan3e6fedc2010-10-19 22:24:06350
Sean Callananc98aca62010-11-03 19:36:28351 // Check if the breakpoint is one of ours.
352
353 if (BreakpointsExplainStop())
354 return true;
355
Jim Ingham40d871f2010-10-26 00:27:45356 // If we don't want to discard this plan, than any stop we don't understand should be propagated up the stack.
357 if (!OkayToDiscard())
358 return false;
359
360 // Otherwise, check the case where we stopped for an internal breakpoint, in that case, continue on.
361 // If it is not an internal breakpoint, consult OkayToDiscard.
Sean Callanan6db73ca2010-11-03 01:37:52362
Jim Ingham160f78c2011-05-17 01:10:11363 if (m_real_stop_info_sp && m_real_stop_info_sp->GetStopReason() == eStopReasonBreakpoint)
Jim Ingham40d871f2010-10-26 00:27:45364 {
Jim Ingham160f78c2011-05-17 01:10:11365 uint64_t break_site_id = m_real_stop_info_sp->GetValue();
Greg Clayton2a48f522011-05-14 01:50:35366 BreakpointSiteSP bp_site_sp = m_thread.GetProcess().GetBreakpointSiteList().FindByID(break_site_id);
Jim Ingham40d871f2010-10-26 00:27:45367 if (bp_site_sp)
368 {
369 uint32_t num_owners = bp_site_sp->GetNumberOfOwners();
370 bool is_internal = true;
371 for (uint32_t i = 0; i < num_owners; i++)
372 {
Sean Callanan6db73ca2010-11-03 01:37:52373 Breakpoint &bp = bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint();
Sean Callanan6db73ca2010-11-03 01:37:52374
375 if (!bp.IsInternal())
Jim Ingham40d871f2010-10-26 00:27:45376 {
377 is_internal = false;
378 break;
379 }
380 }
381 if (is_internal)
382 return false;
383 }
384
385 return OkayToDiscard();
386 }
387 else
388 {
389 // If the subplan is running, any crashes are attributable to us.
Jim Ingham2c364392011-01-26 19:13:09390 // If we want to discard the plan, then we say we explain the stop
391 // but if we are going to be discarded, let whoever is above us
392 // explain the stop.
393 return ((m_subplan_sp.get() != NULL) && !OkayToDiscard());
Jim Ingham40d871f2010-10-26 00:27:45394 }
Chris Lattner30fdc8d2010-06-08 16:52:24395}
396
397bool
398ThreadPlanCallFunction::ShouldStop (Event *event_ptr)
399{
400 if (PlanExplainsStop())
401 {
Jim Ingham9da36832011-01-22 01:27:23402 ReportRegisterState ("Function completed. Register state was:");
Sean Callanan5300d372010-07-31 01:32:05403
Sean Callanan10af7c42010-11-04 01:51:38404 DoTakedown();
Sean Callanan6db73ca2010-11-03 01:37:52405
Chris Lattner30fdc8d2010-06-08 16:52:24406 return true;
407 }
408 else
409 {
410 return false;
411 }
412}
413
414bool
415ThreadPlanCallFunction::StopOthers ()
416{
417 return m_stop_other_threads;
418}
419
420void
421ThreadPlanCallFunction::SetStopOthers (bool new_value)
422{
423 if (m_subplan_sp)
424 {
425 ThreadPlanRunToAddress *address_plan = static_cast<ThreadPlanRunToAddress *>(m_subplan_sp.get());
426 address_plan->SetStopOthers(new_value);
427 }
428 m_stop_other_threads = new_value;
429}
430
431StateType
Jim Ingham06e827c2010-11-11 19:26:09432ThreadPlanCallFunction::GetPlanRunState ()
Chris Lattner30fdc8d2010-06-08 16:52:24433{
434 return eStateRunning;
435}
436
437void
438ThreadPlanCallFunction::DidPush ()
439{
Sean Callananbe3a1b12010-10-26 00:31:56440//#define SINGLE_STEP_EXPRESSIONS
441
442#ifndef SINGLE_STEP_EXPRESSIONS
Chris Lattner30fdc8d2010-06-08 16:52:24443 m_subplan_sp.reset(new ThreadPlanRunToAddress(m_thread, m_start_addr, m_stop_other_threads));
444
445 m_thread.QueueThreadPlan(m_subplan_sp, false);
Jim Ingham77787032011-01-20 02:03:18446 m_subplan_sp->SetPrivate (true);
Sean Callananbe3a1b12010-10-26 00:31:56447#endif
Chris Lattner30fdc8d2010-06-08 16:52:24448}
449
450bool
451ThreadPlanCallFunction::WillStop ()
452{
453 return true;
454}
455
456bool
457ThreadPlanCallFunction::MischiefManaged ()
458{
459 if (IsPlanComplete())
460 {
Greg Clayton2d4edfb2010-11-06 01:53:30461 LogSP log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
Chris Lattner30fdc8d2010-06-08 16:52:24462
463 if (log)
464 log->Printf("Completed call function plan.");
465
466 ThreadPlan::MischiefManaged ();
467 return true;
468 }
469 else
470 {
471 return false;
472 }
473}
Sean Callanan6db73ca2010-11-03 01:37:52474
475void
476ThreadPlanCallFunction::SetBreakpoints ()
477{
Jim Inghamce553d82011-11-01 02:46:54478 m_cxx_language_runtime = m_thread.GetProcess().GetLanguageRuntime(eLanguageTypeC_plus_plus);
479 m_objc_language_runtime = m_thread.GetProcess().GetLanguageRuntime(eLanguageTypeObjC);
Sean Callanan6db73ca2010-11-03 01:37:52480
Sean Callananf2115102010-11-03 22:19:38481 if (m_cxx_language_runtime)
482 m_cxx_language_runtime->SetExceptionBreakpoints();
483 if (m_objc_language_runtime)
484 m_objc_language_runtime->SetExceptionBreakpoints();
Sean Callanan6db73ca2010-11-03 01:37:52485}
486
487void
488ThreadPlanCallFunction::ClearBreakpoints ()
489{
Sean Callananf2115102010-11-03 22:19:38490 if (m_cxx_language_runtime)
491 m_cxx_language_runtime->ClearExceptionBreakpoints();
492 if (m_objc_language_runtime)
493 m_objc_language_runtime->ClearExceptionBreakpoints();
Sean Callanan6db73ca2010-11-03 01:37:52494}
Sean Callananc98aca62010-11-03 19:36:28495
496bool
497ThreadPlanCallFunction::BreakpointsExplainStop()
498{
Greg Clayton2a48f522011-05-14 01:50:35499 StopInfoSP stop_info_sp = GetPrivateStopReason();
Sean Callananc98aca62010-11-03 19:36:28500
Sean Callananf2115102010-11-03 22:19:38501 if (m_cxx_language_runtime &&
502 m_cxx_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp))
503 return true;
Sean Callananc98aca62010-11-03 19:36:28504
Sean Callananf2115102010-11-03 22:19:38505 if (m_objc_language_runtime &&
506 m_objc_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp))
507 return true;
Sean Callananc98aca62010-11-03 19:36:28508
509 return false;
510}