forked from qt-creator/qt-creator
Cdb: Remove the symbol path dialog popup.
When setting up a symbol server path, the debugger startup could increase to an unacceptable amount of time. So this is an attempt to hide this feature for the standard user, but still keep it accessible for everyone else. Change-Id: I719f3091fe483f446488c75001e29278e1b405ea Reviewed-by: Christian Stenger <christian.stenger@theqtcompany.com>
This commit is contained in:
@@ -547,10 +547,6 @@ void CdbEngine::setupEngine()
|
||||
{
|
||||
if (debug)
|
||||
qDebug(">setupEngine");
|
||||
// Nag to add symbol server and cache
|
||||
QStringList symbolPaths = stringListSetting(CdbSymbolPaths);
|
||||
if (CdbSymbolPathListEditor::promptToAddSymbolPaths(&symbolPaths))
|
||||
action(CdbSymbolPaths)->setValue(symbolPaths);
|
||||
|
||||
init();
|
||||
if (!m_logTime.elapsed())
|
||||
|
||||
@@ -134,6 +134,11 @@ CdbSymbolPathListEditor::CdbSymbolPathListEditor(QWidget *parent) :
|
||||
addSymbolPath(SymbolCachePath);
|
||||
});
|
||||
button->setToolTip(tr("Uses a directory to cache symbols used by the debugger."));
|
||||
|
||||
button = insertButton(lastInsertButtonIndex + 1, tr("Setup Symbol Paths..."), this, [this](){
|
||||
setupSymbolPaths();
|
||||
});
|
||||
button->setToolTip(tr("Configure Symbol paths that are used to locate debug symbol files."));
|
||||
}
|
||||
|
||||
bool CdbSymbolPathListEditor::promptCacheDirectory(QWidget *parent, QString *cacheDirectory)
|
||||
@@ -153,6 +158,37 @@ void CdbSymbolPathListEditor::addSymbolPath(CdbSymbolPathListEditor::SymbolPathM
|
||||
insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(cacheDir, mode));
|
||||
}
|
||||
|
||||
void CdbSymbolPathListEditor::setupSymbolPaths()
|
||||
{
|
||||
const QStringList ¤tPaths = pathList();
|
||||
const int indexOfSymbolServer = indexOfSymbolPath(currentPaths, SymbolServerPath);
|
||||
const int indexOfSymbolCache = indexOfSymbolPath(currentPaths, SymbolCachePath);
|
||||
|
||||
QString path;
|
||||
if (indexOfSymbolServer != -1)
|
||||
path = currentPaths.at(indexOfSymbolServer);
|
||||
if (path.isEmpty() && indexOfSymbolCache != -1)
|
||||
path = currentPaths.at(indexOfSymbolCache);
|
||||
if (path.isEmpty())
|
||||
path = QDir::tempPath() + QDir::separator() + QLatin1String("symbolcache");
|
||||
|
||||
bool useSymbolServer = true;
|
||||
bool useSymbolCache = true;
|
||||
bool addSymbolPaths = SymbolPathsDialog::useCommonSymbolPaths(useSymbolCache,
|
||||
useSymbolServer,
|
||||
path);
|
||||
if (!addSymbolPaths)
|
||||
return;
|
||||
|
||||
if (useSymbolCache) {
|
||||
insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(path, SymbolCachePath));
|
||||
if (useSymbolServer)
|
||||
insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(QString(), SymbolServerPath));
|
||||
} else if (useSymbolServer) {
|
||||
insertPathAtCursor(CdbSymbolPathListEditor::symbolPath(path, SymbolServerPath));
|
||||
}
|
||||
}
|
||||
|
||||
QString CdbSymbolPathListEditor::symbolPath(const QString &cacheDir,
|
||||
CdbSymbolPathListEditor::SymbolPathMode mode)
|
||||
{
|
||||
@@ -207,61 +243,5 @@ int CdbSymbolPathListEditor::indexOfSymbolPath(const QStringList &paths,
|
||||
return -1;
|
||||
}
|
||||
|
||||
bool CdbSymbolPathListEditor::promptToAddSymbolPaths(QStringList *symbolPaths)
|
||||
{
|
||||
const int indexOfSymbolServer =
|
||||
CdbSymbolPathListEditor::indexOfSymbolPath(*symbolPaths, SymbolServerPath);
|
||||
const int indexOfSymbolCache =
|
||||
CdbSymbolPathListEditor::indexOfSymbolPath(*symbolPaths, SymbolCachePath);
|
||||
|
||||
if (!qgetenv("_NT_SYMBOL_PATH").isEmpty()
|
||||
|| (indexOfSymbolServer != -1 && indexOfSymbolCache != -1))
|
||||
return false;
|
||||
|
||||
const QString nagSymbolServerKey = QLatin1String("CDB2/NoPromptSymbolCache");
|
||||
bool noFurtherNagging = Core::ICore::settings()->value(nagSymbolServerKey, false).toBool();
|
||||
if (noFurtherNagging)
|
||||
return false;
|
||||
|
||||
QString path;
|
||||
if (indexOfSymbolServer != -1)
|
||||
path = symbolPaths->at(indexOfSymbolServer);
|
||||
if (path.isEmpty() && indexOfSymbolCache != -1)
|
||||
path = symbolPaths->at(indexOfSymbolCache);
|
||||
if (path.isEmpty())
|
||||
path = QDir::tempPath() + QDir::separator() + QLatin1String("symbolcache");
|
||||
|
||||
bool useSymbolServer = true;
|
||||
bool useSymbolCache = true;
|
||||
bool addSymbolPaths = SymbolPathsDialog::useCommonSymbolPaths(useSymbolCache,
|
||||
useSymbolServer,
|
||||
path, noFurtherNagging);
|
||||
Core::ICore::settings()->setValue(nagSymbolServerKey, noFurtherNagging);
|
||||
if (!addSymbolPaths)
|
||||
return false;
|
||||
|
||||
// remove old entries
|
||||
if (indexOfSymbolServer > indexOfSymbolCache) {
|
||||
symbolPaths->removeAt(indexOfSymbolServer);
|
||||
if (indexOfSymbolCache != -1)
|
||||
symbolPaths->removeAt(indexOfSymbolCache);
|
||||
} else if (indexOfSymbolCache > indexOfSymbolServer) {
|
||||
symbolPaths->removeAt(indexOfSymbolCache);
|
||||
if (indexOfSymbolServer != -1)
|
||||
symbolPaths->removeAt(indexOfSymbolServer);
|
||||
}
|
||||
|
||||
if (useSymbolCache) {
|
||||
symbolPaths->push_back(CdbSymbolPathListEditor::symbolPath(path, SymbolCachePath));
|
||||
if (useSymbolServer)
|
||||
symbolPaths->push_back(CdbSymbolPathListEditor::symbolPath(QString(), SymbolServerPath));
|
||||
return true;
|
||||
} else if (useSymbolServer) {
|
||||
symbolPaths->push_back(CdbSymbolPathListEditor::symbolPath(path, SymbolServerPath));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Debugger
|
||||
|
||||
@@ -93,11 +93,9 @@ public:
|
||||
// Check for symbol server in list of paths.
|
||||
static int indexOfSymbolPath(const QStringList &paths, SymbolPathMode mode, QString *cacheDir = 0);
|
||||
|
||||
// Nag user to add a symbol cache and server to the path list on debugger startup.
|
||||
static bool promptToAddSymbolPaths(QStringList *symbolPaths);
|
||||
|
||||
private:
|
||||
void addSymbolPath(SymbolPathMode mode);
|
||||
void setupSymbolPaths();
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -64,11 +64,6 @@ QString SymbolPathsDialog::path() const
|
||||
return ui->pathChooser->path();
|
||||
}
|
||||
|
||||
bool SymbolPathsDialog::doNotAskAgain() const
|
||||
{
|
||||
return ui->doNotAskAgain->isChecked();
|
||||
}
|
||||
|
||||
void SymbolPathsDialog::setUseSymbolCache(bool useSymbolCache)
|
||||
{
|
||||
ui->useLocalSymbolCache->setChecked(useSymbolCache);
|
||||
@@ -84,23 +79,16 @@ void SymbolPathsDialog::setPath(const QString &path)
|
||||
ui->pathChooser->setPath(path);
|
||||
}
|
||||
|
||||
void SymbolPathsDialog::setDoNotAskAgain(bool doNotAskAgain) const
|
||||
{
|
||||
ui->doNotAskAgain->setChecked(doNotAskAgain);
|
||||
}
|
||||
|
||||
bool SymbolPathsDialog::useCommonSymbolPaths(bool &useSymbolCache, bool &useSymbolServer,
|
||||
QString &path, bool &doNotAskAgain)
|
||||
QString &path)
|
||||
{
|
||||
SymbolPathsDialog dialog;
|
||||
dialog.setUseSymbolCache(useSymbolCache);
|
||||
dialog.setUseSymbolServer(useSymbolServer);
|
||||
dialog.setPath(path);
|
||||
dialog.setDoNotAskAgain(doNotAskAgain);
|
||||
int ret = dialog.exec();
|
||||
useSymbolCache = dialog.useSymbolCache();
|
||||
useSymbolServer = dialog.useSymbolServer();
|
||||
path = dialog.path();
|
||||
doNotAskAgain = dialog.doNotAskAgain();
|
||||
return ret == QDialog::Accepted;
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ public:
|
||||
void setPath(const QString &path);
|
||||
void setDoNotAskAgain(bool doNotAskAgain) const;
|
||||
|
||||
static bool useCommonSymbolPaths(bool &useSymbolCache, bool &useSymbolServer, QString &path, bool &doNotAskAgain);
|
||||
static bool useCommonSymbolPaths(bool &useSymbolCache, bool &useSymbolServer, QString &path);
|
||||
|
||||
private:
|
||||
Ui::SymbolPathsDialog *ui;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>537</width>
|
||||
<height>245</height>
|
||||
<height>249</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -73,23 +73,6 @@
|
||||
<item>
|
||||
<widget class="Utils::PathChooser" name="pathChooser" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="doNotAskAgain">
|
||||
<property name="text">
|
||||
<string>Do not ask again</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDialogButtonBox" name="buttonBox">
|
||||
<property name="orientation">
|
||||
|
||||
Reference in New Issue
Block a user