cutter/src/widgets/ProcessesWidget.h
yossizap ef97c84351 Add processes widget for kernel and child debugging (#1894)
* Update r2 for dp fixes and general debug fixes

* Added ProcessesWidget for kernel debugging and switching between children

* Update r2 for dpl fixes

* Update r2 for linux and gdbserver dp/dp= fixes

* Added switchedThread and switchedProcess events to refresh their widgets

Seek doesn't always change after switching if the other process is at
the same offset in the same binary so it's better to have another event
for it.

* Disable threads/processes widget during a debugtask/when not debugging and clear it's history after a session

* Improve Processes Widget's UI

- Remove vertical numbers
- Highlight the current process with bold instead of using the "current"
  column

* Updated r2 for fork fixes
2019-12-14 16:44:57 +02:00

50 lines
1021 B
C++

#pragma once
#include <QJsonObject>
#include <memory>
#include <QStandardItem>
#include <QTableView>
#include <QSortFilterProxyModel>
#include "core/Cutter.h"
#include "CutterDockWidget.h"
class MainWindow;
namespace Ui {
class ProcessesWidget;
}
class ProcessesFilterModel : public QSortFilterProxyModel
{
Q_OBJECT
public:
ProcessesFilterModel(QObject *parent = nullptr);
protected:
bool filterAcceptsRow(int row, const QModelIndex &parent) const override;
};
class ProcessesWidget : public CutterDockWidget
{
Q_OBJECT
public:
explicit ProcessesWidget(MainWindow *main, QAction *action = nullptr);
~ProcessesWidget();
private slots:
void updateContents();
void setProcessesGrid();
void fontsUpdatedSlot();
void onActivated(const QModelIndex &index);
private:
QString translateStatus(QString status);
std::unique_ptr<Ui::ProcessesWidget> ui;
QStandardItemModel *modelProcesses;
ProcessesFilterModel *modelFilter;
RefreshDeferrer *refreshDeferrer;
};