2010-06-09 00:52:24 +08:00
|
|
|
//===-- ThreadPlanCallFunction.cpp ------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "lldb/Target/ThreadPlanCallFunction.h"
|
|
|
|
|
|
|
|
// C Includes
|
|
|
|
// C++ Includes
|
|
|
|
// Other libraries and framework includes
|
2014-04-03 06:53:21 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
// Project includes
|
|
|
|
#include "lldb/lldb-private-log.h"
|
2010-10-26 08:27:45 +08:00
|
|
|
#include "lldb/Breakpoint/Breakpoint.h"
|
|
|
|
#include "lldb/Breakpoint/BreakpointLocation.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Core/Address.h"
|
|
|
|
#include "lldb/Core/Log.h"
|
<rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
Cleaned up header includes a bit as well.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
#include "lldb/Core/Module.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Core/Stream.h"
|
<rdar://problem/11757916>
Make breakpoint setting by file and line much more efficient by only looking for inlined breakpoint locations if we are setting a breakpoint in anything but a source implementation file. Implementing this complex for a many reasons. Turns out that parsing compile units lazily had some issues with respect to how we need to do things with DWARF in .o files. So the fixes in the checkin for this makes these changes:
- Add a new setting called "target.inline-breakpoint-strategy" which can be set to "never", "always", or "headers". "never" will never try and set any inlined breakpoints (fastest). "always" always looks for inlined breakpoint locations (slowest, but most accurate). "headers", which is the default setting, will only look for inlined breakpoint locations if the breakpoint is set in what are consudered to be header files, which is realy defined as "not in an implementation source file".
- modify the breakpoint setting by file and line to check the current "target.inline-breakpoint-strategy" setting and act accordingly
- Modify compile units to be able to get their language and other info lazily. This allows us to create compile units from the debug map and not have to fill all of the details in, and then lazily discover this information as we go on debuggging. This is needed to avoid parsing all .o files when setting breakpoints in implementation only files (no inlines). Otherwise we would need to parse the .o file, the object file (mach-o in our case) and the symbol file (DWARF in the object file) just to see what the compile unit was.
- modify the "SymbolFileDWARFDebugMap" to subclass lldb_private::Module so that the virtual "GetObjectFile()" and "GetSymbolVendor()" functions can be intercepted when the .o file contenst are later lazilly needed. Prior to this fix, when we first instantiated the "SymbolFileDWARFDebugMap" class, we would also make modules, object files and symbol files for every .o file in the debug map because we needed to fix up the sections in the .o files with information that is in the executable debug map. Now we lazily do this in the DebugMapModule::GetObjectFile()
Cleaned up header includes a bit as well.
llvm-svn: 162860
2012-08-30 05:13:06 +08:00
|
|
|
#include "lldb/Symbol/ObjectFile.h"
|
2010-11-04 06:19:38 +08:00
|
|
|
#include "lldb/Target/LanguageRuntime.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Target/Process.h"
|
|
|
|
#include "lldb/Target/RegisterContext.h"
|
2010-10-26 08:27:45 +08:00
|
|
|
#include "lldb/Target/StopInfo.h"
|
2010-06-09 00:52:24 +08:00
|
|
|
#include "lldb/Target/Target.h"
|
|
|
|
#include "lldb/Target/Thread.h"
|
|
|
|
#include "lldb/Target/ThreadPlanRunToAddress.h"
|
|
|
|
|
|
|
|
using namespace lldb;
|
|
|
|
using namespace lldb_private;
|
|
|
|
|
|
|
|
//----------------------------------------------------------------------
|
|
|
|
// ThreadPlanCallFunction: Plan to call a single function
|
|
|
|
//----------------------------------------------------------------------
|
2012-04-14 04:38:13 +08:00
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::ConstructorSetup (Thread &thread,
|
|
|
|
ABI *& abi,
|
|
|
|
lldb::addr_t &start_load_addr,
|
|
|
|
lldb::addr_t &function_load_addr)
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2012-04-10 06:37:39 +08:00
|
|
|
SetIsMasterPlan (true);
|
2012-05-12 02:43:38 +08:00
|
|
|
SetOkayToDiscard (false);
|
2012-12-08 01:56:31 +08:00
|
|
|
SetPrivate (true);
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2012-02-21 08:09:25 +08:00
|
|
|
ProcessSP process_sp (thread.GetProcess());
|
|
|
|
if (!process_sp)
|
2012-04-14 04:38:13 +08:00
|
|
|
return false;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2012-04-14 04:38:13 +08:00
|
|
|
abi = process_sp->GetABI().get();
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
if (!abi)
|
2012-04-14 04:38:13 +08:00
|
|
|
return false;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP));
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2010-11-03 09:37:52 +08:00
|
|
|
SetBreakpoints();
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-05-10 06:04:36 +08:00
|
|
|
m_function_sp = thread.GetRegisterContext()->GetSP() - abi->GetRedZoneSize();
|
2012-04-14 04:38:13 +08:00
|
|
|
// If we can't read memory at the point of the process where we are planning to put our function, we're
|
|
|
|
// not going to get any further...
|
|
|
|
Error error;
|
|
|
|
process_sp->ReadUnsignedIntegerFromMemory(m_function_sp, 4, 0, error);
|
|
|
|
if (!error.Success())
|
|
|
|
{
|
2013-03-28 08:04:05 +08:00
|
|
|
m_constructor_errors.Printf ("Trying to put the stack in unreadable memory at: 0x%" PRIx64 ".", m_function_sp);
|
2012-04-14 04:38:13 +08:00
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): %s.",
|
|
|
|
static_cast<void*>(this),
|
|
|
|
m_constructor_errors.GetData());
|
2012-04-14 04:38:13 +08:00
|
|
|
return false;
|
|
|
|
}
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2013-11-07 08:11:47 +08:00
|
|
|
Module *exe_module = GetTarget().GetExecutableModulePointer();
|
2010-06-09 00:52:24 +08:00
|
|
|
|
2011-08-11 10:48:45 +08:00
|
|
|
if (exe_module == NULL)
|
2011-03-08 07:44:08 +08:00
|
|
|
{
|
2013-03-28 08:04:05 +08:00
|
|
|
m_constructor_errors.Printf ("Can't execute code without an executable module.");
|
2011-08-11 01:58:11 +08:00
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): %s.",
|
|
|
|
static_cast<void*>(this),
|
|
|
|
m_constructor_errors.GetData());
|
2012-04-14 04:38:13 +08:00
|
|
|
return false;
|
2011-03-08 07:44:08 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2011-08-11 10:48:45 +08:00
|
|
|
ObjectFile *objectFile = exe_module->GetObjectFile();
|
2011-03-08 07:44:08 +08:00
|
|
|
if (!objectFile)
|
|
|
|
{
|
2013-03-28 08:04:05 +08:00
|
|
|
m_constructor_errors.Printf ("Could not find object file for module \"%s\".",
|
|
|
|
exe_module->GetFileSpec().GetFilename().AsCString());
|
|
|
|
|
2011-08-11 01:58:11 +08:00
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): %s.",
|
|
|
|
static_cast<void*>(this),
|
|
|
|
m_constructor_errors.GetData());
|
2012-04-14 04:38:13 +08:00
|
|
|
return false;
|
2011-03-08 07:44:08 +08:00
|
|
|
}
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-03-08 07:44:08 +08:00
|
|
|
m_start_addr = objectFile->GetEntryPointAddress();
|
|
|
|
if (!m_start_addr.IsValid())
|
|
|
|
{
|
2013-03-28 08:04:05 +08:00
|
|
|
m_constructor_errors.Printf ("Could not find entry point address for executable module \"%s\".",
|
|
|
|
exe_module->GetFileSpec().GetFilename().AsCString());
|
2011-08-11 01:58:11 +08:00
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): %s.",
|
|
|
|
static_cast<void*>(this),
|
|
|
|
m_constructor_errors.GetData());
|
2012-04-14 04:38:13 +08:00
|
|
|
return false;
|
2011-03-08 07:44:08 +08:00
|
|
|
}
|
|
|
|
}
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2013-11-07 08:11:47 +08:00
|
|
|
start_load_addr = m_start_addr.GetLoadAddress (&GetTarget());
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-01-20 10:03:18 +08:00
|
|
|
// Checkpoint the thread state so we can restore it later.
|
2011-01-22 09:27:23 +08:00
|
|
|
if (log && log->GetVerbose())
|
|
|
|
ReportRegisterState ("About to checkpoint thread before function call. Original register state was:");
|
|
|
|
|
2011-01-20 10:03:18 +08:00
|
|
|
if (!thread.CheckpointThreadState (m_stored_thread_state))
|
|
|
|
{
|
2013-03-28 08:04:05 +08:00
|
|
|
m_constructor_errors.Printf ("Setting up ThreadPlanCallFunction, failed to checkpoint thread state.");
|
2011-01-20 10:03:18 +08:00
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): %s.",
|
|
|
|
static_cast<void*>(this),
|
|
|
|
m_constructor_errors.GetData());
|
2012-04-14 04:38:13 +08:00
|
|
|
return false;
|
2011-01-20 10:03:18 +08:00
|
|
|
}
|
2013-11-07 08:11:47 +08:00
|
|
|
function_load_addr = m_function_addr.GetLoadAddress (&GetTarget());
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2012-04-14 04:38:13 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
ThreadPlanCallFunction::ThreadPlanCallFunction (Thread &thread,
|
2013-02-28 04:13:38 +08:00
|
|
|
const Address &function,
|
2012-04-14 04:38:13 +08:00
|
|
|
const ClangASTType &return_type,
|
2013-11-08 09:14:26 +08:00
|
|
|
llvm::ArrayRef<addr_t> args,
|
|
|
|
const EvaluateExpressionOptions &options) :
|
2012-04-14 04:38:13 +08:00
|
|
|
ThreadPlan (ThreadPlan::eKindCallFunction, "Call function plan", thread, eVoteNoOpinion, eVoteNoOpinion),
|
|
|
|
m_valid (false),
|
2013-11-07 08:11:47 +08:00
|
|
|
m_stop_other_threads (options.GetStopOthers()),
|
|
|
|
m_unwind_on_error (options.DoesUnwindOnError()),
|
|
|
|
m_ignore_breakpoints (options.DoesIgnoreBreakpoints()),
|
|
|
|
m_debug_execution (options.GetDebug()),
|
|
|
|
m_trap_exceptions (options.GetTrapExceptions()),
|
2012-04-14 04:38:13 +08:00
|
|
|
m_function_addr (function),
|
2012-09-12 02:11:07 +08:00
|
|
|
m_function_sp (0),
|
2012-04-14 04:38:13 +08:00
|
|
|
m_return_type (return_type),
|
|
|
|
m_takedown_done (false),
|
2013-11-07 08:11:47 +08:00
|
|
|
m_should_clear_objc_exception_bp(false),
|
|
|
|
m_should_clear_cxx_exception_bp (false),
|
|
|
|
m_stop_address (LLDB_INVALID_ADDRESS)
|
2012-04-14 04:38:13 +08:00
|
|
|
{
|
|
|
|
lldb::addr_t start_load_addr;
|
|
|
|
ABI *abi;
|
|
|
|
lldb::addr_t function_load_addr;
|
2012-05-12 02:43:38 +08:00
|
|
|
if (!ConstructorSetup (thread, abi, start_load_addr, function_load_addr))
|
2012-04-14 04:38:13 +08:00
|
|
|
return;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2013-11-08 09:14:26 +08:00
|
|
|
if (!abi->PrepareTrivialCall(thread,
|
|
|
|
m_function_sp,
|
|
|
|
function_load_addr,
|
|
|
|
start_load_addr,
|
|
|
|
args))
|
2012-02-21 08:09:25 +08:00
|
|
|
return;
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-01-22 09:27:23 +08:00
|
|
|
ReportRegisterState ("Function call was set up. Register state was:");
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-01-22 09:27:23 +08:00
|
|
|
m_valid = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
ThreadPlanCallFunction::~ThreadPlanCallFunction ()
|
|
|
|
{
|
2013-02-09 09:29:05 +08:00
|
|
|
DoTakedown(PlanSucceeded());
|
2011-01-22 09:27:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ThreadPlanCallFunction::ReportRegisterState (const char *message)
|
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP | LIBLLDB_LOG_VERBOSE));
|
2010-11-08 11:49:50 +08:00
|
|
|
if (log)
|
|
|
|
{
|
2011-05-19 11:54:16 +08:00
|
|
|
StreamString strm;
|
2011-01-07 06:15:06 +08:00
|
|
|
RegisterContext *reg_ctx = m_thread.GetRegisterContext().get();
|
2011-01-22 09:27:23 +08:00
|
|
|
|
|
|
|
log->PutCString(message);
|
|
|
|
|
2011-05-19 11:54:16 +08:00
|
|
|
RegisterValue reg_value;
|
|
|
|
|
|
|
|
for (uint32_t reg_idx = 0, num_registers = reg_ctx->GetRegisterCount();
|
|
|
|
reg_idx < num_registers;
|
|
|
|
++reg_idx)
|
2010-11-08 11:49:50 +08:00
|
|
|
{
|
2011-05-19 11:54:16 +08:00
|
|
|
const RegisterInfo *reg_info = reg_ctx->GetRegisterInfoAtIndex (reg_idx);
|
|
|
|
if (reg_ctx->ReadRegister(reg_info, reg_value))
|
|
|
|
{
|
|
|
|
reg_value.Dump(&strm, reg_info, true, false, eFormatDefault);
|
|
|
|
strm.EOL();
|
|
|
|
}
|
2010-11-08 11:49:50 +08:00
|
|
|
}
|
2011-05-19 11:54:16 +08:00
|
|
|
log->PutCString(strm.GetData());
|
2010-11-08 11:49:50 +08:00
|
|
|
}
|
2010-11-04 09:51:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2012-05-10 09:35:39 +08:00
|
|
|
ThreadPlanCallFunction::DoTakedown (bool success)
|
2010-11-04 09:51:38 +08:00
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP));
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2012-04-14 07:11:52 +08:00
|
|
|
if (!m_valid)
|
|
|
|
{
|
|
|
|
//Don't call DoTakedown if we were never valid to begin with.
|
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): Log called on ThreadPlanCallFunction that was never valid.",
|
|
|
|
static_cast<void*>(this));
|
2012-04-14 07:11:52 +08:00
|
|
|
return;
|
|
|
|
}
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2011-01-22 09:27:23 +08:00
|
|
|
if (!m_takedown_done)
|
2011-01-20 10:03:18 +08:00
|
|
|
{
|
2012-05-10 09:35:39 +08:00
|
|
|
if (success)
|
2011-05-15 09:25:55 +08:00
|
|
|
{
|
2012-05-10 09:35:39 +08:00
|
|
|
ProcessSP process_sp (m_thread.GetProcess());
|
|
|
|
const ABI *abi = process_sp ? process_sp->GetABI().get() : NULL;
|
|
|
|
if (abi && m_return_type.IsValid())
|
|
|
|
{
|
|
|
|
const bool persistent = false;
|
|
|
|
m_return_valobj_sp = abi->GetReturnValueObject (m_thread, m_return_type, persistent);
|
|
|
|
}
|
2011-05-15 09:25:55 +08:00
|
|
|
}
|
2011-01-22 09:27:23 +08:00
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called for thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n",
|
|
|
|
static_cast<void*>(this), m_thread.GetID(), m_valid,
|
|
|
|
IsPlanComplete());
|
2011-01-22 09:27:23 +08:00
|
|
|
m_takedown_done = true;
|
2011-11-01 10:46:54 +08:00
|
|
|
m_stop_address = m_thread.GetStackFrameAtIndex(0)->GetRegisterContext()->GetPC();
|
2013-06-04 09:40:51 +08:00
|
|
|
m_real_stop_info_sp = GetPrivateStopInfo ();
|
2013-11-13 00:47:08 +08:00
|
|
|
if (!m_thread.RestoreRegisterStateFromCheckpoint(m_stored_thread_state))
|
|
|
|
{
|
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf("ThreadPlanCallFunction(%p): DoTakedown failed to restore register state",
|
|
|
|
static_cast<void*>(this));
|
2013-11-13 00:47:08 +08:00
|
|
|
}
|
2012-05-10 09:35:39 +08:00
|
|
|
SetPlanComplete(success);
|
2011-01-20 10:03:18 +08:00
|
|
|
ClearBreakpoints();
|
2011-01-22 09:27:23 +08:00
|
|
|
if (log && log->GetVerbose())
|
|
|
|
ReportRegisterState ("Restoring thread state after function call. Restored register state:");
|
2011-01-27 03:13:09 +08:00
|
|
|
|
2011-01-22 09:27:23 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf ("ThreadPlanCallFunction(%p): DoTakedown called as no-op for thread 0x%4.4" PRIx64 ", m_valid: %d complete: %d.\n",
|
|
|
|
static_cast<void*>(this), m_thread.GetID(), m_valid,
|
|
|
|
IsPlanComplete());
|
2011-01-20 10:03:18 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
2011-01-18 09:58:06 +08:00
|
|
|
void
|
|
|
|
ThreadPlanCallFunction::WillPop ()
|
|
|
|
{
|
2013-02-09 09:29:05 +08:00
|
|
|
DoTakedown(PlanSucceeded());
|
2011-01-18 09:58:06 +08:00
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
void
|
2011-05-14 09:50:35 +08:00
|
|
|
ThreadPlanCallFunction::GetDescription (Stream *s, DescriptionLevel level)
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2011-05-14 09:50:35 +08:00
|
|
|
if (level == eDescriptionLevelBrief)
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
|
|
|
s->Printf("Function call thread plan");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2012-02-21 08:09:25 +08:00
|
|
|
TargetSP target_sp (m_thread.CalculateTarget());
|
2012-11-30 05:49:15 +08:00
|
|
|
s->Printf("Thread plan to call 0x%" PRIx64, m_function_addr.GetLoadAddress(target_sp.get()));
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::ValidatePlan (Stream *error)
|
|
|
|
{
|
|
|
|
if (!m_valid)
|
2013-03-28 08:04:05 +08:00
|
|
|
{
|
|
|
|
if (error)
|
|
|
|
{
|
|
|
|
if (m_constructor_errors.GetSize() > 0)
|
|
|
|
error->PutCString (m_constructor_errors.GetData());
|
|
|
|
else
|
|
|
|
error->PutCString ("Unknown error");
|
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
return false;
|
2013-03-28 08:04:05 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2013-02-09 09:29:05 +08:00
|
|
|
|
|
|
|
Vote
|
|
|
|
ThreadPlanCallFunction::ShouldReportStop(Event *event_ptr)
|
|
|
|
{
|
|
|
|
if (m_takedown_done || IsPlanComplete())
|
|
|
|
return eVoteYes;
|
|
|
|
else
|
|
|
|
return ThreadPlan::ShouldReportStop(event_ptr);
|
|
|
|
}
|
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
bool
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
ThreadPlanCallFunction::DoPlanExplainsStop (Event *event_ptr)
|
2010-11-03 09:37:52 +08:00
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP|LIBLLDB_LOG_PROCESS));
|
2013-06-04 09:40:51 +08:00
|
|
|
m_real_stop_info_sp = GetPrivateStopInfo ();
|
2011-05-17 09:10:11 +08:00
|
|
|
|
2010-10-26 08:27:45 +08:00
|
|
|
// If our subplan knows why we stopped, even if it's done (which would forward the question to us)
|
|
|
|
// we answer yes.
|
2013-02-09 09:29:05 +08:00
|
|
|
if (m_subplan_sp.get() != NULL && m_subplan_sp->PlanExplainsStop(event_ptr))
|
2013-01-15 10:47:48 +08:00
|
|
|
{
|
|
|
|
SetPlanComplete();
|
2010-10-26 08:27:45 +08:00
|
|
|
return true;
|
2013-01-15 10:47:48 +08:00
|
|
|
}
|
2010-10-20 06:24:06 +08:00
|
|
|
|
2010-11-04 03:36:28 +08:00
|
|
|
// Check if the breakpoint is one of ours.
|
|
|
|
|
2012-05-10 09:35:39 +08:00
|
|
|
StopReason stop_reason;
|
|
|
|
if (!m_real_stop_info_sp)
|
|
|
|
stop_reason = eStopReasonNone;
|
|
|
|
else
|
|
|
|
stop_reason = m_real_stop_info_sp->GetStopReason();
|
2013-02-09 09:29:05 +08:00
|
|
|
if (log)
|
|
|
|
log->Printf ("ThreadPlanCallFunction::PlanExplainsStop: Got stop reason - %s.", Thread::StopReasonAsCString(stop_reason));
|
2012-05-10 09:35:39 +08:00
|
|
|
|
|
|
|
if (stop_reason == eStopReasonBreakpoint && BreakpointsExplainStop())
|
2010-11-04 03:36:28 +08:00
|
|
|
return true;
|
|
|
|
|
2014-04-09 05:33:21 +08:00
|
|
|
// One more quirk here. If this event was from Halt interrupting the target, then we should not consider
|
|
|
|
// ourselves complete. Return true to acknowledge the stop.
|
|
|
|
if (Process::ProcessEventData::GetInterruptedFromEvent(event_ptr))
|
|
|
|
{
|
|
|
|
if (log)
|
|
|
|
log->Printf ("ThreadPlanCallFunction::PlanExplainsStop: The event is an Interrupt, returning true.");
|
|
|
|
return true;
|
|
|
|
}
|
2013-02-09 09:29:05 +08:00
|
|
|
// We control breakpoints separately from other "stop reasons." So first,
|
|
|
|
// check the case where we stopped for an internal breakpoint, in that case, continue on.
|
|
|
|
// If it is not an internal breakpoint, consult m_ignore_breakpoints.
|
2010-11-03 09:37:52 +08:00
|
|
|
|
2012-05-10 09:35:39 +08:00
|
|
|
|
|
|
|
if (stop_reason == eStopReasonBreakpoint)
|
2010-10-26 08:27:45 +08:00
|
|
|
{
|
2012-02-21 08:09:25 +08:00
|
|
|
ProcessSP process_sp (m_thread.CalculateProcess());
|
2011-05-17 09:10:11 +08:00
|
|
|
uint64_t break_site_id = m_real_stop_info_sp->GetValue();
|
2012-02-21 08:09:25 +08:00
|
|
|
BreakpointSiteSP bp_site_sp;
|
|
|
|
if (process_sp)
|
|
|
|
bp_site_sp = process_sp->GetBreakpointSiteList().FindByID(break_site_id);
|
2010-10-26 08:27:45 +08:00
|
|
|
if (bp_site_sp)
|
|
|
|
{
|
|
|
|
uint32_t num_owners = bp_site_sp->GetNumberOfOwners();
|
|
|
|
bool is_internal = true;
|
|
|
|
for (uint32_t i = 0; i < num_owners; i++)
|
|
|
|
{
|
2010-11-03 09:37:52 +08:00
|
|
|
Breakpoint &bp = bp_site_sp->GetOwnerAtIndex(i)->GetBreakpoint();
|
2013-02-09 09:29:05 +08:00
|
|
|
if (log)
|
|
|
|
log->Printf ("ThreadPlanCallFunction::PlanExplainsStop: hit breakpoint %d while calling function", bp.GetID());
|
2010-11-03 09:37:52 +08:00
|
|
|
|
|
|
|
if (!bp.IsInternal())
|
2010-10-26 08:27:45 +08:00
|
|
|
{
|
|
|
|
is_internal = false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (is_internal)
|
2013-02-09 09:29:05 +08:00
|
|
|
{
|
|
|
|
if (log)
|
|
|
|
log->Printf ("ThreadPlanCallFunction::PlanExplainsStop hit an internal breakpoint, not stopping.");
|
2010-10-26 08:27:45 +08:00
|
|
|
return false;
|
2013-02-09 09:29:05 +08:00
|
|
|
}
|
2010-10-26 08:27:45 +08:00
|
|
|
}
|
2013-02-09 09:29:05 +08:00
|
|
|
|
2013-01-15 10:47:48 +08:00
|
|
|
if (m_ignore_breakpoints)
|
2012-05-12 02:43:38 +08:00
|
|
|
{
|
2013-02-09 09:29:05 +08:00
|
|
|
if (log)
|
|
|
|
log->Printf("ThreadPlanCallFunction::PlanExplainsStop: we are ignoring breakpoints, overriding breakpoint stop info ShouldStop, returning true");
|
|
|
|
m_real_stop_info_sp->OverrideShouldStop(false);
|
2012-05-12 02:43:38 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
2013-02-09 09:29:05 +08:00
|
|
|
{
|
|
|
|
if (log)
|
|
|
|
log->Printf("ThreadPlanCallFunction::PlanExplainsStop: we are not ignoring breakpoints, overriding breakpoint stop info ShouldStop, returning true");
|
|
|
|
m_real_stop_info_sp->OverrideShouldStop(true);
|
2012-05-12 02:43:38 +08:00
|
|
|
return false;
|
2013-02-09 09:29:05 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (!m_unwind_on_error)
|
|
|
|
{
|
|
|
|
// If we don't want to discard this plan, than any stop we don't understand should be propagated up the stack.
|
|
|
|
return false;
|
2010-10-26 08:27:45 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
// If the subplan is running, any crashes are attributable to us.
|
2011-01-27 03:13:09 +08:00
|
|
|
// If we want to discard the plan, then we say we explain the stop
|
|
|
|
// but if we are going to be discarded, let whoever is above us
|
|
|
|
// explain the stop.
|
2013-02-09 09:29:05 +08:00
|
|
|
// But don't discard the plan if the stop would restart itself (for instance if it is a
|
|
|
|
// signal that is set not to stop. Check that here first. We just say we explain the stop
|
|
|
|
// but aren't done and everything will continue on from there.
|
|
|
|
|
|
|
|
if (m_real_stop_info_sp->ShouldStopSynchronous(event_ptr))
|
2012-05-10 09:35:39 +08:00
|
|
|
{
|
2013-02-09 09:29:05 +08:00
|
|
|
SetPlanComplete(false);
|
|
|
|
if (m_subplan_sp)
|
2012-05-10 09:35:39 +08:00
|
|
|
{
|
2013-02-09 09:29:05 +08:00
|
|
|
if (m_unwind_on_error)
|
|
|
|
return true;
|
|
|
|
else
|
|
|
|
return false;
|
2012-05-10 09:35:39 +08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
else
|
2013-02-09 09:29:05 +08:00
|
|
|
return true;
|
2010-10-26 08:27:45 +08:00
|
|
|
}
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::ShouldStop (Event *event_ptr)
|
|
|
|
{
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
// We do some computation in DoPlanExplainsStop that may or may not set the plan as complete.
|
2013-01-15 10:47:48 +08:00
|
|
|
// We need to do that here to make sure our state is correct.
|
Figure out the reply to "PlanExplainsStop" once when we stop and then use the cached
value. This fixes problems, for instance, with the StepRange plans, where they know that
they explained the stop because they were at their "run to here" breakpoint, then deleted
that breakpoint, so when they got asked again, doh! I had done this for a couple of plans
in an ad hoc fashion, this just formalizes it.
Also add a "ResumeRequested" in Process so that the code in the completion handlers can
tell the ShouldStop logic they want to resume rather than just directly resuming. That allows
us to handle resuming in a more controlled fashion.
Also, SetPublicState can take a "restarted" flag, so that it doesn't drop the run lock when
the target was immediately restarted.
--This line, and those below , will be ignored--
M test/lang/objc/objc-dynamic-value/TestObjCDynamicValue.py
M include/lldb/Target/ThreadList.h
M include/lldb/Target/ThreadPlanStepOut.h
M include/lldb/Target/Thread.h
M include/lldb/Target/ThreadPlanBase.h
M include/lldb/Target/ThreadPlanStepThrough.h
M include/lldb/Target/ThreadPlanStepInstruction.h
M include/lldb/Target/ThreadPlanStepInRange.h
M include/lldb/Target/ThreadPlanStepOverBreakpoint.h
M include/lldb/Target/ThreadPlanStepUntil.h
M include/lldb/Target/StopInfo.h
M include/lldb/Target/Process.h
M include/lldb/Target/ThreadPlanRunToAddress.h
M include/lldb/Target/ThreadPlan.h
M include/lldb/Target/ThreadPlanCallFunction.h
M include/lldb/Target/ThreadPlanStepOverRange.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.h
M source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
M source/Target/StopInfo.cpp
M source/Target/Process.cpp
M source/Target/ThreadPlanRunToAddress.cpp
M source/Target/ThreadPlan.cpp
M source/Target/ThreadPlanCallFunction.cpp
M source/Target/ThreadPlanStepOverRange.cpp
M source/Target/ThreadList.cpp
M source/Target/ThreadPlanStepOut.cpp
M source/Target/Thread.cpp
M source/Target/ThreadPlanBase.cpp
M source/Target/ThreadPlanStepThrough.cpp
M source/Target/ThreadPlanStepInstruction.cpp
M source/Target/ThreadPlanStepInRange.cpp
M source/Target/ThreadPlanStepOverBreakpoint.cpp
M source/Target/ThreadPlanStepUntil.cpp
M lldb.xcodeproj/xcshareddata/xcschemes/Run Testsuite.xcscheme
llvm-svn: 181381
2013-05-08 08:35:16 +08:00
|
|
|
DoPlanExplainsStop(event_ptr);
|
2013-01-15 10:47:48 +08:00
|
|
|
|
|
|
|
if (IsPlanComplete())
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
2011-01-22 09:27:23 +08:00
|
|
|
ReportRegisterState ("Function completed. Register state was:");
|
2010-06-09 00:52:24 +08:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::StopOthers ()
|
|
|
|
{
|
|
|
|
return m_stop_other_threads;
|
|
|
|
}
|
|
|
|
|
|
|
|
StateType
|
2010-11-12 03:26:09 +08:00
|
|
|
ThreadPlanCallFunction::GetPlanRunState ()
|
2010-06-09 00:52:24 +08:00
|
|
|
{
|
|
|
|
return eStateRunning;
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ThreadPlanCallFunction::DidPush ()
|
|
|
|
{
|
2010-10-26 08:31:56 +08:00
|
|
|
//#define SINGLE_STEP_EXPRESSIONS
|
|
|
|
|
2012-11-27 07:52:18 +08:00
|
|
|
// Now set the thread state to "no reason" so we don't run with whatever signal was outstanding...
|
|
|
|
// Wait till the plan is pushed so we aren't changing the stop info till we're about to run.
|
|
|
|
|
|
|
|
GetThread().SetStopInfoToNothing();
|
|
|
|
|
2010-10-26 08:31:56 +08:00
|
|
|
#ifndef SINGLE_STEP_EXPRESSIONS
|
2010-06-09 00:52:24 +08:00
|
|
|
m_subplan_sp.reset(new ThreadPlanRunToAddress(m_thread, m_start_addr, m_stop_other_threads));
|
|
|
|
|
|
|
|
m_thread.QueueThreadPlan(m_subplan_sp, false);
|
2011-01-20 10:03:18 +08:00
|
|
|
m_subplan_sp->SetPrivate (true);
|
2010-10-26 08:31:56 +08:00
|
|
|
#endif
|
2010-06-09 00:52:24 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::WillStop ()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::MischiefManaged ()
|
|
|
|
{
|
2013-03-28 07:08:40 +08:00
|
|
|
Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_STEP));
|
2014-04-04 12:06:10 +08:00
|
|
|
|
2010-06-09 00:52:24 +08:00
|
|
|
if (IsPlanComplete())
|
|
|
|
{
|
|
|
|
if (log)
|
2014-04-04 12:06:10 +08:00
|
|
|
log->Printf("ThreadPlanCallFunction(%p): Completed call function plan.",
|
|
|
|
static_cast<void*>(this));
|
2010-06-09 00:52:24 +08:00
|
|
|
|
|
|
|
ThreadPlan::MischiefManaged ();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
2010-11-03 09:37:52 +08:00
|
|
|
|
|
|
|
void
|
|
|
|
ThreadPlanCallFunction::SetBreakpoints ()
|
|
|
|
{
|
2012-02-21 08:09:25 +08:00
|
|
|
ProcessSP process_sp (m_thread.CalculateProcess());
|
2013-11-07 08:11:47 +08:00
|
|
|
if (m_trap_exceptions && process_sp)
|
2012-02-21 08:09:25 +08:00
|
|
|
{
|
|
|
|
m_cxx_language_runtime = process_sp->GetLanguageRuntime(eLanguageTypeC_plus_plus);
|
|
|
|
m_objc_language_runtime = process_sp->GetLanguageRuntime(eLanguageTypeObjC);
|
2010-11-03 09:37:52 +08:00
|
|
|
|
2012-02-21 08:09:25 +08:00
|
|
|
if (m_cxx_language_runtime)
|
2013-11-07 08:11:47 +08:00
|
|
|
{
|
|
|
|
m_should_clear_cxx_exception_bp = !m_cxx_language_runtime->ExceptionBreakpointsAreSet();
|
2012-02-21 08:09:25 +08:00
|
|
|
m_cxx_language_runtime->SetExceptionBreakpoints();
|
2013-11-07 08:11:47 +08:00
|
|
|
}
|
2012-02-21 08:09:25 +08:00
|
|
|
if (m_objc_language_runtime)
|
2013-11-07 08:11:47 +08:00
|
|
|
{
|
|
|
|
m_should_clear_objc_exception_bp = !m_objc_language_runtime->ExceptionBreakpointsAreSet();
|
2012-02-21 08:09:25 +08:00
|
|
|
m_objc_language_runtime->SetExceptionBreakpoints();
|
2013-11-07 08:11:47 +08:00
|
|
|
}
|
2012-02-21 08:09:25 +08:00
|
|
|
}
|
2010-11-03 09:37:52 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
void
|
|
|
|
ThreadPlanCallFunction::ClearBreakpoints ()
|
|
|
|
{
|
2013-11-07 08:11:47 +08:00
|
|
|
if (m_trap_exceptions)
|
|
|
|
{
|
|
|
|
if (m_cxx_language_runtime && m_should_clear_cxx_exception_bp)
|
|
|
|
m_cxx_language_runtime->ClearExceptionBreakpoints();
|
|
|
|
if (m_objc_language_runtime && m_should_clear_objc_exception_bp)
|
|
|
|
m_objc_language_runtime->ClearExceptionBreakpoints();
|
|
|
|
}
|
2010-11-03 09:37:52 +08:00
|
|
|
}
|
2010-11-04 03:36:28 +08:00
|
|
|
|
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::BreakpointsExplainStop()
|
|
|
|
{
|
2013-06-04 09:40:51 +08:00
|
|
|
StopInfoSP stop_info_sp = GetPrivateStopInfo ();
|
2010-11-04 03:36:28 +08:00
|
|
|
|
2013-11-07 08:11:47 +08:00
|
|
|
if (m_trap_exceptions)
|
2013-01-15 10:47:48 +08:00
|
|
|
{
|
2013-11-07 08:11:47 +08:00
|
|
|
if ((m_cxx_language_runtime &&
|
|
|
|
m_cxx_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp))
|
|
|
|
||(m_objc_language_runtime &&
|
|
|
|
m_objc_language_runtime->ExceptionBreakpointsExplainStop(stop_info_sp)))
|
|
|
|
{
|
|
|
|
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_STEP));
|
|
|
|
if (log)
|
|
|
|
log->Printf ("ThreadPlanCallFunction::BreakpointsExplainStop - Hit an exception breakpoint, setting plan complete.");
|
|
|
|
|
|
|
|
SetPlanComplete(false);
|
|
|
|
|
|
|
|
// If the user has set the ObjC language breakpoint, it would normally get priority over our internal
|
|
|
|
// catcher breakpoint, but in this case we can't let that happen, so force the ShouldStop here.
|
|
|
|
stop_info_sp->OverrideShouldStop (true);
|
|
|
|
return true;
|
|
|
|
}
|
2013-01-15 10:47:48 +08:00
|
|
|
}
|
|
|
|
|
2010-11-04 03:36:28 +08:00
|
|
|
return false;
|
|
|
|
}
|
2012-11-27 07:52:18 +08:00
|
|
|
|
2014-03-07 19:16:37 +08:00
|
|
|
void
|
|
|
|
ThreadPlanCallFunction::SetStopOthers (bool new_value)
|
|
|
|
{
|
|
|
|
m_subplan_sp->SetStopOthers(new_value);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2012-11-27 07:52:18 +08:00
|
|
|
bool
|
|
|
|
ThreadPlanCallFunction::RestoreThreadState()
|
|
|
|
{
|
|
|
|
return GetThread().RestoreThreadStateFromCheckpoint(m_stored_thread_state);
|
|
|
|
}
|
|
|
|
|