// for call lines InstrItem::InstrItem(InstrView* iv, QTreeWidgetItem* parent, Addr addr, TraceInstr* instr, TraceInstrCall* instrCall) : QTreeWidgetItem(parent) { _view = iv; _addr = addr; _instr = instr; _instrCall = instrCall; _instrJump = 0; _inside = true; setTextAlignment(0, Qt::AlignRight); setTextAlignment(1, Qt::AlignRight); setTextAlignment(2, Qt::AlignRight); //qDebug("InstrItem: (file %d, line %d) Linecall to %s", // fileno, lineno, _lineCall->call()->called()->prettyName().toAscii()); SubCost cc = _instrCall->callCount(); QString callStr = " "; if (cc==0) callStr += QObject::tr("Active call to '%1'") .arg(_instrCall->call()->calledName()); else callStr += QObject::tr("%n call(s) to '%2'", "", (uint64)cc) .arg(_instrCall->call()->calledName()); TraceFunction* calledF = _instrCall->call()->called(); calledF->addPrettyLocation(callStr); setText(6, callStr); updateGroup(); updateCost(); }
// for call lines SourceItem::SourceItem(SourceView* sv, QTreeWidgetItem* parent, int fileno, unsigned int lineno, TraceLine* line, TraceLineCall* lineCall) : QTreeWidgetItem(parent) { _view = sv; _lineno = lineno; _fileno = fileno; _inside = true; _line = line; _lineCall = lineCall; _lineJump = 0; setTextAlignment(0, Qt::AlignRight); setTextAlignment(1, Qt::AlignRight); setTextAlignment(2, Qt::AlignRight); //qDebug("SourceItem: (file %d, line %d) Linecall to %s", // fileno, lineno, _lineCall->call()->called()->prettyName().toAscii()); SubCost cc = _lineCall->callCount(); QString callStr = " "; if (cc==0) callStr += QObject::tr("Active call to '%1'") .arg(_lineCall->call()->calledName()); else callStr += QObject::tr("%n call(s) to '%2'", "", (uint64)cc) .arg(_lineCall->call()->calledName()); TraceFunction* calledF = _lineCall->call()->called(); calledF->addPrettyLocation(callStr); setText(4, callStr); updateGroup(); updateCost(); }