本文整理汇总了C++中AvmCore::debugger方法的典型用法代码示例。如果您正苦于以下问题:C++ AvmCore::debugger方法的具体用法?C++ AvmCore::debugger怎么用?C++ AvmCore::debugger使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AvmCore
的用法示例。
在下文中一共展示了AvmCore::debugger方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getListener
FunctionObject* TraceClass::getListener()
{
FunctionObject* f = 0;
#ifdef DEBUGGER
AvmCore *core = this->core();
if (core->debugger())
f = core->debugger()->trace_callback;
#endif /* DEBUGGER */
return f;
}
示例2: getLevel
int TraceClass::getLevel(int target)
{
int lvl = 0 ; /*Debugger::TRACE_OFF;*/
#ifdef DEBUGGER
AvmCore *core = this->core();
if (core->debugger())
{
if (target > 1)
lvl = core->debugger()->astrace_callback;
else
lvl = core->debugger()->astrace_console;
}
#endif /* DEBUGGER */
(void)target;
return lvl;
}
示例3: setLevel
Atom TraceClass::setLevel(int lvl, int target)
{
#ifdef DEBUGGER
AvmCore *core = this->core();
if (core->debugger())
{
if (target > 1)
core->debugger()->astrace_callback = (Debugger::TraceLevel) lvl;
else
core->debugger()->astrace_console = (Debugger::TraceLevel) lvl;
}
#endif /* DEBUGGER */
(void)lvl;
(void)target;
return undefinedAtom;
}
示例4: setListener
void TraceClass::setListener(ScriptObject* f)
{
#ifdef DEBUGGER
AvmCore *core = this->core();
if (core->debugger())
{
// Listeners MUST be functions or null
if ( core->isNullOrUndefined(f->atom()) )
{
f = 0;
}
else if (!AvmCore::istype(f->atom(), core->traits.function_itraits))
{
toplevel()->argumentErrorClass()->throwError( kInvalidArgumentError, core->toErrorString("Function"));
return;
}
//MethodClosure* mc = f->toplevel()->methodClosureClass->create(f->getCallMethodEnv(), f->atom());
core->debugger()->trace_callback = f;
}
#endif /* DEBUGGER */
(void)f;
}
示例5: verify
void MethodInfo::verify(Toplevel *toplevel, AbcEnv* abc_env)
{
AvmAssert(declaringTraits()->isResolved());
resolveSignature(toplevel);
AvmCore* core = this->pool()->core;
if (isNative())
{
union {
GprMethodProc implGPR;
AvmThunkNativeThunker thunker;
AvmThunkNativeThunkerN thunkerN;
} u;
#ifdef DEBUGGER
if (core->debugger())
{
MethodSignaturep ms = getMethodSignature();
if (ms->returnTraitsBT() == BUILTIN_number)
u.thunkerN = MethodInfo::debugEnterExitWrapperN;
else
u.thunker = MethodInfo::debugEnterExitWrapper32;
}
else
#endif
{
u.thunker = this->thunker();
}
this->setNativeImpl(u.implGPR);
}
else
{
#ifdef DEBUGGER
// just a fake CallStackNode here, so that if we throw a verify error,
// we get a stack trace with the method being verified as its top entry.
CallStackNode callStackNode(this);
#endif /* DEBUGGER */
PERFM_NTPROF("verify-ticks");
CodeWriter* coder = NULL;
Verifier verifier(this, toplevel, abc_env);
/*
These "buf" declarations are an unfortunate but expedient hack:
the existing CodeWriter classes (eg CodegenLIR, etc) have historically
always been stack-allocated, thus they have no WB protection on member
fields. Recent changes were made to allow for explicit cleanup() of them
in the event of exception, but there was a latent bug waiting to happen:
the actual automatic var was going out of scope, but still being referenced
(via the 'coder' pointer) in the exception handler, but the area being
pointed to may or may not still be valid. The ideal fix for this would
simply be to heap-allocate the CodeWriters, but that would require going
thru the existing code carefully and inserting WB where appropriate.
Instead, this "expedient" hack uses placement new to ensure the memory
stays valid into the exception handler.
Note: the lack of a call to the dtor of the CodeWriter(s) is not an oversight.
Calling cleanup() on coder is equivalent to running the dtor for all
of the CodeWriters here.
Note: allocated using arrays of intptr_t (rather than char) to ensure alignment is acceptable.
*/
#define MAKE_BUF(name, type) \
intptr_t name[(sizeof(type)+sizeof(intptr_t)-1)/sizeof(intptr_t)]
#if defined FEATURE_NANOJIT
MAKE_BUF(jit_buf, CodegenLIR);
#if defined AVMPLUS_WORD_CODE
MAKE_BUF(teeWriter_buf, TeeWriter);
#endif
#ifdef FEATURE_CFGWRITER
MAKE_BUF(cfg_buf, CFGWriter);
#endif
#endif
#if defined AVMPLUS_WORD_CODE
MAKE_BUF(translator_buf, WordcodeEmitter);
#else
MAKE_BUF(stubWriter_buf, CodeWriter);
#endif
TRY(core, kCatchAction_Rethrow)
{
#if defined FEATURE_NANOJIT
if ((core->IsJITEnabled()) && !suggestInterp())
{
PERFM_NTPROF("verify & IR gen");
// note placement-new usage!
CodegenLIR* jit = new(jit_buf) CodegenLIR(this);
#if defined AVMPLUS_WORD_CODE
WordcodeEmitter* translator = new(translator_buf) WordcodeEmitter(this, toplevel);
TeeWriter* teeWriter = new(teeWriter_buf) TeeWriter(translator, jit);
coder = teeWriter;
#else
coder = jit;
#endif
#ifdef FEATURE_CFGWRITER
// analyze code and generate LIR
CFGWriter* cfg = new(cfg_buf) CFGWriter(this, coder);
coder = cfg;
//.........这里部分代码省略.........