forked from qt-creator/qt-creator
Valgrind: Add heob path to settings
Change-Id: If2fa8c913b20bd30016673d2cf712fb9b85ad9d6 Reviewed-by: André Hartmann <aha_1980@gmx.de> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -74,6 +74,7 @@
|
|||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
|
|
||||||
#include <utils/fancymainwindow.h>
|
#include <utils/fancymainwindow.h>
|
||||||
|
#include <utils/pathchooser.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/utilsicons.h>
|
#include <utils/utilsicons.h>
|
||||||
|
|
||||||
@@ -476,6 +477,7 @@ public:
|
|||||||
QString arguments() const;
|
QString arguments() const;
|
||||||
QString xmlName() const;
|
QString xmlName() const;
|
||||||
bool attach() const;
|
bool attach() const;
|
||||||
|
QString path() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateEnabled();
|
void updateEnabled();
|
||||||
@@ -492,6 +494,7 @@ private:
|
|||||||
QComboBox *m_leakRecordingCombo = nullptr;
|
QComboBox *m_leakRecordingCombo = nullptr;
|
||||||
QCheckBox *m_attachCheck = nullptr;
|
QCheckBox *m_attachCheck = nullptr;
|
||||||
QLineEdit *m_extraArgsEdit = nullptr;
|
QLineEdit *m_extraArgsEdit = nullptr;
|
||||||
|
PathChooser *m_pathChooser = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
class HeobData : public QObject
|
class HeobData : public QObject
|
||||||
@@ -774,16 +777,6 @@ void MemcheckTool::heobAction()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// heob executable
|
|
||||||
const QString heob = QString("heob%1.exe").arg(abi.wordWidth());
|
|
||||||
const QString heobPath = QStandardPaths::findExecutable(heob);
|
|
||||||
if (heobPath.isEmpty()) {
|
|
||||||
const QString msg = tr("heob: Can't find %1").arg(heob);
|
|
||||||
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
|
|
||||||
TaskHub::requestPopup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// make executable a relative path if possible
|
// make executable a relative path if possible
|
||||||
const QString wdSlashed = workingDirectory + '/';
|
const QString wdSlashed = workingDirectory + '/';
|
||||||
if (executable.startsWith(wdSlashed, Qt::CaseInsensitive))
|
if (executable.startsWith(wdSlashed, Qt::CaseInsensitive))
|
||||||
@@ -795,6 +788,16 @@ void MemcheckTool::heobAction()
|
|||||||
return;
|
return;
|
||||||
const QString heobArguments = dialog.arguments();
|
const QString heobArguments = dialog.arguments();
|
||||||
|
|
||||||
|
// heob executable
|
||||||
|
const QString heob = QString("heob%1.exe").arg(abi.wordWidth());
|
||||||
|
const QString heobPath = dialog.path() + '/' + heob;
|
||||||
|
if (!QFile::exists(heobPath)) {
|
||||||
|
const QString msg = tr("heob: Can't find %1").arg(heob);
|
||||||
|
TaskHub::addTask(Task::Error, msg, Debugger::Constants::ANALYZERTASK_ID);
|
||||||
|
TaskHub::requestPopup();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// output xml file
|
// output xml file
|
||||||
QDir wdDir(workingDirectory);
|
QDir wdDir(workingDirectory);
|
||||||
const QString xmlPath = wdDir.absoluteFilePath(dialog.xmlName());
|
const QString xmlPath = wdDir.absoluteFilePath(dialog.xmlName());
|
||||||
@@ -1143,6 +1146,7 @@ const char heobLeakSizeC[] = "heob/LeakSize";
|
|||||||
const char heobLeakRecordingC[] = "heob/LeakRecording";
|
const char heobLeakRecordingC[] = "heob/LeakRecording";
|
||||||
const char heobAttachC[] = "heob/Attach";
|
const char heobAttachC[] = "heob/Attach";
|
||||||
const char heobExtraArgsC[] = "heob/ExtraArgs";
|
const char heobExtraArgsC[] = "heob/ExtraArgs";
|
||||||
|
const char heobPathC[] = "heob/Path";
|
||||||
|
|
||||||
static QString upperHexNum(unsigned num)
|
static QString upperHexNum(unsigned num)
|
||||||
{
|
{
|
||||||
@@ -1164,6 +1168,13 @@ HeobDialog::HeobDialog(QWidget *parent) :
|
|||||||
bool attach = settings->value(heobAttachC, false).toBool();
|
bool attach = settings->value(heobAttachC, false).toBool();
|
||||||
const QString extraArgs = settings->value(heobExtraArgsC).toString();
|
const QString extraArgs = settings->value(heobExtraArgsC).toString();
|
||||||
|
|
||||||
|
QString path = settings->value(heobPathC).toString();
|
||||||
|
if (path.isEmpty()) {
|
||||||
|
const QString heobPath = QStandardPaths::findExecutable("heob32.exe");
|
||||||
|
if (!heobPath.isEmpty())
|
||||||
|
path = QFileInfo(heobPath).path();
|
||||||
|
}
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout;
|
QVBoxLayout *layout = new QVBoxLayout;
|
||||||
// disable resizing
|
// disable resizing
|
||||||
layout->setSizeConstraint(QLayout::SetFixedSize);
|
layout->setSizeConstraint(QLayout::SetFixedSize);
|
||||||
@@ -1260,6 +1271,15 @@ HeobDialog::HeobDialog(QWidget *parent) :
|
|||||||
extraArgsLayout->addWidget(m_extraArgsEdit);
|
extraArgsLayout->addWidget(m_extraArgsEdit);
|
||||||
layout->addLayout(extraArgsLayout);
|
layout->addLayout(extraArgsLayout);
|
||||||
|
|
||||||
|
QHBoxLayout *pathLayout = new QHBoxLayout;
|
||||||
|
QLabel *pathLabel = new QLabel(tr("heob path:"));
|
||||||
|
pathLabel->setToolTip(tr("The location of heob32.exe and heob64.exe."));
|
||||||
|
pathLayout->addWidget(pathLabel);
|
||||||
|
m_pathChooser = new PathChooser;
|
||||||
|
m_pathChooser->setPath(path);
|
||||||
|
pathLayout->addWidget(m_pathChooser);
|
||||||
|
layout->addLayout(pathLayout);
|
||||||
|
|
||||||
QHBoxLayout *saveLayout = new QHBoxLayout;
|
QHBoxLayout *saveLayout = new QHBoxLayout;
|
||||||
saveLayout->addStretch(1);
|
saveLayout->addStretch(1);
|
||||||
QToolButton *saveButton = new QToolButton;
|
QToolButton *saveButton = new QToolButton;
|
||||||
@@ -1272,6 +1292,7 @@ HeobDialog::HeobDialog(QWidget *parent) :
|
|||||||
QHBoxLayout *okLayout = new QHBoxLayout;
|
QHBoxLayout *okLayout = new QHBoxLayout;
|
||||||
okLayout->addStretch(1);
|
okLayout->addStretch(1);
|
||||||
QPushButton *okButton = new QPushButton(tr("OK"));
|
QPushButton *okButton = new QPushButton(tr("OK"));
|
||||||
|
okButton->setDefault(true);
|
||||||
connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept);
|
connect(okButton, &QAbstractButton::clicked, this, &QDialog::accept);
|
||||||
okLayout->addWidget(okButton);
|
okLayout->addWidget(okButton);
|
||||||
okLayout->addStretch(1);
|
okLayout->addStretch(1);
|
||||||
@@ -1335,6 +1356,11 @@ bool HeobDialog::attach() const
|
|||||||
return m_attachCheck->isChecked();
|
return m_attachCheck->isChecked();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString HeobDialog::path() const
|
||||||
|
{
|
||||||
|
return m_pathChooser->path();
|
||||||
|
}
|
||||||
|
|
||||||
void HeobDialog::updateEnabled()
|
void HeobDialog::updateEnabled()
|
||||||
{
|
{
|
||||||
bool enableHeob = m_handleExceptionCombo->currentIndex() < 2;
|
bool enableHeob = m_handleExceptionCombo->currentIndex() < 2;
|
||||||
@@ -1364,6 +1390,7 @@ void HeobDialog::saveOptions()
|
|||||||
settings->setValue(heobLeakRecordingC, m_leakRecordingCombo->currentIndex());
|
settings->setValue(heobLeakRecordingC, m_leakRecordingCombo->currentIndex());
|
||||||
settings->setValue(heobAttachC, m_attachCheck->isChecked());
|
settings->setValue(heobAttachC, m_attachCheck->isChecked());
|
||||||
settings->setValue(heobExtraArgsC, m_extraArgsEdit->text());
|
settings->setValue(heobExtraArgsC, m_extraArgsEdit->text());
|
||||||
|
settings->setValue(heobPathC, m_pathChooser->path());
|
||||||
}
|
}
|
||||||
|
|
||||||
HeobData::HeobData(MemcheckTool *mcTool, const QString &xmlPath, Kit *kit, bool attach)
|
HeobData::HeobData(MemcheckTool *mcTool, const QString &xmlPath, Kit *kit, bool attach)
|
||||||
|
Reference in New Issue
Block a user