本文整理汇总了C++中Breakpoint::checkLine方法的典型用法代码示例。如果您正苦于以下问题:C++ Breakpoint::checkLine方法的具体用法?C++ Breakpoint::checkLine怎么用?C++ Breakpoint::checkLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Breakpoint
的用法示例。
在下文中一共展示了Breakpoint::checkLine方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tracer_callback
// http://www.koders.com/cpp/fidBA6CD8A0FE5F41F1464D74733D9A711DA257D20B.aspx?s=PyEval_SetTrace
// http://code.google.com/p/idapython/source/browse/trunk/python.cpp
// http://www.koders.com/cpp/fid191F7B13CF73133935A7A2E18B7BF43ACC6D1784.aspx?s=PyEval_SetTrace
// http://stuff.mit.edu/afs/sipb/project/python/src/python2.2-2.2.2/Modules/_hotshot.c
int PythonDebugger::tracer_callback(PyObject *obj, PyFrameObject *frame, int what, PyObject *arg)
{
PythonDebuggerPy* self = static_cast<PythonDebuggerPy*>(obj);
PythonDebugger* dbg = self->dbg;
if (dbg->d->trystop)
PyErr_SetInterrupt();
QCoreApplication::processEvents();
//int no;
//no = frame->f_tstate->recursion_depth;
//char* name = PyString_AsString(frame->f_code->co_name);
QString file = QString::fromUtf8(PyString_AsString(frame->f_code->co_filename));
switch (what) {
case PyTrace_CALL:
self->depth++;
return 0;
case PyTrace_RETURN:
if (self->depth > 0)
self->depth--;
return 0;
case PyTrace_LINE:
{
//PyObject *str;
//str = PyObject_Str(frame->f_code->co_filename);
//no = frame->f_lineno;
int line = PyCode_Addr2Line(frame->f_code, frame->f_lasti);
//if (str) {
// Base::Console().Message("PROFILING: %s:%d\n", PyString_AsString(str), frame->f_lineno);
// Py_DECREF(str);
//}
// For testing only
if (!dbg->d->trystop) {
Breakpoint bp = dbg->getBreakpoint(file);
if (bp.checkLine(line)) {
dbg->showDebugMarker(file, line);
QEventLoop loop;
QObject::connect(dbg, SIGNAL(signalNextStep()), &loop, SLOT(quit()));
loop.exec();
dbg->hideDebugMarker(file);
}
}
return 0;
}
case PyTrace_EXCEPTION:
return 0;
case PyTrace_C_CALL:
return 0;
case PyTrace_C_EXCEPTION:
return 0;
case PyTrace_C_RETURN:
return 0;
default:
/* ignore PyTrace_EXCEPTION */
break;
}
return 0;
}