本文整理汇总了C++中ExecutionContext类的典型用法代码示例。如果您正苦于以下问题:C++ ExecutionContext类的具体用法?C++ ExecutionContext怎么用?C++ ExecutionContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ExecutionContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getChildData
inline void
getChildData(
const XalanNode* child,
ExecutionContext& executionContext,
XalanDOMString& data)
{
assert(executionContext.hasPreserveOrStripSpaceConditions() == true);
const XalanNode::NodeType theType = child->getNodeType();
if (theType == XalanNode::ELEMENT_NODE)
{
const XalanElement* const theElementNode =
static_cast<const XalanElement*>(child);
DOMServices::doGetNodeData(*theElementNode, executionContext, data);
}
else if (theType == XalanNode::TEXT_NODE ||
theType == XalanNode::CDATA_SECTION_NODE)
{
const XalanText* theTextNode =
static_cast<const XalanText*>(child);
DOMServices::doGetNodeData(*theTextNode, executionContext, data);
}
}
示例2: ClangUtilityFunction
bool
DynamicCheckerFunctions::Install(Stream &error_stream,
ExecutionContext &exe_ctx)
{
m_valid_pointer_check.reset(new ClangUtilityFunction(g_valid_pointer_check_text,
VALID_POINTER_CHECK_NAME));
if (!m_valid_pointer_check->Install(error_stream, exe_ctx))
return false;
Process *process = exe_ctx.GetProcessPtr();
if (process)
{
ObjCLanguageRuntime *objc_language_runtime = process->GetObjCLanguageRuntime();
if (objc_language_runtime)
{
m_objc_object_check.reset(objc_language_runtime->CreateObjectChecker(VALID_OBJC_OBJECT_CHECK_NAME));
if (!m_objc_object_check->Install(error_stream, exe_ctx))
return false;
}
}
return true;
}
示例3: schnaps_StackTraceBeginM
/*!
* \brief Return a handle to the value of the Nth argument of the primitive.
* \param inIndex Index of the actual primitive in the primitive tree.
* \param inN Number of the argument to get the index.
* \param ioContext A reference to the execution context.
* \return A handle to the value of the Nth argument of the primitive.
*/
AnyType::Handle Primitive::getArgument(unsigned int inIndex, unsigned int inN, ExecutionContext& ioContext) const {
schnaps_StackTraceBeginM();
unsigned int lNodeIndex = getArgumentIndex(inIndex, inN, ioContext);
AnyType::Handle outResult = ioContext.getPrimitiveTree()[lNodeIndex].mPrimitive->execute(lNodeIndex, ioContext);
return outResult;
schnaps_StackTraceEndM("AnyType::Handle Primitive::getArgument(unsigned int, unsigned int, SCHNAPS::Core::ExecutionContext&) const");
}
示例4:
bool UnwindAssembly_x86::FirstNonPrologueInsn(
AddressRange &func, const ExecutionContext &exe_ctx,
Address &first_non_prologue_insn) {
if (!func.GetBaseAddress().IsValid())
return false;
Target *target = exe_ctx.GetTargetPtr();
if (target == nullptr)
return false;
if (m_assembly_inspection_engine == nullptr)
return false;
const bool prefer_file_cache = true;
std::vector<uint8_t> function_text(func.GetByteSize());
Status error;
if (target->ReadMemory(func.GetBaseAddress(), prefer_file_cache,
function_text.data(), func.GetByteSize(),
error) == func.GetByteSize()) {
size_t offset;
if (m_assembly_inspection_engine->FindFirstNonPrologueInstruction(
function_text.data(), func.GetByteSize(), offset)) {
first_non_prologue_insn = func.GetBaseAddress();
first_non_prologue_insn.Slide(offset);
}
return true;
}
return false;
}
示例5: call_plan_sp
// This is the static function
ExecutionResults
ClangFunction::ExecuteFunction (
ExecutionContext &exe_ctx,
lldb::addr_t function_address,
lldb::addr_t &void_arg,
bool stop_others,
bool try_all_threads,
bool discard_on_error,
uint32_t single_thread_timeout_usec,
Stream &errors,
lldb::addr_t *this_arg)
{
lldb::ThreadPlanSP call_plan_sp (ClangFunction::GetThreadPlanToCallFunction (exe_ctx,
function_address,
void_arg,
errors,
stop_others,
discard_on_error,
this_arg));
if (call_plan_sp == NULL)
return eExecutionSetupError;
call_plan_sp->SetPrivate(true);
return exe_ctx.GetProcessRef().RunThreadPlan (exe_ctx, call_plan_sp,
stop_others,
try_all_threads,
discard_on_error,
single_thread_timeout_usec,
errors);
}
示例6: openDatabaseMapLock
void DatabaseTracker::forEachOpenDatabaseInPage(Page* page, std::unique_ptr<DatabaseCallback> callback)
{
MutexLocker openDatabaseMapLock(m_openDatabaseMapGuard);
if (!m_openDatabaseMap)
return;
for (auto& originMap : *m_openDatabaseMap) {
for (auto& nameDatabaseSet : *originMap.value) {
for (Database* database : *nameDatabaseSet.value) {
ExecutionContext* context = database->getExecutionContext();
ASSERT(context->isDocument());
if (toDocument(context)->frame()->page() == page)
(*callback)(database);
}
}
}
}
示例7:
lldb::DisassemblerSP
Disassembler::DisassembleRange
(
const ArchSpec &arch,
const char *plugin_name,
const char *flavor,
const ExecutionContext &exe_ctx,
const AddressRange &range,
bool prefer_file_cache
)
{
lldb::DisassemblerSP disasm_sp;
if (range.GetByteSize() > 0 && range.GetBaseAddress().IsValid())
{
disasm_sp = Disassembler::FindPluginForTarget(exe_ctx.GetTargetSP(), arch, flavor, plugin_name);
if (disasm_sp)
{
size_t bytes_disassembled = disasm_sp->ParseInstructions (&exe_ctx, range, NULL, prefer_file_cache);
if (bytes_disassembled == 0)
disasm_sp.reset();
}
}
return disasm_sp;
}
示例8: schnaps_StackTraceBeginM
/*!
* \brief Interpret the primitive tree.
* \param ioContext A reference to the execution context.
* \return A handle to the result of the interpretation.
* \throw SCHNAPS::Core::AssertException if the primitive tree is empty.
*/
AnyType::Handle PrimitiveTree::interpret(ExecutionContext& ioContext) const {
schnaps_StackTraceBeginM();
schnaps_AssertM(empty() == false);
ioContext.setPrimitiveTree(this);
return (*this)[0].mPrimitive->execute(0, ioContext);
schnaps_StackTraceEndM("SCHNAPS::Core::Atom::Handle SCHNAPS::Core::PrimitiveTree::interpret(SCHNAPS::Core::ExecutionContext&)");
}
示例9: ResolveAddress
static void
ResolveAddress (const ExecutionContext &exe_ctx,
const Address &addr,
Address &resolved_addr)
{
if (!addr.IsSectionOffset())
{
// If we weren't passed in a section offset address range,
// try and resolve it to something
Target *target = exe_ctx.GetTargetPtr();
if (target)
{
if (target->GetSectionLoadList().IsEmpty())
{
target->GetImages().ResolveFileAddress (addr.GetOffset(), resolved_addr);
}
else
{
target->GetSectionLoadList().ResolveLoadAddress (addr.GetOffset(), resolved_addr);
}
// We weren't able to resolve the address, just treat it as a
// raw address
if (resolved_addr.IsValid())
return;
}
}
resolved_addr = addr;
}
示例10: wrapper_address
lldb::ThreadPlanSP
ClangFunction::GetThreadPlanToCallFunction (ExecutionContext &exe_ctx,
lldb::addr_t args_addr,
const EvaluateExpressionOptions &options,
Stream &errors)
{
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
if (log)
log->Printf("-- [ClangFunction::GetThreadPlanToCallFunction] Creating thread plan to call function \"%s\" --", m_name.c_str());
// FIXME: Use the errors Stream for better error reporting.
Thread *thread = exe_ctx.GetThreadPtr();
if (thread == NULL)
{
errors.Printf("Can't call a function without a valid thread.");
return NULL;
}
// Okay, now run the function:
Address wrapper_address (m_jit_start_addr);
lldb::addr_t args = { args_addr };
lldb::ThreadPlanSP new_plan_sp (new ThreadPlanCallFunction (*thread,
wrapper_address,
CompilerType(),
args,
options));
new_plan_sp->SetIsMasterPlan(true);
new_plan_sp->SetOkayToDiscard (false);
return new_plan_sp;
}
示例11: jit_process_sp
bool
ClangFunction::FetchFunctionResults (ExecutionContext &exe_ctx, lldb::addr_t args_addr, Value &ret_value)
{
// Read the return value - it is the last field in the struct:
// FIXME: How does clang tell us there's no return value? We need to handle that case.
// FIXME: Create our ThreadPlanCallFunction with the return CompilerType, and then use GetReturnValueObject
// to fetch the value. That way we can fetch any values we need.
Log *log(lldb_private::GetLogIfAnyCategoriesSet (LIBLLDB_LOG_EXPRESSIONS | LIBLLDB_LOG_STEP));
if (log)
log->Printf("-- [ClangFunction::FetchFunctionResults] Fetching function results for \"%s\"--", m_name.c_str());
Process *process = exe_ctx.GetProcessPtr();
if (process == NULL)
return false;
lldb::ProcessSP jit_process_sp(m_jit_process_wp.lock());
if (process != jit_process_sp.get())
return false;
Error error;
ret_value.GetScalar() = process->ReadUnsignedIntegerFromMemory (args_addr + m_return_offset, m_return_size, 0, error);
if (error.Fail())
return false;
ret_value.SetCompilerType(m_function_return_type);
ret_value.SetValueType(Value::eValueTypeScalar);
return true;
}
示例12: webkitRequestFileSystem
void WorkerGlobalScopeFileSystem::webkitRequestFileSystem(WorkerGlobalScope* worker, int type, long long size, PassOwnPtr<FileSystemCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
{
ExecutionContext* secureContext = worker->executionContext();
if (!secureContext->securityOrigin()->canAccessFileSystem()) {
DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::SECURITY_ERR));
return;
}
FileSystemType fileSystemType = static_cast<FileSystemType>(type);
if (!DOMFileSystemBase::isValidType(fileSystemType)) {
DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::INVALID_MODIFICATION_ERR));
return;
}
LocalFileSystem::from(worker)->requestFileSystem(worker, fileSystemType, size, FileSystemCallbacks::create(successCallback, errorCallback, worker, fileSystemType));
}
示例13: webkitResolveLocalFileSystemURL
void WorkerGlobalScopeFileSystem::webkitResolveLocalFileSystemURL(WorkerGlobalScope* worker, const String& url, PassOwnPtr<EntryCallback> successCallback, PassOwnPtr<ErrorCallback> errorCallback)
{
KURL completedURL = worker->completeURL(url);
ExecutionContext* secureContext = worker->executionContext();
if (!secureContext->securityOrigin()->canAccessFileSystem() || !secureContext->securityOrigin()->canRequest(completedURL)) {
DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::SECURITY_ERR));
return;
}
if (!completedURL.isValid()) {
DOMFileSystem::scheduleCallback(worker, errorCallback, FileError::create(FileError::ENCODING_ERR));
return;
}
LocalFileSystem::from(worker)->resolveURL(worker, completedURL, ResolveURICallbacks::create(successCallback, errorCallback, worker));
}
示例14: execute
virtual void execute(const DOM::Node<string_type, string_adaptor>& node,
ExecutionContext<string_type, string_adaptor>& context) const
{
ChainStackFrame<string_type, string_adaptor> frame(context);
if(test_->evaluateAsBool(node, context.xpathContext()))
this->execute_children(node, context);
} // execute
示例15: SetupDeclVendor
static void SetupDeclVendor(ExecutionContext &exe_ctx, Target *target) {
if (ClangModulesDeclVendor *decl_vendor =
target->GetClangModulesDeclVendor()) {
const ClangModulesDeclVendor::ModuleVector &hand_imported_modules =
llvm::cast<ClangPersistentVariables>(
target->GetPersistentExpressionStateForLanguage(
lldb::eLanguageTypeC))
->GetHandLoadedClangModules();
ClangModulesDeclVendor::ModuleVector modules_for_macros;
for (ClangModulesDeclVendor::ModuleID module : hand_imported_modules) {
modules_for_macros.push_back(module);
}
if (target->GetEnableAutoImportClangModules()) {
if (StackFrame *frame = exe_ctx.GetFramePtr()) {
if (Block *block = frame->GetFrameBlock()) {
SymbolContext sc;
block->CalculateSymbolContext(&sc);
if (sc.comp_unit) {
StreamString error_stream;
decl_vendor->AddModulesForCompileUnit(
*sc.comp_unit, modules_for_macros, error_stream);
}
}
}
}
}
}