mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Added Help for Debug Dialog.
This commit is contained in:
+29
-50
@@ -37,7 +37,10 @@ SeerDebugDialog::SeerDebugDialog (QWidget* parent) : QDialog(parent) {
|
||||
QObject::connect(loadCoreFilenameToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleLoadCoreFilenameToolButton);
|
||||
QObject::connect(breakpointInFunctionLineEdit, &QLineEdit::textChanged, this, &SeerDebugDialog::handleBreakpointInFunctionLineEdit);
|
||||
QObject::connect(attachProgramPidToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleProgramPidToolButton);
|
||||
QObject::connect(helpCoreToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleHelpCoreToolButtonClicked);
|
||||
QObject::connect(helpRunToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleHelpRunToolButtonClicked);
|
||||
QObject::connect(helpAttachToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleHelpAttachToolButtonClicked);
|
||||
QObject::connect(helpConnectToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleHelpConnectToolButtonClicked);
|
||||
QObject::connect(helpCorefileToolButton, &QToolButton::clicked, this, &SeerDebugDialog::handleHelpCorefileToolButtonClicked);
|
||||
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0))
|
||||
QObject::connect(runModeTabWidget, &QTabWidget::currentChanged, this, &SeerDebugDialog::handleRunModeChanged);
|
||||
@@ -343,34 +346,6 @@ void SeerDebugDialog::handleRunModeChanged (int id) {
|
||||
executableWorkingDirectoryLineEdit->setEnabled(false);
|
||||
executableWorkingDirectoryToolButton->setEnabled(false);
|
||||
|
||||
// ID == 0 RUN/START
|
||||
runProgramArgumentsLabel->setEnabled(false);
|
||||
runProgramArgumentsLineEdit->setEnabled(false);
|
||||
loadBreakpointsFilenameLabel->setEnabled(false);
|
||||
loadBreakpointsFilenameLineEdit->setEnabled(false);
|
||||
loadBreakpointsFilenameToolButton->setEnabled(false);
|
||||
noBreakpointRadioButton->setEnabled(false);
|
||||
breakpointInMainRadioButton->setEnabled(false);
|
||||
breakpointInFunctionRadioButton->setEnabled(false);
|
||||
breakpointInFunctionLineEdit->setEnabled(false);
|
||||
showAsseblyTabCheckBox->setEnabled(false);
|
||||
randomizeStartAddressCheckBox->setEnabled(false);
|
||||
nonStopModeCheckBox->setEnabled(false);
|
||||
|
||||
// ID == 1 ATTACH
|
||||
attachProgramPidLabel->setEnabled(false);
|
||||
attachProgramPidLineEdit->setEnabled(false);
|
||||
attachProgramPidToolButton->setEnabled(false);
|
||||
|
||||
// ID == 2 CONNECT
|
||||
connectProgramHostPortLabel->setEnabled(false);
|
||||
connectProgramHostPortLineEdit->setEnabled(false);
|
||||
|
||||
// ID == 3 CORE
|
||||
loadCoreFilenameLabel->setEnabled(false);
|
||||
loadCoreFilenameLineEdit->setEnabled(false);
|
||||
loadCoreFilenameToolButton->setEnabled(false);
|
||||
|
||||
//
|
||||
// Enable the newly selected one.
|
||||
//
|
||||
@@ -383,18 +358,6 @@ void SeerDebugDialog::handleRunModeChanged (int id) {
|
||||
executableSymbolNameToolButton->setEnabled(true);
|
||||
executableWorkingDirectoryLineEdit->setEnabled(true);
|
||||
executableWorkingDirectoryToolButton->setEnabled(true);
|
||||
runProgramArgumentsLabel->setEnabled(true);
|
||||
runProgramArgumentsLineEdit->setEnabled(true);
|
||||
loadBreakpointsFilenameLabel->setEnabled(true);
|
||||
loadBreakpointsFilenameLineEdit->setEnabled(true);
|
||||
loadBreakpointsFilenameToolButton->setEnabled(true);
|
||||
noBreakpointRadioButton->setEnabled(true);
|
||||
breakpointInMainRadioButton->setEnabled(true);
|
||||
breakpointInFunctionRadioButton->setEnabled(true);
|
||||
breakpointInFunctionLineEdit->setEnabled(true);
|
||||
showAsseblyTabCheckBox->setEnabled(true);
|
||||
randomizeStartAddressCheckBox->setEnabled(true);
|
||||
nonStopModeCheckBox->setEnabled(true);
|
||||
}
|
||||
|
||||
// ID == 1 ATTACH
|
||||
@@ -403,30 +366,46 @@ void SeerDebugDialog::handleRunModeChanged (int id) {
|
||||
executableNameToolButton->setEnabled(true);
|
||||
executableSymbolNameLineEdit->setEnabled(true);
|
||||
executableSymbolNameToolButton->setEnabled(true);
|
||||
attachProgramPidLabel->setEnabled(true);
|
||||
attachProgramPidLineEdit->setEnabled(true);
|
||||
attachProgramPidToolButton->setEnabled(true);
|
||||
}
|
||||
|
||||
// ID == 2 CONNECT
|
||||
if (id == 2) {
|
||||
executableSymbolNameLineEdit->setEnabled(true);
|
||||
executableSymbolNameToolButton->setEnabled(true);
|
||||
connectProgramHostPortLabel->setEnabled(true);
|
||||
connectProgramHostPortLineEdit->setEnabled(true);
|
||||
}
|
||||
|
||||
// ID == 3 CORE
|
||||
if (id == 3) {
|
||||
executableSymbolNameLineEdit->setEnabled(true);
|
||||
executableSymbolNameToolButton->setEnabled(true);
|
||||
loadCoreFilenameLabel->setEnabled(true);
|
||||
loadCoreFilenameLineEdit->setEnabled(true);
|
||||
loadCoreFilenameToolButton->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
void SeerDebugDialog::handleHelpCoreToolButtonClicked () {
|
||||
void SeerDebugDialog::handleHelpRunToolButtonClicked () {
|
||||
|
||||
SeerHelpPageDialog* help = new SeerHelpPageDialog(this);
|
||||
help->loadFile(":/seer/resources/help/RunDebugMode.md");
|
||||
help->show();
|
||||
help->raise();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::handleHelpAttachToolButtonClicked () {
|
||||
|
||||
SeerHelpPageDialog* help = new SeerHelpPageDialog(this);
|
||||
help->loadFile(":/seer/resources/help/AttachDebugMode.md");
|
||||
help->show();
|
||||
help->raise();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::handleHelpConnectToolButtonClicked () {
|
||||
|
||||
SeerHelpPageDialog* help = new SeerHelpPageDialog(this);
|
||||
help->loadFile(":/seer/resources/help/ConnectDebugMode.md");
|
||||
help->show();
|
||||
help->raise();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::handleHelpCorefileToolButtonClicked () {
|
||||
|
||||
SeerHelpPageDialog* help = new SeerHelpPageDialog(this);
|
||||
help->loadFile(":/seer/resources/help/CorefileDebugMode.md");
|
||||
|
||||
@@ -67,7 +67,10 @@ class SeerDebugDialog : public QDialog, protected Ui::SeerDebugDialogForm {
|
||||
void handleRunModeChanged (int id);
|
||||
|
||||
private slots:
|
||||
void handleHelpCoreToolButtonClicked ();
|
||||
void handleHelpRunToolButtonClicked ();
|
||||
void handleHelpAttachToolButtonClicked ();
|
||||
void handleHelpConnectToolButtonClicked ();
|
||||
void handleHelpCorefileToolButtonClicked ();
|
||||
|
||||
protected:
|
||||
void writeSettings ();
|
||||
|
||||
@@ -655,7 +655,7 @@
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="helpCoreToolButton">
|
||||
<widget class="QToolButton" name="helpCorefileToolButton">
|
||||
<property name="toolTip">
|
||||
<string>Help for Corefile launch method.</string>
|
||||
</property>
|
||||
|
||||
@@ -18,12 +18,9 @@ SeerHelpPageDialog::SeerHelpPageDialog(QDialog* parent) : QDialog(parent) {
|
||||
|
||||
textBrowser->setOpenExternalLinks(true);
|
||||
|
||||
QAbstractButton* printToolButton = new QToolButton;
|
||||
printToolButton->setIcon(QIcon(":/seer/resources/RelaxLightIcons/document-print.svg"));
|
||||
|
||||
buttonBox->addButton(printToolButton, QDialogButtonBox::NoRole);
|
||||
|
||||
// Connect things.
|
||||
QObject::connect(printToolButton, &QToolButton::clicked, this, &SeerHelpPageDialog::handlePrintToolButton);
|
||||
QObject::connect(okPushButton, &QPushButton::clicked, this, &SeerHelpPageDialog::handleOkPushButton);
|
||||
|
||||
// Restore window settings.
|
||||
readSettings();
|
||||
@@ -57,6 +54,26 @@ void SeerHelpPageDialog::loadText (const QString& text) {
|
||||
textBrowser->moveCursor(QTextCursor::Start);
|
||||
}
|
||||
|
||||
void SeerHelpPageDialog::handlePrintToolButton () {
|
||||
|
||||
QPrinter printer;
|
||||
|
||||
QPrintDialog* dlg = new QPrintDialog(&printer, this);
|
||||
|
||||
if (dlg->exec() != QDialog::Accepted) {
|
||||
return;
|
||||
}
|
||||
|
||||
QTextDocument* document = textBrowser->document();
|
||||
|
||||
document->print(&printer);
|
||||
}
|
||||
|
||||
void SeerHelpPageDialog::handleOkPushButton () {
|
||||
|
||||
done(QDialog::Accepted);
|
||||
}
|
||||
|
||||
void SeerHelpPageDialog::writeSettings() {
|
||||
|
||||
QSettings settings;
|
||||
|
||||
@@ -22,6 +22,9 @@ class SeerHelpPageDialog: public QDialog, protected Ui::SeerHelpPageDialogForm {
|
||||
void resizeEvent (QResizeEvent* event);
|
||||
|
||||
protected slots:
|
||||
void handlePrintToolButton ();
|
||||
void handleOkPushButton ();
|
||||
|
||||
private:
|
||||
};
|
||||
|
||||
|
||||
+44
-44
@@ -13,7 +13,7 @@
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
@@ -27,52 +27,52 @@
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="standardButtons">
|
||||
<set>QDialogButtonBox::Ok</set>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QToolButton" name="printToolButton">
|
||||
<property name="toolTip">
|
||||
<string>Print Help page.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resource.qrc">
|
||||
<normaloff>:/seer/resources/RelaxLightIcons/document-print.svg</normaloff>:/seer/resources/RelaxLightIcons/document-print.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="okPushButton">
|
||||
<property name="toolTip">
|
||||
<string>Dismiss Help page.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>OK</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>SeerHelpPageDialogForm</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>248</x>
|
||||
<y>254</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>157</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>SeerHelpPageDialogForm</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
<resources>
|
||||
<include location="resource.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
@@ -62,6 +62,9 @@
|
||||
<file>resources/help/CodeManager.md</file>
|
||||
<file>resources/help/BreakpointGdbSeerManager.md</file>
|
||||
<file>resources/help/MainWindow.md</file>
|
||||
<file>resources/help/RunDebugMode.md</file>
|
||||
<file>resources/help/AttachDebugMode.md</file>
|
||||
<file>resources/help/ConnectDebugMode.md</file>
|
||||
<file>resources/help/CorefileDebugMode.md</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
## Attach debug mode
|
||||
|
||||
### Introduction
|
||||
|
||||
This mode allows Seer to debug a locally running process by attaching to the PID.
|
||||
|
||||
### Requirements
|
||||
In this mode, Seer needs:
|
||||
|
||||
* The executable
|
||||
* Optional symbol file if the executable doesn't have debug information
|
||||
* The PID of the process.
|
||||
|
||||
### What can you do?
|
||||
In this mode, Seer will attach to the process and immediately interrupt it with a SIGINT.
|
||||
Seer will show the source and line number where the program was interrupted. The program's stack and threads are shown.
|
||||
|
||||
From this point, you can debug the process as normal (stepping and setting breakpoints, etc...)
|
||||
|
||||
### References
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
## Connect debug mode
|
||||
|
||||
### Introduction
|
||||
|
||||
This mode allows Seer to a local or remote process that was started with gdbserver (or other gdb servers).
|
||||
|
||||
Typically, the gdbserver starts the process and interrupts it before anything happens. It then waits for
|
||||
something to connect to it. When Seer connects with it, the process is ready to continue executing.
|
||||
|
||||
|
||||
### Requirements
|
||||
In this mode, Seer needs:
|
||||
|
||||
* Optional symbol file if the executable doesn't have debug information
|
||||
* How to look for the gdbserver (machine and port)
|
||||
* Optional gdb commands to execute before and after Seer connects to the gdbserver.
|
||||
|
||||
### What can you do?
|
||||
In this mode, Seer will connect to the process via the gdbserver. Typically you set breakpoints first then
|
||||
tell the process to continue. From this point, you can debug the process as normal (stepping and setting breakpoints, etc...)
|
||||
|
||||
|
||||
### References
|
||||
|
||||
Check references for gdbserver and other gdb servers.
|
||||
|
||||
* gdbserver
|
||||
* valgrind vgdb
|
||||
* servers for embedded development
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
This mode allows Seer to debug corefiles. Corefiles are files that are the state of a process that exits unexepectedly
|
||||
via a signal (SIGTERM, SIGSEGV, etc...)
|
||||
|
||||
### Needed files
|
||||
### Requirements
|
||||
In this mode, Seer needs:
|
||||
|
||||
* The executable
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
## Run debug mode
|
||||
|
||||
### Introduction
|
||||
This mode allows Seer to debug a program by starting the program itself. This is the most typical
|
||||
way of using Seer.
|
||||
|
||||
### Requirements
|
||||
In this mode, Seer needs:
|
||||
|
||||
* The executable
|
||||
* Optional symbol file if the executable doesn't have debug information
|
||||
* Optional working directory to run the program from
|
||||
* Arguments to run the program with
|
||||
* Various Seer/gdb options to start the program by
|
||||
|
||||
### What can you do?
|
||||
If 'start' is selected, the program is started and breaks in 'main'.
|
||||
|
||||
If 'run' is selected, the program is started and executes without any breakpoints unless they are
|
||||
specified in the optional breakpoint file.
|
||||
|
||||
From this point, you can debug the process as normal (stepping and setting breakpoints, etc...)
|
||||
|
||||
### References
|
||||
|
||||
Reference in New Issue
Block a user