当前位置: 首页>>代码示例>>C++>>正文


C++ Breakpoint类代码示例

本文整理汇总了C++中Breakpoint的典型用法代码示例。如果您正苦于以下问题:C++ Breakpoint类的具体用法?C++ Breakpoint怎么用?C++ Breakpoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Breakpoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: breakHandler

void LldbEngine::updateBreakpointData(const GdbMi &bkpt, bool added)
{
    BreakHandler *handler = breakHandler();
    BreakpointResponseId rid = BreakpointResponseId(bkpt["lldbid"].data());
    BreakpointModelId id = BreakpointModelId(bkpt["modelid"].data());
    Breakpoint bp = handler->breakpointById(id);
    if (!bp.isValid())
        bp = handler->findBreakpointByResponseId(rid);
    BreakpointResponse response = bp.response();
    if (added)
        response.id = rid;
    QTC_CHECK(response.id == rid);
    response.address = 0;
    response.enabled = bkpt["enabled"].toInt();
    response.ignoreCount = bkpt["ignorecount"].toInt();
    response.condition = QByteArray::fromHex(bkpt["condition"].data());
    response.hitCount = bkpt["hitcount"].toInt();
    response.fileName = bkpt["file"].toUtf8();
    response.lineNumber = bkpt["line"].toInt();

    GdbMi locations = bkpt["locations"];
    const int numChild = int(locations.children().size());
    if (numChild > 1) {
        foreach (const GdbMi &location, locations.children()) {
            const int locid = location["locid"].toInt();
            BreakpointResponse sub;
            sub.id = BreakpointResponseId(rid.majorPart(), locid);
            sub.type = response.type;
            sub.address = location["addr"].toAddress();
            sub.functionName = location["func"].toUtf8();
            sub.fileName = location["file"].toUtf8();
            sub.lineNumber = location["line"].toInt();
            bp.insertSubBreakpoint(sub);
        }
    } else if (numChild == 1) {
开发者ID:aheubusch,项目名称:qt-creator,代码行数:35,代码来源:lldbengine.cpp

示例2: if

// ---------------------------------------------------------------------------
//	resetEnvelopes
// ---------------------------------------------------------------------------
//	Reset the instantaneous envelope parameters 
// 	(frequency, amplitude, bandwidth, and phase).
// 	The sample rate is needed to convert the 
// 	Breakpoint frequency (Hz) to radians per sample.
//
void 
Oscillator::resetEnvelopes( const Breakpoint & bp, double srate )
{
	//	Remember that the oscillator only knows about 
	//	radian frequency! Convert!
	i_frequency = bp.frequency() * TwoPi / srate;
	i_amplitude = bp.amplitude();
	i_bandwidth = bp.bandwidth();
	determ_phase = bp.phase();
	
 	//	clamp bandwidth:
	if ( i_bandwidth > 1. )
	{
		debugger << "clamping bandwidth at 1." << endl;
		i_bandwidth = 1.;
	}
	else if ( i_bandwidth < 0. )
	{ 
		debugger << "clamping bandwidth at 0." << endl;
		i_bandwidth = 0.;
	}

	//	don't alias:
	if ( i_frequency > Pi )
	{ 
		debugger << "fading out aliasing Partial" << endl;
		i_amplitude = 0.;
	}
}
开发者ID:gesellkammer,项目名称:loris14-extended,代码行数:37,代码来源:Oscillator.C

示例3: MOZ_ASSERT

bool
DebugState::clearBreakpointsIn(JSContext* cx, WasmInstanceObject* instance, js::Debugger* dbg, JSObject* handler)
{
    MOZ_ASSERT(instance);
    if (!breakpointSites_.initialized())
        return true;

    // Make copy of all sites list, so breakpointSites_ can be modified by
    // destroyBreakpointSite calls.
    Vector<WasmBreakpointSite*> sites(cx);
    if (!sites.resize(breakpointSites_.count()))
        return false;
    size_t i = 0;
    for (WasmBreakpointSiteMap::Range r = breakpointSites_.all(); !r.empty(); r.popFront())
        sites[i++] = r.front().value();

    for (WasmBreakpointSite* site : sites) {
        Breakpoint* nextbp;
        for (Breakpoint* bp = site->firstBreakpoint(); bp; bp = nextbp) {
            nextbp = bp->nextInSite();
            if (bp->asWasm()->wasmInstance == instance &&
                (!dbg || bp->debugger == dbg) &&
                (!handler || bp->getHandler() == handler))
            {
                bp->destroy(cx->runtime()->defaultFreeOp());
            }
        }
    }
    return true;
}
开发者ID:mongodb,项目名称:mongo,代码行数:30,代码来源:WasmDebug.cpp

示例4: IsAboutToBeFinalized

void
JSCompartment::sweepBreakpoints(JSContext *cx)
{
    if (JS_CLIST_IS_EMPTY(&cx->runtime->debuggerList))
        return;

    for (CellIterUnderGC i(this, FINALIZE_SCRIPT); !i.done(); i.next()) {
        JSScript *script = i.get<JSScript>();
        if (!script->hasAnyBreakpointsOrStepMode())
            continue;
        bool scriptGone = IsAboutToBeFinalized(cx, script);
        for (unsigned i = 0; i < script->length; i++) {
            BreakpointSite *site = script->getBreakpointSite(script->code + i);
            if (!site)
                continue;
            // nextbp is necessary here to avoid possibly reading *bp after
            // destroying it.
            Breakpoint *nextbp;
            for (Breakpoint *bp = site->firstBreakpoint(); bp; bp = nextbp) {
                nextbp = bp->nextInSite();
                if (scriptGone || IsAboutToBeFinalized(cx, bp->debugger->toJSObject()))
                    bp->destroy(cx);
            }
        }
    }
}
开发者ID:,项目名称:,代码行数:26,代码来源:

示例5: if

// ---------------------------------------------------------------------------
//  resetEnvelopes
// ---------------------------------------------------------------------------
//  Reset the instantaneous envelope parameters
//  (frequency, amplitude, bandwidth, and phase).
//  The Breakpoint frequency (Hz) is in radians per sample.
void
RealtimeOscillator::restoreEnvelopes( const Breakpoint & bp) noexcept
{
    //  Remember that the oscillator only knows about
    //  radian frequency! Convert!
    m_instfrequency = bp.frequency();
    m_instamplitude = bp.amplitude();
    m_instbandwidth = bp.bandwidth();
    m_determphase = bp.phase();

    //  clamp bandwidth:
    if ( m_instbandwidth > 1. )
    {
        m_instbandwidth = 1.;
    }
    else if ( m_instbandwidth < 0. )
    {
        m_instbandwidth = 0.;
    }
    //  don't alias:
    if ( m_instfrequency > Pi )
    {
        m_instamplitude = 0.;
    }

    //  Reset the fitler state too.
    m_filter.clear();
}
开发者ID:EQ4,项目名称:Paraphrasis,代码行数:34,代码来源:RealtimeOscillator.cpp

示例6: ap

void
JSCompartment::sweepBreakpoints(FreeOp *fop)
{
    gcstats::AutoPhase ap(rt->gcStats, gcstats::PHASE_SWEEP_TABLES_BREAKPOINT);

    if (rt->debuggerList.isEmpty())
        return;

    for (CellIterUnderGC i(zone(), FINALIZE_SCRIPT); !i.done(); i.next()) {
        JSScript *script = i.get<JSScript>();
        if (script->compartment() != this || !script->hasAnyBreakpointsOrStepMode())
            continue;
        bool scriptGone = IsScriptAboutToBeFinalized(&script);
        JS_ASSERT(script == i.get<JSScript>());
        for (unsigned i = 0; i < script->length; i++) {
            BreakpointSite *site = script->getBreakpointSite(script->code + i);
            if (!site)
                continue;
            // nextbp is necessary here to avoid possibly reading *bp after
            // destroying it.
            Breakpoint *nextbp;
            for (Breakpoint *bp = site->firstBreakpoint(); bp; bp = nextbp) {
                nextbp = bp->nextInSite();
                if (scriptGone || IsObjectAboutToBeFinalized(&bp->debugger->toJSObjectRef()))
                    bp->destroy(fop);
            }
        }
    }
}
开发者ID:,项目名称:,代码行数:29,代码来源:

示例7: for

void DebuggerIPCServer::handleSetBreakpoint(
      PFPSimDebugger::SetBreakpointMsg msg) {
  int size = msg.condition_list_size();
  Breakpoint br;
  if (msg.temporary() == "1") {
    br.temp = true;
  }
  if (msg.disabled() == "1") {
    br.disabled = true;
  } for (int i = 0; i < size; i++) {
    PFPSimDebugger::BreakpointCondition condition = msg.condition_list(i);
    std::string value = msg.value_list(i);
    if (condition
          == PFPSimDebugger::BreakpointCondition::BREAK_ON_MODULE_READ) {
      br.addCondition(
            Breakpoint::BreakpointCondition::BREAK_ON_MODULE_READ, value);
    } else if (condition
          == PFPSimDebugger::BreakpointCondition::BREAK_ON_MODULE_WRITE) {
      br.addCondition(
            Breakpoint::BreakpointCondition::BREAK_ON_MODULE_WRITE, value);
    } else if (condition
          == PFPSimDebugger::BreakpointCondition::BREAK_ON_PACKET_ID) {
      br.addCondition(
            Breakpoint::BreakpointCondition::BREAK_ON_PACKET_ID, value);
    } else if (condition
          == PFPSimDebugger::BreakpointCondition::BREAK_AT_TIME) {
      br.addCondition(Breakpoint::BreakpointCondition::BREAK_AT_TIME, value);
      br.temp = true;
    }
  }
  data_manager->addBreakpoint(br);
  sendGenericReply();
}
开发者ID:pfpsim,项目名称:PFPSim,代码行数:33,代码来源:DebuggerIPCServer.cpp

示例8: cmd

void LldbEngine::insertBreakpoint(Breakpoint bp)
{
    DebuggerCommand cmd("insertBreakpoint");
    bp.addToCommand(&cmd);
    bp.notifyBreakpointInsertProceeding();
    runCommand(cmd);
}
开发者ID:aheubusch,项目名称:qt-creator,代码行数:7,代码来源:lldbengine.cpp

示例9: breakpoint

void BreakpointModel::markChanged(
    KTextEditor::Document *document,
    KTextEditor::Mark mark,
    KTextEditor::MarkInterface::MarkChangeAction action)
{
    int type = mark.type;
    /* Is this a breakpoint mark, to begin with? */
    if (!(type & AllBreakpointMarks)) return;

    if (action == KTextEditor::MarkInterface::MarkAdded) {
        Breakpoint *b = breakpoint(document->url(), mark.line);
        if (b) {
            //there was already a breakpoint, so delete instead of adding
            b->setDeleted();
            return;
        }
        Breakpoint *breakpoint = addCodeBreakpoint(document->url(), mark.line);
        KTextEditor::MovingInterface *moving = qobject_cast<KTextEditor::MovingInterface*>(document);
        if (moving) {
            KTextEditor::MovingCursor* cursor = moving->newMovingCursor(KTextEditor::Cursor(mark.line, 0));
            // can't use new signal/slot syntax here, MovingInterface is not a QObject
            connect(document, SIGNAL(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)),
                    this, SLOT(aboutToDeleteMovingInterfaceContent(KTextEditor::Document*)), Qt::UniqueConnection);
            breakpoint->setMovingCursor(cursor);
        }
    } else {
开发者ID:mali,项目名称:kdevplatform,代码行数:26,代码来源:breakpointmodel.cpp

示例10: ASSERT

bool Debugger::hasBreakpoint(SourceID sourceID, const TextPosition& position, Breakpoint *hitBreakpoint)
{
    if (!m_breakpointsActivated)
        return false;

    SourceIDToBreakpointsMap::const_iterator it = m_sourceIDToBreakpoints.find(sourceID);
    if (it == m_sourceIDToBreakpoints.end())
        return false;

    unsigned line = position.m_line.zeroBasedInt();
    unsigned column = position.m_column.zeroBasedInt();

    LineToBreakpointsMap::const_iterator breaksIt = it->value.find(line);
    if (breaksIt == it->value.end())
        return false;

    bool hit = false;
    const BreakpointsList& breakpoints = *breaksIt->value;
    Breakpoint* breakpoint;
    for (breakpoint = breakpoints.head(); breakpoint; breakpoint = breakpoint->next()) {
        unsigned breakLine = breakpoint->line;
        unsigned breakColumn = breakpoint->column;
        // Since frontend truncates the indent, the first statement in a line must match the breakpoint (line,0).
        ASSERT(this == m_currentCallFrame->codeBlock()->globalObject()->debugger());
        if ((line != m_lastExecutedLine && line == breakLine && !breakColumn)
            || (line == breakLine && column == breakColumn)) {
            hit = true;
            break;
        }
    }
    if (!hit)
        return false;

    if (hitBreakpoint)
        *hitBreakpoint = *breakpoint;

    if (breakpoint->condition.isEmpty())
        return true;

    // We cannot stop in the debugger while executing condition code,
    // so make it looks like the debugger is already paused.
    TemporaryPausedState pausedState(*this);

    JSValue exception;
    DebuggerCallFrame* debuggerCallFrame = currentDebuggerCallFrame();
    JSValue result = debuggerCallFrame->evaluate(breakpoint->condition, exception);

    // We can lose the debugger while executing JavaScript.
    if (!m_currentCallFrame)
        return false;

    if (exception) {
        // An erroneous condition counts as "false".
        handleExceptionInBreakpointCondition(m_currentCallFrame, exception);
        return false;
    }

    return result.toBoolean(m_currentCallFrame);
}
开发者ID:Vitallium,项目名称:webkit,代码行数:59,代码来源:Debugger.cpp

示例11: phaseTravel

// ---------------------------------------------------------------------------
//	phaseTravel
//
//	Compute the sinusoidal phase travel between two Breakpoints.
//	Return the total unwrapped phase travel.
//
double phaseTravel( const Breakpoint & bp0, const Breakpoint & bp1, 
					double dt )
{
	double f0 = bp0.frequency();
	double f1 = bp1.frequency();
	double favg = .5 * ( f0 + f1 );
	return 2 * Pi * favg * dt;
}
开发者ID:gesellkammer,项目名称:loris14-extended,代码行数:14,代码来源:phasefix.C

示例12: PyErr_SetInterrupt

// 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;
}
开发者ID:JonasThomas,项目名称:free-cad,代码行数:61,代码来源:PythonDebugger.cpp

示例13: dissemble

void dissemble(PFBlock fb)
{
 Opcodes opcode;
 int rmode,rdata, k = 0;
 string name;
 Instruction *pi = fb->pstart;
 while (pi != end_of_code) {
    opcode = (Opcodes)pi->opcode;   
	// *add 1.2.4 HALT+data is not always a breakpoint!
    // (it is used as a NOP + <any useful tag data>)
    if (opcode == HALT) {
        if (pi->data < MAX_BREAKPOINTS) {
          Breakpoint *pb = Breakpoint::from_id(pi->data);
          Instruction ai = pb->saved_instruction();
          std::cout << "*";
          opcode = (Opcodes)ai.opcode;
          rmode = ai.rmode;  rdata = ai.data;
        } else { opcode = NOP; rdata = pi->data; }
    } else {
      rmode  = pi->rmode;  rdata  = pi->data;
    }
    name =  get_opcode_name(opcode);
    std::cout << k++ << ' ' <<  name << '\t';
    if (opcode == CCALL || opcode == CALL || opcode == CALLD || opcode == CALLN) {
       FBlock* pfb;
       void *data = data_ptr(rdata);
       if (opcode == CALLN)
           pfb = Builtin::imported_fblock_from_function((void*)((NFBlock *)data)->pfn);
       else pfb = PFBlock(data_ptr(rdata));     
      if (pfb) Function::from_fun_block(pfb)->dump(std::cout);      
    } else 
    if (opcode == JSWITCH) {
      int *swb = (int *)data_ptr(rdata);
      int sz = *swb++;
      int def = *swb++;
      std::cout << '(' << sz << ',' << def << ") ";
      for (int i = 0; i < sz; i++) std::cout << *swb++ << ' ' << *swb++ << ' ';
    }
    else
    if (opcode == TOSD || opcode == TPODS) {
       PClass pc = *(PClass *)data_ptr(rdata);
       std::cout << pc->name();
    }
    else {
     if (rmode) 
      switch(rmode) {
      case DIRECT: std::cout << "D ";  break;
      case SREL:   std::cout << "R ";  break;
      case OREL:   std::cout << "S ";  break;
     }
     if (rdata != 0) std::cout << rdata;
   }
   std::cout << std::endl;  
   if (opcode == RET || opcode == RETI || opcode == RETD) break;
   pi++;
 }
}
开发者ID:doniexun,项目名称:UnderC,代码行数:57,代码来源:dissem.cpp

示例14: OnChangedBreakpoints

	/// Refresh the breakpoint marks.
	void OnChangedBreakpoints(wxDebugEvent &/*event*/) {
		MarkerDeleteAll(MARKNUM_BREAKPOINT);

		BreakpointList &bps = Mediator::Get()->GetBreakpoints();
		Breakpoint bp;
		for (bp = bps.First(GetKey()); bp.IsOk(); bp = bps.Next(bp)) {
			MarkerAdd(bp.GetLine(), MARKNUM_BREAKPOINT);
		}
	}
开发者ID:amyvmiwei,项目名称:lldebug,代码行数:10,代码来源:sourceview.cpp

示例15: QTC_CHECK

void PdbEngine::removeBreakpoint(Breakpoint bp)
{
    QTC_CHECK(bp.state() == BreakpointRemoveRequested);
    bp.notifyBreakpointRemoveProceeding();
    BreakpointResponse br = bp.response();
    showMessage(_("DELETING BP %1 IN %2").arg(br.id.toString()).arg(bp.fileName()));
    postDirectCommand("clear " + br.id.toByteArray());
    // Pretend it succeeds without waiting for response.
    bp.notifyBreakpointRemoveOk();
}
开发者ID:kowalikm,项目名称:qt-creator,代码行数:10,代码来源:pdbengine.cpp


注:本文中的Breakpoint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。