forked from qt-creator/qt-creator
Debugger: Use a FilePathAspect for extra dumpers
Change-Id: Ideb779cc5ef0d679667b635efe8c1a2859c6e608 Reviewed-by: David Schulz <david.schulz@qt.io>
This commit is contained in:
@@ -2824,10 +2824,10 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
|
||||
runCommand({"theDumper = Dumper()", ScriptCommand});
|
||||
}
|
||||
|
||||
const QString path = debuggerSettings()->extraDumperFile.value();
|
||||
if (!path.isEmpty() && QFileInfo(path).isReadable()) {
|
||||
const FilePath path = debuggerSettings()->extraDumperFile();
|
||||
if (!path.isEmpty() && path.isReadableFile()) {
|
||||
DebuggerCommand cmd("theDumper.addDumperModule", ScriptCommand);
|
||||
cmd.arg("path", path);
|
||||
cmd.arg("path", path.path());
|
||||
runCommand(cmd);
|
||||
}
|
||||
const QString commands = debuggerSettings()->extraDumperCommands.value();
|
||||
|
||||
@@ -364,7 +364,6 @@ DebuggerSettings::DebuggerSettings()
|
||||
+ "</p></body></html>");
|
||||
|
||||
extraDumperFile.setSettingsKey(debugModeGroup, "ExtraDumperFile");
|
||||
extraDumperFile.setDisplayStyle(StringAspect::PathChooserDisplay);
|
||||
extraDumperFile.setDisplayName(Tr::tr("Extra Debugging Helpers"));
|
||||
// Label text is intentional empty in the GUI.
|
||||
extraDumperFile.setToolTip(Tr::tr("Path to a Python file containing additional data dumpers."));
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
Utils::BoolAspect useDebuggingHelpers;
|
||||
Utils::BoolAspect useCodeModel;
|
||||
Utils::BoolAspect showThreadNames;
|
||||
Utils::StringAspect extraDumperFile; // For loading a file. Recommended.
|
||||
Utils::FilePathAspect extraDumperFile; // For loading a file. Recommended.
|
||||
Utils::StringAspect extraDumperCommands; // To modify an existing setup.
|
||||
|
||||
Utils::BoolAspect showStdNamespace;
|
||||
|
||||
@@ -4026,10 +4026,10 @@ void GdbEngine::handleGdbStarted()
|
||||
runCommand({"python from gdbbridge import *"});
|
||||
}
|
||||
|
||||
const QString path = debuggerSettings()->extraDumperFile.value();
|
||||
if (!path.isEmpty() && QFileInfo(path).isReadable()) {
|
||||
const FilePath path = debuggerSettings()->extraDumperFile();
|
||||
if (!path.isEmpty() && path.isReadableFile()) {
|
||||
DebuggerCommand cmd("addDumperModule");
|
||||
cmd.arg("path", path);
|
||||
cmd.arg("path", path.path());
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
|
||||
@@ -228,10 +228,10 @@ void LldbEngine::handleLldbStarted()
|
||||
if (!commands.isEmpty())
|
||||
executeCommand(commands);
|
||||
|
||||
const QString path = debuggerSettings()->extraDumperFile.value();
|
||||
if (!path.isEmpty() && QFileInfo(path).isReadable()) {
|
||||
const FilePath path = debuggerSettings()->extraDumperFile();
|
||||
if (!path.isEmpty() && path.isReadableFile()) {
|
||||
DebuggerCommand cmd("addDumperModule");
|
||||
cmd.arg("path", path);
|
||||
cmd.arg("path", path.path());
|
||||
runCommand(cmd);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user