mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
If the function name is "??", use the function address.
This commit is contained in:
@@ -43,6 +43,15 @@ const QString& SeerParallelStacksFrame::function () const {
|
|||||||
return _function;
|
return _function;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString SeerParallelStacksFrame::functionOrAddr () const {
|
||||||
|
|
||||||
|
if (_function == "??") {
|
||||||
|
return _addr;
|
||||||
|
}
|
||||||
|
|
||||||
|
return _function;
|
||||||
|
}
|
||||||
|
|
||||||
const QString& SeerParallelStacksFrame::arch () const {
|
const QString& SeerParallelStacksFrame::arch () const {
|
||||||
return _arch;
|
return _arch;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class SeerParallelStacksFrame {
|
|||||||
int level () const;
|
int level () const;
|
||||||
const QString& addr () const;
|
const QString& addr () const;
|
||||||
const QString& function () const;
|
const QString& function () const;
|
||||||
|
QString functionOrAddr () const;
|
||||||
const QString& arch () const;
|
const QString& arch () const;
|
||||||
const QString& from () const;
|
const QString& from () const;
|
||||||
const QString& file () const;
|
const QString& file () const;
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ SeerParallelStacksStackBoxItem::SeerParallelStacksStackBoxItem(const SeerParalle
|
|||||||
qreal maxTextW = headerW;
|
qreal maxTextW = headerW;
|
||||||
|
|
||||||
for (const auto& frame : _stack.frames) {
|
for (const auto& frame : _stack.frames) {
|
||||||
maxTextW = std::max(maxTextW, (qreal)normFm.horizontalAdvance(frame.function()));
|
maxTextW = std::max(maxTextW, (qreal)normFm.horizontalAdvance(frame.functionOrAddr()));
|
||||||
}
|
}
|
||||||
|
|
||||||
_width = maxTextW + 2 * _kPadX;
|
_width = maxTextW + 2 * _kPadX;
|
||||||
@@ -190,7 +190,7 @@ void SeerParallelStacksStackBoxItem::paint(QPainter* painter, const QStyleOption
|
|||||||
painter->setPen(colors.frameText);
|
painter->setPen(colors.frameText);
|
||||||
|
|
||||||
for (const auto& frame : _stack.frames) {
|
for (const auto& frame : _stack.frames) {
|
||||||
painter->drawText(QRectF(_kPadX, y, innerW, _kRowH), Qt::AlignLeft | Qt::AlignVCenter, frame.function());
|
painter->drawText(QRectF(_kPadX, y, innerW, _kRowH), Qt::AlignLeft | Qt::AlignVCenter, frame.functionOrAddr());
|
||||||
y += _kRowH;
|
y += _kRowH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ void SeerParallelStacksStackBoxItem::handleShowPopup() {
|
|||||||
QString frame;
|
QString frame;
|
||||||
|
|
||||||
if (_stack.frames.size() > 0) {
|
if (_stack.frames.size() > 0) {
|
||||||
frame = _stack.frames[0].function();
|
frame = _stack.frames[0].functionOrAddr();
|
||||||
}
|
}
|
||||||
|
|
||||||
_popup = new SeerParallelStacksPopupTableWidget();
|
_popup = new SeerParallelStacksPopupTableWidget();
|
||||||
|
|||||||
Reference in New Issue
Block a user