mirror of
https://github.com/epasveer/seer.git
synced 2026-08-29 16:40:42 +08:00
Change OpenOCD API
This commit is contained in:
+6
-58
@@ -80,7 +80,6 @@ SeerDebugDialog::SeerDebugDialog (QWidget* parent) : QDialog(parent) {
|
||||
QObject::connect(executableOpenOCDButton, &QToolButton::clicked, this, &SeerDebugDialog::handleExecutableOpenOCDButtonClicked);
|
||||
QObject::connect(openOCDMainHelpButton, &QToolButton::clicked, this, &SeerDebugDialog::handleOpenOCDMainHelpButtonClicked);
|
||||
|
||||
QObject::connect(openOcdGdbMultiarchExeButton, &QToolButton::clicked, this, &SeerDebugDialog::handleGdbMultiarchButton);
|
||||
QObject::connect(openocdSymbolFileButton, &QToolButton::clicked, this, &SeerDebugDialog::handleSymbolFileButton);
|
||||
QObject::connect(openocdSourceDirButton, &QToolButton::clicked, this, &SeerDebugDialog::handleSourceDirectoryButton);
|
||||
|
||||
@@ -678,11 +677,6 @@ QJsonDocument SeerDebugDialog::makeJsonDoc() const {
|
||||
modeJson["openocdExe"] = executableOpenOCDPathLineEdit->text();
|
||||
modeJson["openocdCommand"] = openOCDCommandLineEdit->toPlainText();
|
||||
|
||||
// GDB Multiarch Tab
|
||||
modeJson["gdbMultiarchExe"] = openOcdGdbMultiarchLineEdit->text();
|
||||
modeJson["gdbPort"] = openOCD_GDB_Port_LineEdit->text();
|
||||
modeJson["gdbMultiarchCommand"] = openOCDGdbCommandLineEdit->text();
|
||||
|
||||
// Symbol File Tab
|
||||
modeJson["symbolFile"] = symbolFileLineEdit->text();
|
||||
modeJson["sourceDirectory"] = workingDirLineEdit->text();
|
||||
@@ -874,11 +868,6 @@ bool SeerDebugDialog::loadJsonDoc (const QJsonDocument& jsonDoc, const QString&
|
||||
executableOpenOCDPathLineEdit ->setText(openocdModeJson["openocdExe"].toString());
|
||||
openOCDCommandLineEdit ->setPlainText(openocdModeJson["openocdCommand"].toString());
|
||||
|
||||
// GDB Multiarch Tab
|
||||
openOcdGdbMultiarchLineEdit ->setText(openocdModeJson["gdbMultiarchExe"].toString());
|
||||
openOCD_GDB_Port_LineEdit ->setText(openocdModeJson["gdbPort"].toString());
|
||||
openOCDGdbCommandLineEdit ->setText(openocdModeJson["gdbMultiarchCommand"].toString());
|
||||
|
||||
// Symbol file Tab
|
||||
symbolFileLineEdit ->setText(openocdModeJson["symbolFile"].toString());
|
||||
workingDirLineEdit ->setText(openocdModeJson["sourceDirectory"].toString());
|
||||
@@ -900,59 +889,28 @@ bool SeerDebugDialog::loadJsonDoc (const QJsonDocument& jsonDoc, const QString&
|
||||
// openocd get and set functions
|
||||
//
|
||||
// ::Main
|
||||
const QString SeerDebugDialog::openOCDExePath()
|
||||
const QString SeerDebugDialog::openocdExe()
|
||||
{
|
||||
return executableOpenOCDPathLineEdit->text();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::setOpenOCDExePath(const QString& path)
|
||||
void SeerDebugDialog::setOpenocdExe(const QString& path)
|
||||
{
|
||||
executableOpenOCDPathLineEdit->setText(path);
|
||||
}
|
||||
|
||||
const QString SeerDebugDialog::openOCDCommand()
|
||||
const QString SeerDebugDialog::openocdCommand()
|
||||
{
|
||||
QString tmp = openOCDCommandLineEdit->toPlainText();
|
||||
tmp.replace("\n", " ");
|
||||
return tmp;
|
||||
}
|
||||
|
||||
void SeerDebugDialog::setOpenOCDCommand(const QString& command)
|
||||
void SeerDebugDialog::setOpenocdCommand(const QString& command)
|
||||
{
|
||||
openOCDCommandLineEdit->setPlainText(command);
|
||||
}
|
||||
|
||||
// ::GDB Multiarch
|
||||
const QString SeerDebugDialog::gdbMultiarchExePath()
|
||||
{
|
||||
return openOcdGdbMultiarchLineEdit->text();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::setGdbMultiarchExePath(const QString& path)
|
||||
{
|
||||
openOcdGdbMultiarchLineEdit->setText(path);
|
||||
}
|
||||
|
||||
const QString SeerDebugDialog::gdbMultiarchPort()
|
||||
{
|
||||
return openOCD_GDB_Port_LineEdit->text();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::setGdbMultiarchPort(const QString& port)
|
||||
{
|
||||
openOCD_GDB_Port_LineEdit->setText(port);
|
||||
}
|
||||
|
||||
const QString SeerDebugDialog::gdbMultiarchCommand()
|
||||
{
|
||||
return openOCDGdbCommandLineEdit->text();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::setGdbMultiarchCommand(const QString& command)
|
||||
{
|
||||
openOCDGdbCommandLineEdit->setText(command);
|
||||
}
|
||||
|
||||
// ::Symbol Files
|
||||
const QString SeerDebugDialog::symbolFile()
|
||||
{
|
||||
@@ -1241,15 +1199,13 @@ void SeerDebugDialog::handleOpenOCDDefaultButtonClicked() {
|
||||
QString defaultGdbMultiarch = "/usr/bin/gdb-multiarch";
|
||||
QString defaultGDBPort = "3333";
|
||||
executableOpenOCDPathLineEdit->setText(defaultOpenOCDPath);
|
||||
openOcdGdbMultiarchLineEdit->setText(defaultGdbMultiarch);
|
||||
openOCD_GDB_Port_LineEdit->setText(defaultGDBPort);
|
||||
}
|
||||
|
||||
void SeerDebugDialog::handleExecutableOpenOCDButtonClicked () {
|
||||
QString name = QFileDialog::getOpenFileName(this, "Select OpenOCD executable.", openOCDExePath(), "", nullptr, QFileDialog::DontUseNativeDialog);
|
||||
QString name = QFileDialog::getOpenFileName(this, "Select OpenOCD executable.", openocdExe(), "", nullptr, QFileDialog::DontUseNativeDialog);
|
||||
|
||||
if (name != "") {
|
||||
setOpenOCDExePath(name);
|
||||
setOpenocdExe(name);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1261,14 +1217,6 @@ void SeerDebugDialog::handleOpenOCDMainHelpButtonClicked()
|
||||
help->exec();
|
||||
}
|
||||
|
||||
void SeerDebugDialog::handleGdbMultiarchButton () {
|
||||
QString path = QFileDialog::getOpenFileName(this, "Select GDB Multiarch Executable", gdbMultiarchExePath(), "", nullptr, QFileDialog::DontUseNativeDialog);
|
||||
|
||||
if (path != "") {
|
||||
setGdbMultiarchExePath(path);
|
||||
}
|
||||
}
|
||||
|
||||
void SeerDebugDialog::handleSymbolFileButton () {
|
||||
QString path = QFileDialog::getOpenFileName(this, "Select Symbol File", symbolFile(), "", nullptr, QFileDialog::DontUseNativeDialog);
|
||||
|
||||
|
||||
+10
-11
@@ -93,17 +93,17 @@ class SeerDebugDialog : public QDialog, protected Ui::SeerDebugDialogForm {
|
||||
|
||||
// openocd get and set functions
|
||||
// ::Main
|
||||
const QString openOCDExePath ();
|
||||
void setOpenOCDExePath (const QString& path);
|
||||
const QString openOCDCommand ();
|
||||
void setOpenOCDCommand (const QString& command);
|
||||
const QString openocdExe ();
|
||||
void setOpenocdExe (const QString& path);
|
||||
const QString openocdCommand ();
|
||||
void setOpenocdCommand (const QString& command);
|
||||
// ::GDB Multiarch
|
||||
const QString gdbMultiarchExePath ();
|
||||
void setGdbMultiarchExePath (const QString& path);
|
||||
const QString gdbMultiarchPort ();
|
||||
void setGdbMultiarchPort (const QString& port);
|
||||
const QString gdbMultiarchCommand ();
|
||||
void setGdbMultiarchCommand (const QString& command);
|
||||
const QString openocdGdbExe ();
|
||||
void setOpenocdGdbExe (const QString& path);
|
||||
const QString openocdGdbPort ();
|
||||
void setOpenocdGdbPort (const QString& port);
|
||||
const QString openocdGdbCommand ();
|
||||
void setOpenocdGdbCommand (const QString& command);
|
||||
// ::Symbol Files
|
||||
const QString symbolFile ();
|
||||
void setSymbolFile (const QString& path);
|
||||
@@ -142,7 +142,6 @@ class SeerDebugDialog : public QDialog, protected Ui::SeerDebugDialogForm {
|
||||
void handleOpenOCDMainHelpButtonClicked ();
|
||||
void handleSymbolFileButton ();
|
||||
void handleSourceDirectoryButton ();
|
||||
void handleGdbMultiarchButton ();
|
||||
void handleLoadAddrCheckBox (int state);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -1096,230 +1096,6 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="openOCDGdbMultiarchTab">
|
||||
<attribute name="title">
|
||||
<string>GDB Multiarch</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_10">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_32">
|
||||
<item>
|
||||
<widget class="QLabel" name="openOCDMainSettingLabel_2">
|
||||
<property name="text">
|
||||
<string>GDB Multiarch setting</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_13">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>1159</width>
|
||||
<height>33</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QGroupBox" name="executableNameGroupBox_7">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_34">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_23">
|
||||
<item>
|
||||
<widget class="QLabel" name="executableOpenOCDPathLabel_3">
|
||||
<property name="text">
|
||||
<string>GDB Multiarch Additional Command</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="openOCDGdbCommandLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>GDB Multiarch additional command</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>GDB Multiarch additional command. Eg: set architecture aarch64</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_31">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="executableNameGroupBox_3">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_15">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_26">
|
||||
<item>
|
||||
<widget class="QLabel" name="openOCD_GDB_Port_Label">
|
||||
<property name="text">
|
||||
<string>GDB port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="openOCD_GDB_Port_LineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Specify GDB port</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Specify GDB port</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="executableNameGroupBox_5">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="flat">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_33">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_19">
|
||||
<item>
|
||||
<widget class="QLabel" name="openOcdGdbMultiarchPathLabel">
|
||||
<property name="text">
|
||||
<string>GDB Multiarch Executable</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="openOcdGdbMultiarchLineEdit">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Specify GDB Multiarch</string>
|
||||
</property>
|
||||
<property name="placeholderText">
|
||||
<string>Specify GDB Multiarch. Eg: /usr/bin/gdb-multiarch</string>
|
||||
</property>
|
||||
<property name="clearButtonEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="openOcdGdbMultiarchExeButton">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>23</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Open a dialog to select an executable.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="resource.qrc">
|
||||
<normaloff>:/seer/resources/RelaxLightIcons/document-open.svg</normaloff>:/seer/resources/RelaxLightIcons/document-open.svg</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<spacer name="verticalSpacer_6">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab">
|
||||
<attribute name="title">
|
||||
<string>Symbol FIle</string>
|
||||
|
||||
+38
-32
@@ -80,10 +80,6 @@ SeerGdbWidget::SeerGdbWidget (QWidget* parent) : QWidget(parent) {
|
||||
_gdbRecordMode = "";
|
||||
_gdbRecordDirection = "";
|
||||
|
||||
// for openOCD gdb-multiarch support
|
||||
_gdbMultiarchProgram = "/usr/bin/gdb-multiarch";
|
||||
_gdbMultiarchArguments = "--interpreter=mi";
|
||||
|
||||
setIsQuitting(false);
|
||||
setNewExecutableFlag(true);
|
||||
|
||||
@@ -3884,55 +3880,65 @@ void SeerGdbWidget::delay (int seconds) {
|
||||
* OpenOCD getter and setter
|
||||
**********************************************************************************************************************/
|
||||
// ::Main
|
||||
const QString& SeerGdbWidget::openOCDExePath ()
|
||||
const QString& SeerGdbWidget::openocdExe ()
|
||||
{
|
||||
return _openOCDExePath;
|
||||
return _openocdExe;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setOpenOCDExePath (const QString& path)
|
||||
void SeerGdbWidget::setOpenocdExe (const QString& path)
|
||||
{
|
||||
_openOCDExePath = path;
|
||||
_openocdExe = path;
|
||||
}
|
||||
|
||||
const QString& SeerGdbWidget::openOCDCommand ()
|
||||
const QString& SeerGdbWidget::openocdCommand ()
|
||||
{
|
||||
return _openOCDCommands;
|
||||
return _openocdCommands;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setOpenOCDCommand (const QString& command)
|
||||
void SeerGdbWidget::setOpenocdCommand (const QString& command)
|
||||
{
|
||||
_openOCDCommands = command;
|
||||
_openocdCommands = command;
|
||||
}
|
||||
|
||||
// ::GDB Multiarch
|
||||
const QString& SeerGdbWidget::gdbMultiarchExePath ()
|
||||
const QString& SeerGdbWidget::openocdGdbExe ()
|
||||
{
|
||||
return _gdbMultiarchExePath;
|
||||
return _openocdGdbExe;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setGdbMultiarchExePath (const QString& path)
|
||||
void SeerGdbWidget::setOpenocdGdbExe (const QString& path)
|
||||
{
|
||||
_gdbMultiarchExePath = path;
|
||||
_openocdGdbExe = path;
|
||||
}
|
||||
|
||||
const QString& SeerGdbWidget::gdbMultiarchPort ()
|
||||
const QString& SeerGdbWidget::openocdGdbPort ()
|
||||
{
|
||||
return _gdbMultiarchPort;
|
||||
return _openocdGdbPort;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setGdbMultiarchPort (const QString& port)
|
||||
void SeerGdbWidget::setOpenocdGdbPort (const QString& port)
|
||||
{
|
||||
_gdbMultiarchPort = port;
|
||||
_openocdGdbPort = port;
|
||||
}
|
||||
|
||||
const QString& SeerGdbWidget::gdbMultiarchCommand ()
|
||||
const QString& SeerGdbWidget::openocdTelnetPort ()
|
||||
{
|
||||
return _gdbMultiarchCommand;
|
||||
return _openocdTelnetPort;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setGdbMultiarchCommand (const QString& command)
|
||||
void SeerGdbWidget::setOpenocdTelnetPort (const QString& port)
|
||||
{
|
||||
_gdbMultiarchCommand = command;
|
||||
_openocdTelnetPort = port;
|
||||
}
|
||||
|
||||
const QString& SeerGdbWidget::openocdGdbCommand ()
|
||||
{
|
||||
return _openocdGdbCommand;
|
||||
}
|
||||
|
||||
void SeerGdbWidget::setOpenocdGdbCommand (const QString& command)
|
||||
{
|
||||
_openocdGdbCommand = command;
|
||||
}
|
||||
|
||||
// ::Symbol Files
|
||||
@@ -3982,21 +3988,21 @@ const QString& SeerGdbWidget::sourcePath (void)
|
||||
void SeerGdbWidget::handleGdbMultiarchOpenOCDExecutable ()
|
||||
{
|
||||
// Create the OpenOCD console tab, add to the log tabs
|
||||
_openOCDWidget = new SeerOpenOCDWidget();
|
||||
_openOCDWidget->createOpenOCDConsole(commandLogsWidget->logsTabWidgetInstance());
|
||||
_openOCDWidget->newOpenOCDWidget();
|
||||
_openocdWidget = new SeerOpenOCDWidget();
|
||||
_openocdWidget->createOpenOCDConsole(commandLogsWidget->logsTabWidgetInstance());
|
||||
_openocdWidget->newOpenOCDWidget();
|
||||
// Start OpenOCD with the given path and command
|
||||
bool foo = _openOCDWidget->startOpenOCD(openOCDExePath(), openOCDCommand());
|
||||
bool foo = _openocdWidget->startOpenOCD(openocdExe(), openocdCommand());
|
||||
if (foo == false) {
|
||||
QMessageBox::warning(this, "Seer",
|
||||
QString("Unable to launch the OpenOCD program.\n\n") +
|
||||
QString("'%1 %2'").arg(SeerGdbWidget::openOCDExePath()).arg(SeerGdbWidget::openOCDCommand()) + "\n\n" +
|
||||
QString("'%1 %2'").arg(SeerGdbWidget::openocdExe()).arg(SeerGdbWidget::openocdCommand()) + "\n\n" +
|
||||
QString("Please check your OpenOCD configuration."),
|
||||
QMessageBox::Ok);
|
||||
return;
|
||||
}
|
||||
// Now, set _gdbProgram as gdb-multiarch, provided by openocd launch mode
|
||||
setGdbProgram(gdbMultiarchExePath());
|
||||
setGdbProgram(openocdGdbExe());
|
||||
// OpenOCD works in connect mode, so use code of handleGdbConnectExecutable()
|
||||
qCDebug(LC) << "Starting 'openocd gdb-multiarch connect'";
|
||||
|
||||
@@ -4048,7 +4054,7 @@ void SeerGdbWidget::handleGdbMultiarchOpenOCDExecutable ()
|
||||
setGdbRemoteTargetType("extended-remote");
|
||||
|
||||
// Handle additional gdb-multiarch command
|
||||
handleGdbCommand(QString("%1").arg(gdbMultiarchCommand()));
|
||||
handleGdbCommand(QString("%1").arg(openocdGdbExe()));
|
||||
// Load the executable, if needed.
|
||||
if (newExecutableFlag() == true) {
|
||||
QString loadSymbolCmd = "add-symbol-file " + _symbolFile;
|
||||
@@ -4077,7 +4083,7 @@ void SeerGdbWidget::handleGdbMultiarchOpenOCDExecutable ()
|
||||
}
|
||||
|
||||
// Connect to the remote gdbserver using the proper remote type. Only do this when all symbol and source code is loaded
|
||||
handleGdbCommand(QString("-target-select %1 :%2").arg(gdbRemoteTargetType()).arg(gdbMultiarchPort()));
|
||||
handleGdbCommand(QString("-target-select %1 :%2").arg(gdbRemoteTargetType()).arg(openocdGdbPort()));
|
||||
|
||||
// Set window titles with name of program.
|
||||
emit changeWindowTitle(QString("OpenOCD - Gdb-multiarch Debugging session (GDB pid = %1)").arg(_gdbProcess->processId()));
|
||||
|
||||
+19
-18
@@ -211,17 +211,19 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
|
||||
// OpenOCD
|
||||
// ::Main
|
||||
const QString& openOCDExePath ();
|
||||
void setOpenOCDExePath (const QString& path);
|
||||
const QString& openOCDCommand ();
|
||||
void setOpenOCDCommand (const QString& command);
|
||||
const QString& openocdExe ();
|
||||
void setOpenocdExe (const QString& path);
|
||||
const QString& openocdCommand ();
|
||||
void setOpenocdCommand (const QString& command);
|
||||
// ::GDB Multiarch
|
||||
const QString& gdbMultiarchExePath ();
|
||||
void setGdbMultiarchExePath (const QString& path);
|
||||
const QString& gdbMultiarchPort ();
|
||||
void setGdbMultiarchPort (const QString& port);
|
||||
const QString& gdbMultiarchCommand ();
|
||||
void setGdbMultiarchCommand (const QString& command);
|
||||
const QString& openocdGdbExe ();
|
||||
void setOpenocdGdbExe (const QString& path);
|
||||
const QString& openocdGdbPort ();
|
||||
void setOpenocdGdbPort (const QString& port);
|
||||
const QString& openocdTelnetPort ();
|
||||
void setOpenocdTelnetPort (const QString& port);
|
||||
const QString& openocdGdbCommand ();
|
||||
void setOpenocdGdbCommand (const QString& command);
|
||||
|
||||
// ::Symbol Files
|
||||
void setSymbolFile (const QString& file);
|
||||
@@ -470,16 +472,15 @@ class SeerGdbWidget : public QWidget, protected Ui::SeerGdbWidgetForm {
|
||||
QStringList _ignoreFilePatterns;
|
||||
|
||||
// OpenOCD variables
|
||||
SeerOpenOCDWidget* _openOCDWidget;
|
||||
SeerOpenOCDWidget* _openocdWidget;
|
||||
// OpenOCD
|
||||
QString _openOCDExePath;
|
||||
QString _openOCDCommands;
|
||||
QString _openocdExe;
|
||||
QString _openocdCommands;
|
||||
// GDB Multiarch
|
||||
QString _gdbMultiarchExePath;
|
||||
QString _gdbMultiarchPort;
|
||||
QString _gdbMultiarchCommand;
|
||||
QString _gdbMultiarchProgram;
|
||||
QString _gdbMultiarchArguments;
|
||||
QString _openocdGdbExe;
|
||||
QString _openocdGdbPort;
|
||||
QString _openocdTelnetPort;
|
||||
QString _openocdGdbCommand;
|
||||
// Symbol Files
|
||||
bool _loadAddressEnabled;
|
||||
QString _loadAddress;
|
||||
|
||||
+46
-30
@@ -608,11 +608,8 @@ void SeerMainWindow::handleFileDebug (bool loadDefaultProject) {
|
||||
dlg.setPreGdbCommands(executablePreGdbCommands());
|
||||
dlg.setPostGdbCommands(executablePostGdbCommands());
|
||||
// OpenOCD
|
||||
dlg.setOpenOCDExePath(openOCDExePath());
|
||||
dlg.setOpenOCDCommand(openOCDCommand());
|
||||
dlg.setGdbMultiarchExePath(gdbMultiarchExePath());
|
||||
dlg.setGdbMultiarchPort(gdbMultiarchPort());
|
||||
dlg.setGdbMultiarchCommand(gdbMultiarchCommand());
|
||||
dlg.setOpenocdExe(openocdExe());
|
||||
dlg.setOpenocdCommand(openocdCommand());
|
||||
dlg.setSymbolFile(symbolFile());
|
||||
|
||||
// If there's a project, use it.
|
||||
@@ -660,11 +657,8 @@ void SeerMainWindow::handleFileDebug (bool loadDefaultProject) {
|
||||
setExecutablePostGdbCommands(dlg.postGdbCommands());
|
||||
|
||||
// read openocd variables
|
||||
setOpenOCDExePath(dlg.openOCDExePath());
|
||||
setOpenOCDCommand(dlg.openOCDCommand());
|
||||
setGdbMultiarchExePath(dlg.gdbMultiarchExePath());
|
||||
setGdbMultiarchPort(dlg.gdbMultiarchPort());
|
||||
setGdbMultiarchCommand(dlg.gdbMultiarchCommand());
|
||||
setOpenocdExe(dlg.openocdExe());
|
||||
setOpenocdCommand(dlg.openocdCommand());
|
||||
setSymbolFile(dlg.symbolFile());
|
||||
|
||||
launchExecutable(launchMode, breakMode);
|
||||
@@ -806,6 +800,10 @@ void SeerMainWindow::handleSettingsConfiguration () {
|
||||
dlg.setRRProgram(gdbWidget->rrProgram());
|
||||
dlg.setRRArguments(gdbWidget->rrArguments());
|
||||
dlg.setRRGdbArguments(gdbWidget->rrGdbArguments());
|
||||
dlg.setOpenocdExe(gdbWidget->openocdExe());
|
||||
dlg.setOpenocdGdbExe(gdbWidget->openocdGdbExe());
|
||||
dlg.setOpenocdGdbPort(gdbWidget->openocdGdbPort());
|
||||
dlg.setOpenocdTelnetPort(gdbWidget->openocdTelnetPort());
|
||||
|
||||
int ret = dlg.exec();
|
||||
|
||||
@@ -851,6 +849,10 @@ void SeerMainWindow::handleSettingsConfiguration () {
|
||||
gdbWidget->setRRProgram(dlg.rrProgram());
|
||||
gdbWidget->setRRArguments(dlg.rrArguments());
|
||||
gdbWidget->setRRGdbArguments(dlg.rrGdbArguments());
|
||||
gdbWidget->setOpenocdExe(dlg.openocdExe());
|
||||
gdbWidget->setOpenocdGdbExe(dlg.openocdGdbExe());
|
||||
gdbWidget->setOpenocdGdbPort(dlg.openocdGdbPort());
|
||||
gdbWidget->setOpenocdTelnetPort(dlg.openocdTelnetPort());
|
||||
|
||||
// Clear history, if we need to.
|
||||
bool clearManualCommandHistory = dlg.seerClearManualCommandHistory();
|
||||
@@ -1723,6 +1725,13 @@ void SeerMainWindow::writeConfigSettings () {
|
||||
settings.setValue("gdbarguments", gdbWidget->rrGdbArguments());
|
||||
} settings.endGroup();
|
||||
|
||||
settings.beginGroup("openocd"); {
|
||||
settings.setValue("openocdGdbExe", gdbWidget->openocdGdbExe());
|
||||
settings.setValue("openocdExe", gdbWidget->openocdExe());
|
||||
settings.setValue("openocdGdbPort", gdbWidget->openocdGdbPort());
|
||||
settings.setValue("openocdTelnetPort", gdbWidget->openocdTelnetPort());
|
||||
} settings.endGroup();
|
||||
|
||||
settings.beginGroup("editor"); {
|
||||
|
||||
settings.setValue("font", gdbWidget->editorManager()->editorFont().toString());
|
||||
@@ -1815,6 +1824,13 @@ void SeerMainWindow::readConfigSettings () {
|
||||
gdbWidget->setRRGdbArguments(settings.value("gdbarguments", "").toString());
|
||||
} settings.endGroup();
|
||||
|
||||
settings.beginGroup("openocd"); {
|
||||
gdbWidget->setOpenocdGdbExe(settings.value("openocdGdbExe", "/usr/bin/gdb-multiarch").toString());
|
||||
gdbWidget->setOpenocdExe(settings.value("openocdExe", "/usr/local/bin/openocd").toString());
|
||||
gdbWidget->setOpenocdGdbPort(settings.value("openocdGdbPort", "3333").toString());
|
||||
gdbWidget->setOpenocdTelnetPort(settings.value("openocdTelnetPort", "4444").toString());
|
||||
} settings.endGroup();
|
||||
|
||||
settings.beginGroup("editor"); {
|
||||
|
||||
QFont f;
|
||||
@@ -2150,45 +2166,45 @@ void SeerMainWindow::handleGdbTargetInterrupt()
|
||||
/***********************************************************************************************************************
|
||||
* OpenOCD getter and setter
|
||||
**********************************************************************************************************************/
|
||||
const QString& SeerMainWindow::openOCDExePath() {
|
||||
return gdbWidget->openOCDExePath();
|
||||
const QString& SeerMainWindow::openocdExe() {
|
||||
return gdbWidget->openocdExe();
|
||||
}
|
||||
|
||||
void SeerMainWindow::setOpenOCDExePath (const QString& path) {
|
||||
gdbWidget->setOpenOCDExePath(path);
|
||||
void SeerMainWindow::setOpenocdExe (const QString& path) {
|
||||
gdbWidget->setOpenocdExe(path);
|
||||
}
|
||||
|
||||
const QString& SeerMainWindow::openOCDCommand() {
|
||||
return gdbWidget->openOCDCommand();
|
||||
const QString& SeerMainWindow::openocdCommand() {
|
||||
return gdbWidget->openocdCommand();
|
||||
}
|
||||
|
||||
void SeerMainWindow::setOpenOCDCommand (const QString& command){
|
||||
gdbWidget->setOpenOCDCommand(command);
|
||||
void SeerMainWindow::setOpenocdCommand (const QString& command){
|
||||
gdbWidget->setOpenocdCommand(command);
|
||||
}
|
||||
|
||||
// ::GDB Multiarch
|
||||
const QString& SeerMainWindow::gdbMultiarchExePath () {
|
||||
return gdbWidget->gdbMultiarchExePath();
|
||||
const QString& SeerMainWindow::openocdGdbExe () {
|
||||
return gdbWidget->openocdGdbExe();
|
||||
}
|
||||
|
||||
void SeerMainWindow::setGdbMultiarchExePath (const QString& path) {
|
||||
gdbWidget->setGdbMultiarchExePath(path);
|
||||
void SeerMainWindow::setOpenocdGdbExe (const QString& path) {
|
||||
gdbWidget->setOpenocdGdbExe(path);
|
||||
}
|
||||
|
||||
const QString& SeerMainWindow::gdbMultiarchPort() {
|
||||
return gdbWidget->gdbMultiarchPort();
|
||||
const QString& SeerMainWindow::openocdGdbPort() {
|
||||
return gdbWidget->openocdGdbPort();
|
||||
}
|
||||
|
||||
void SeerMainWindow::setGdbMultiarchPort (const QString& port){
|
||||
gdbWidget->setGdbMultiarchPort(port);
|
||||
void SeerMainWindow::setOpenocdGdbPort (const QString& port){
|
||||
gdbWidget->setOpenocdGdbPort(port);
|
||||
}
|
||||
|
||||
const QString& SeerMainWindow::gdbMultiarchCommand () {
|
||||
return gdbWidget->gdbMultiarchCommand();
|
||||
const QString& SeerMainWindow::openocdGdbCommand () {
|
||||
return gdbWidget->openocdGdbCommand();
|
||||
}
|
||||
|
||||
void SeerMainWindow::setGdbMultiarchCommand (const QString& command) {
|
||||
gdbWidget->setGdbMultiarchCommand(command);
|
||||
void SeerMainWindow::setOpenocdGdbCommand (const QString& command) {
|
||||
gdbWidget->setOpenocdGdbCommand(command);
|
||||
}
|
||||
|
||||
// ::Symbol Files
|
||||
|
||||
+17
-17
@@ -77,25 +77,25 @@ class SeerMainWindow : public QMainWindow, protected Ui::SeerMainWindowForm {
|
||||
|
||||
// OpenOCD getter and setter functions
|
||||
// ::Main
|
||||
const QString& openOCDExePath ();
|
||||
void setOpenOCDExePath (const QString& path);
|
||||
const QString& openOCDCommand ();
|
||||
void setOpenOCDCommand (const QString& command);
|
||||
const QString& openocdExe ();
|
||||
void setOpenocdExe (const QString& path);
|
||||
const QString& openocdCommand ();
|
||||
void setOpenocdCommand (const QString& command);
|
||||
// ::GDB Multiarch
|
||||
const QString& gdbMultiarchExePath ();
|
||||
void setGdbMultiarchExePath (const QString& path);
|
||||
const QString& gdbMultiarchPort ();
|
||||
void setGdbMultiarchPort (const QString& port);
|
||||
const QString& gdbMultiarchCommand ();
|
||||
void setGdbMultiarchCommand (const QString& command);
|
||||
const QString& openocdGdbExe ();
|
||||
void setOpenocdGdbExe (const QString& path);
|
||||
const QString& openocdGdbPort ();
|
||||
void setOpenocdGdbPort (const QString& port);
|
||||
const QString& openocdGdbCommand ();
|
||||
void setOpenocdGdbCommand (const QString& command);
|
||||
// ::Symbol Files
|
||||
const QString& symbolFile ();
|
||||
void setSymbolFile (const QString& path);
|
||||
const QString& workingDirectory ();
|
||||
void setWorkingDirectory (const QString& path);
|
||||
bool hasLoadAddress ();
|
||||
const QString& loadAddress ();
|
||||
void setLoadAddress (const QString& address);
|
||||
const QString& symbolFile ();
|
||||
void setSymbolFile (const QString& path);
|
||||
const QString& workingDirectory ();
|
||||
void setWorkingDirectory (const QString& path);
|
||||
bool hasLoadAddress ();
|
||||
const QString& loadAddress ();
|
||||
void setLoadAddress (const QString& address);
|
||||
|
||||
private slots:
|
||||
void handleFileDebugWithDefaultProject ();
|
||||
|
||||
Reference in New Issue
Block a user