本文整理汇总了C++中SourceFile::hasBreakpoint方法的典型用法代码示例。如果您正苦于以下问题:C++ SourceFile::hasBreakpoint方法的具体用法?C++ SourceFile::hasBreakpoint怎么用?C++ SourceFile::hasBreakpoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SourceFile
的用法示例。
在下文中一共展示了SourceFile::hasBreakpoint方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: debugLine
void Debugger::debugLine(int linenum)
{
AvmAssert( core->callStack !=0 );
if (!core->callStack)
return;
AvmAssert(linenum > 0);
int prev = core->callStack->linenum();
core->callStack->set_linenum(linenum);
int line = linenum;
// line number has changed
bool changed = (prev == line) ? false : true;
bool exited = (prev == -1) ? true : false; // are we being called as a result of function exit?
if (!changed && !exited)
return; // still on the same line in the same function?
Profiler* profiler = core->profiler();
Sampler* s = core->get_sampler();
if (profiler && profiler->profilingDataWanted && profiler->profileSwitch && !(s && s->sampling()))
{
profiler->sendLineTimestamp(line);
}
// tracing information
if (!exited)
traceLine(line);
// check if we should stop due to breakpoint or step
bool stop = false;
if (stepState.flag)
{
if (stepState.startingDepth != -1 && core->callStack->depth() < stepState.startingDepth)
{
// We stepped out of whatever function was executing when the
// stepInto/stepOver/stepOut command was executed. We may be
// in the middle of a line of code, but we still want to stop
// immediately. See bug 126633.
stop = true;
}
else if (!exited && (stepState.depth == -1 || core->callStack->depth() <= stepState.depth) )
{
// We reached the beginning of a new line of code.
stop = true;
}
}
// we didn't decide to stop due to a step, but check if we hit a breakpoint
if (!stop && !exited)
{
MethodInfo* f = core->callStack->info();
#ifdef VMCFG_AOT
if (f && (f->hasMethodBody() || f->isCompiledMethod()))
#else
if (f && f->hasMethodBody())
#endif
{
AbcFile* abc = f->file();
if (abc)
{
SourceFile* source = abc->sourceNamed( core->callStack->filename() );
if (source && source->hasBreakpoint(line))
{
stop = true;
}
}
}
}
// we still haven't decided to stop; check our watchpoints
if (!stop && !exited)
{
if (hitWatchpoint())
stop = true;
}
if (stop)
{
// Terminate whatever step operation may have been happening. But first,
// save the state of the step, so that if someone calls stepContinue(),
// then we can restore it.
StepState oldOldStepState = oldStepState; // save oldStepState in case of reentrancy
oldStepState = stepState; // save stepState so that stepContinue() can find it
stepState.clear(); // turn off stepping
enterDebugger();
oldStepState = oldOldStepState; // restore oldStepState
}
}