2025-12-24 11:20:29 -06:00
|
|
|
// SPDX-FileCopyrightText: 2021 Ernie Pasveer <epasveer@att.net>
|
|
|
|
|
//
|
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <QtWidgets/QWidget>
|
2026-01-17 11:18:45 -06:00
|
|
|
#include <QtCore/QVector>
|
2025-12-24 11:20:29 -06:00
|
|
|
#include "ui_SeerParallelStacksVisualizerWidget.h"
|
|
|
|
|
|
2026-01-17 11:18:45 -06:00
|
|
|
namespace Seer::PSV {
|
|
|
|
|
|
|
|
|
|
class Frame {
|
|
|
|
|
public:
|
|
|
|
|
Frame ();
|
|
|
|
|
Frame (const QString& text);
|
|
|
|
|
~Frame ();
|
|
|
|
|
|
|
|
|
|
int level () const;
|
|
|
|
|
const QString& addr () const;
|
|
|
|
|
const QString& function () const;
|
|
|
|
|
const QString& arch () const;
|
|
|
|
|
const QString& file () const;
|
|
|
|
|
const QString& fullname () const;
|
|
|
|
|
int line () const;
|
|
|
|
|
const QString& type () const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int _level;
|
|
|
|
|
QString _addr;
|
|
|
|
|
QString _function;
|
|
|
|
|
QString _arch;
|
|
|
|
|
QString _file;
|
|
|
|
|
QString _fullname;
|
|
|
|
|
int _line;
|
|
|
|
|
QString _type;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef QVector<Frame> FramesVector;
|
|
|
|
|
|
|
|
|
|
class Thread {
|
|
|
|
|
public:
|
|
|
|
|
Thread ();
|
|
|
|
|
Thread (const QString& text);
|
|
|
|
|
~Thread ();
|
|
|
|
|
|
|
|
|
|
int id () const;
|
|
|
|
|
const QString& target_id () const;
|
|
|
|
|
const QString& name () const;
|
|
|
|
|
const QString& state () const;
|
|
|
|
|
int current () const;
|
|
|
|
|
|
|
|
|
|
int frameCount () const;
|
|
|
|
|
const Frame& frame (int i) const;
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
int _id;
|
|
|
|
|
QString _target_id;
|
|
|
|
|
QString _name;
|
|
|
|
|
QString _state;
|
|
|
|
|
int _current;
|
|
|
|
|
|
|
|
|
|
FramesVector _frames;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
typedef QVector<Thread> ThreadsVector;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-24 11:20:29 -06:00
|
|
|
class SeerParallelStacksVisualizerWidget : public QWidget, protected Ui::SeerParallelStacksVisualizerWidgetForm {
|
|
|
|
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
explicit SeerParallelStacksVisualizerWidget (QWidget* parent = 0);
|
|
|
|
|
~SeerParallelStacksVisualizerWidget ();
|
|
|
|
|
|
|
|
|
|
signals:
|
2026-01-17 11:18:45 -06:00
|
|
|
void refreshParallelStackFrames (int id);
|
2025-12-24 11:20:29 -06:00
|
|
|
|
|
|
|
|
public slots:
|
2026-01-17 11:18:45 -06:00
|
|
|
void handleText (const QString& text);
|
2025-12-24 11:20:29 -06:00
|
|
|
|
|
|
|
|
protected slots:
|
2026-01-17 11:18:45 -06:00
|
|
|
void handleRefreshButton ();
|
|
|
|
|
void handleHelpButton ();
|
|
|
|
|
void handlePrintButton ();
|
|
|
|
|
void handleSaveButton ();
|
2025-12-24 11:20:29 -06:00
|
|
|
|
|
|
|
|
protected:
|
2026-01-17 11:18:45 -06:00
|
|
|
void writeSettings ();
|
|
|
|
|
void readSettings ();
|
|
|
|
|
void resizeEvent (QResizeEvent* event);
|
2025-12-24 11:20:29 -06:00
|
|
|
|
|
|
|
|
private:
|
2026-01-17 11:18:45 -06:00
|
|
|
void createDirectedGraph ();
|
|
|
|
|
|
|
|
|
|
int _id;
|
|
|
|
|
Seer::PSV::ThreadsVector _threads;
|
2025-12-24 11:20:29 -06:00
|
|
|
};
|
|
|
|
|
|