mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 08:34:42 +08:00
First attempt.
This commit is contained in:
@@ -100,6 +100,7 @@ set(HEADER_FILES
|
||||
QStringPair.h
|
||||
QHistoryLineEdit.h
|
||||
QEditDelegate.h
|
||||
QHContainerWidget.h
|
||||
)
|
||||
|
||||
set(SOURCE_FILES
|
||||
@@ -182,6 +183,7 @@ set(SOURCE_FILES
|
||||
QIndexTreeWidget.cpp
|
||||
QHistoryLineEdit.cpp
|
||||
QEditDelegate.cpp
|
||||
QHContainerWidget.cpp
|
||||
)
|
||||
|
||||
qt5_add_resources(SOURCE_FILES resource.qrc)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "QHContainerWidget.h"
|
||||
|
||||
QHContainerWidget::QHContainerWidget (QWidget* parent) : QWidget(parent) {
|
||||
|
||||
// Construct the UI.
|
||||
setupUi(this);
|
||||
|
||||
// Setup the widgets
|
||||
// Connect things.
|
||||
}
|
||||
|
||||
QHContainerWidget::~QHContainerWidget () {
|
||||
}
|
||||
|
||||
void QHContainerWidget::addWidget (QWidget* widget) {
|
||||
|
||||
horizontalLayout->addWidget(widget);
|
||||
}
|
||||
|
||||
void QHContainerWidget::removeWidget (QWidget* widget) {
|
||||
|
||||
horizontalLayout->removeWidget(widget);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
#pragma once
|
||||
|
||||
#include <QtWidgets/QWidget>
|
||||
#include "ui_QHContainerWidget.h"
|
||||
|
||||
class QHContainerWidget : public QWidget, protected Ui::QHContainerWidgetForm {
|
||||
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit QHContainerWidget (QWidget* parent = 0);
|
||||
~QHContainerWidget ();
|
||||
|
||||
void addWidget (QWidget* widget);
|
||||
void removeWidget (QWidget* widget);
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>QHContainerWidgetForm</class>
|
||||
<widget class="QWidget" name="QHContainerWidgetForm">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>QHContainerWidgetForm</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -1,6 +1,10 @@
|
||||
#include "SeerThreadManagerWidget.h"
|
||||
#include "QHContainerWidget.h"
|
||||
#include <QtWidgets/QToolButton>
|
||||
#include <QtWidgets/QTextBrowser>
|
||||
#include <QtGui/QIcon>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QtCore/QDirIterator>
|
||||
#include <QtCore/QDebug>
|
||||
|
||||
SeerThreadManagerWidget::SeerThreadManagerWidget (QWidget* parent) : QWidget(parent) {
|
||||
@@ -25,10 +29,20 @@ SeerThreadManagerWidget::SeerThreadManagerWidget (QWidget* parent) : QWidget(par
|
||||
QToolButton* refreshToolButton = new QToolButton(tabWidget);
|
||||
refreshToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/view-refresh.svg"));
|
||||
refreshToolButton->setToolTip("Refresh the thread information.");
|
||||
tabWidget->setCornerWidget(refreshToolButton, Qt::TopRightCorner);
|
||||
|
||||
QToolButton* helpToolButton = new QToolButton(tabWidget);
|
||||
helpToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/help-about.svg"));
|
||||
helpToolButton->setToolTip("Help on thread information.");
|
||||
|
||||
QHContainerWidget* hcontainer = new QHContainerWidget(this);
|
||||
hcontainer->addWidget(refreshToolButton);
|
||||
hcontainer->addWidget(helpToolButton);
|
||||
|
||||
tabWidget->setCornerWidget(hcontainer, Qt::TopRightCorner);
|
||||
|
||||
// Connect things.
|
||||
QObject::connect(refreshToolButton, &QToolButton::clicked, this, &SeerThreadManagerWidget::handleRefreshToolButtonClicked);
|
||||
QObject::connect(helpToolButton, &QToolButton::clicked, this, &SeerThreadManagerWidget::handleHelpToolButtonClicked);
|
||||
QObject::connect(schedulerLockingComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerThreadManagerWidget::handleSchedulerLockingComboBox);
|
||||
QObject::connect(scheduleMultipleComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerThreadManagerWidget::handleScheduleMultipleComboBox);
|
||||
QObject::connect(forkFollowsComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &SeerThreadManagerWidget::handleForkFollowComboBox);
|
||||
@@ -86,6 +100,24 @@ void SeerThreadManagerWidget::handleRefreshToolButtonClicked () {
|
||||
threadGroupsBrowserWidget()->refresh();
|
||||
}
|
||||
|
||||
void SeerThreadManagerWidget::handleHelpToolButtonClicked () {
|
||||
|
||||
// Get the Help text from the resource.
|
||||
QFile file(":/seer/resources/help/ThreadProcessInfoBrowser.md");
|
||||
file.open(QFile::ReadOnly | QFile::Text);
|
||||
|
||||
QTextStream stream(&file);
|
||||
|
||||
QString text = stream.readAll();
|
||||
|
||||
// Put the Help text in as markdown. Move back to the begining.
|
||||
QTextBrowser* browser = new QTextBrowser(0);
|
||||
browser->setOpenExternalLinks(true);
|
||||
browser->setMarkdown(text);
|
||||
browser->moveCursor(QTextCursor::Start);
|
||||
browser->show();
|
||||
}
|
||||
|
||||
void SeerThreadManagerWidget::handleSchedulerLockingComboBox (int index) {
|
||||
|
||||
Q_UNUSED(index);
|
||||
|
||||
@@ -37,6 +37,7 @@ class SeerThreadManagerWidget : public QWidget, protected Ui::SeerThreadManagerW
|
||||
|
||||
private slots:
|
||||
void handleRefreshToolButtonClicked ();
|
||||
void handleHelpToolButtonClicked ();
|
||||
void handleSchedulerLockingComboBox (int index);
|
||||
void handleScheduleMultipleComboBox (int index);
|
||||
void handleForkFollowComboBox (int index);
|
||||
|
||||
@@ -48,6 +48,8 @@
|
||||
<file>resources/RelaxLightIcons/debug-step-into.svg</file>
|
||||
<file>resources/RelaxLightIcons/debug-step-out.svg</file>
|
||||
<file>resources/RelaxLightIcons/debug-step-over.svg</file>
|
||||
<file>resources/RelaxLightIcons/help-about.svg</file>
|
||||
<file>resources/RelaxLightIcons/help-whatsthis.svg</file>
|
||||
<file>resources/help/ThreadProcessInfoBrowser.md</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24">
|
||||
<defs id="defs3051">
|
||||
<style type="text/css" id="current-color-scheme">
|
||||
.ColorScheme-Text {
|
||||
color:#232629;
|
||||
}
|
||||
</style>
|
||||
</defs>
|
||||
<g transform="translate(1,1)">
|
||||
<path style="fill:currentColor;fill-opacity:1;stroke:none" d="M 11 3 C 6.568 3 3 6.568 3 11 C 3 15.432 6.568 19 11 19 C 15.432 19 19 15.432 19 11 C 19 6.568 15.432 3 11 3 z M 11 4 C 14.878 4 18 7.122 18 11 C 18 14.878 14.878 18 11 18 C 7.122 18 4 14.878 4 11 C 4 7.122 7.122 4 11 4 z M 10 6 L 10 8 L 12 8 L 12 6 L 10 6 z M 10 9 L 10 16 L 12 16 L 12 9 L 10 9 z " class="ColorScheme-Text"/>
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 683 B |
@@ -18,19 +18,18 @@ Frames is the most useful. It presents a list of Thread Ids the program is curre
|
||||
|
||||
|
||||
This information is shown for each Thread Id:
|
||||
<br>
|
||||
|
||||
|Column |Description |
|
||||
|---------|---------------------------------------------------|
|
||||
|Thread Id|An id given to the thread/process by gdb |
|
||||
|State |The running state of the id. 'running' or 'stopped'|
|
||||
|Target Id|Details of the id. Thread or process info |
|
||||
|Function |The function name the thread id is in |
|
||||
|File |The filename the thread id is in |
|
||||
|Line |The line number in the filename |
|
||||
|Arguments|The arguments passed to the function |
|
||||
|Core |Which cpu core the thread id is running on |
|
||||
|
||||
```
|
||||
| Column | Description |
|
||||
| ---------- | --------------------------------------------------- |
|
||||
| Thread Id | An id given to the thread/process by gdb |
|
||||
| State | The running state of the id. 'running' or 'stopped' |
|
||||
| Target Id | Details of the id. Thread or process info |
|
||||
| Function | The function name the thread id is in |
|
||||
| File | The filename the thread id is in |
|
||||
| Line | The line number in the filename |
|
||||
| Arguments | The arguments passed to the function |
|
||||
| Core | Which cpu core the thread id is running on |
|
||||
```
|
||||
Clicking on a Thread Id will cause Seer to make that Thread Id the active thread. This will in turn cause the Stack Info Browser to refer to that Thread Id.
|
||||
|
||||
### Ids
|
||||
@@ -39,23 +38,21 @@ Ids is a simplified list ofThread Ids, with no other information. Clicking on a
|
||||
### Groups
|
||||
Groups is a list of Thread Groups. Basically, inferior processes. Most programs are just one inferior, even if they use threads. Program's that use fork and exec will have multiple inferiors.
|
||||
This information is shown for each Thread Id:
|
||||
<br>
|
||||
|
||||
|Column |Description |
|
||||
|---------------|----------------------------------------------|
|
||||
|Thread Group Id|An id given to the thread/process group by gdb|
|
||||
|Type |The Thread Group type. Usually 'process' type |
|
||||
|Pid |The process id |
|
||||
|Executable |The name and path of the process executable |
|
||||
|Cores |List of cpu cores used by the process |
|
||||
|
||||
|
||||
```
|
||||
| Column | Description |
|
||||
| --------------- | ---------------------------------------------- |
|
||||
| Thread Group Id | An id given to the thread/process group by gdb |
|
||||
| Type | The Thread Group type. Usually 'process' type |
|
||||
| Pid | The process id |
|
||||
| Executable | The name and path of the process executable |
|
||||
| Cores | List of cpu cores used by the process |
|
||||
```
|
||||
### References
|
||||
|
||||
Consult these gdb references
|
||||
|
||||
1. [Link](https://sourceware.org/gdb/onlinedocs/gdb/Threads.html#thread-ID-lists) Listing thread information.
|
||||
1. [Link](https://sourceware.org/gdb/onlinedocs/gdb/All_002dStop-Mode.html#All_002dStop-Mode) GDB all-stop mode.
|
||||
1. [Link](https://sourceware.org/gdb/onlinedocs/gdb/Forks.html) GDB follow-fork mode.
|
||||
2. [Link](https://sourceware.org/gdb/onlinedocs/gdb/All_002dStop-Mode.html#All_002dStop-Mode) GDB all-stop mode.
|
||||
3. [Link](https://sourceware.org/gdb/onlinedocs/gdb/Forks.html) GDB follow-fork mode.
|
||||
|
||||
<br>
|
||||
|
||||
Reference in New Issue
Block a user