Commit 98e37b3b authored by hjk's avatar hjk

debugger: don't remove corefiles that we did not create.

parent a364b935
......@@ -108,6 +108,7 @@ using namespace TextEditor;
DebuggerStartParameters::DebuggerStartParameters()
: attachPID(-1),
useTerminal(false),
isSnapshot(false),
breakAtMain(false),
qmlServerAddress("127.0.0.1"),
qmlServerPort(0),
......
......@@ -68,6 +68,7 @@ public:
QString executable;
QString displayName;
QString coreFile;
bool isSnapshot; // set if created internally
QStringList processArgs;
QStringList environment;
QString workingDirectory;
......
......@@ -3022,6 +3022,7 @@ void GdbEngine::handleMakeSnapshot(const GdbResponse &response)
function = frame.function + _(":") + QString::number(frame.line);
}
sp.displayName = function + _(": ") + QDateTime::currentDateTime().toString();
sp.isSnapshot = true;
DebuggerRunControl *rc = DebuggerPlugin::createDebugger(sp);
DebuggerPlugin::startDebugger(rc);
} else {
......
......@@ -127,9 +127,9 @@ SnapshotHandler::~SnapshotHandler()
{
for (int i = m_snapshots.size(); --i >= 0; ) {
if (DebuggerEngine *engine = engineAt(i)) {
QString fileName = engine->startParameters().coreFile;
if (!fileName.isEmpty())
QFile::remove(fileName);
const DebuggerStartParameters & sp = engine->startParameters();
if (sp.isSnapshot && !sp.coreFile.isEmpty())
QFile::remove(sp.coreFile);
}
}
}
......@@ -270,8 +270,8 @@ void SnapshotHandler::removeSnapshot(int index)
const DebuggerEngine *engine = engineAt(index);
QTC_ASSERT(engine, return);
QString fileName = engine->startParameters().coreFile;
if (!fileName.isEmpty())
QFile::remove(fileName);
//if (!fileName.isEmpty())
// QFile::remove(fileName);
m_snapshots.removeAt(index);
if (index == m_currentIndex)
m_currentIndex = -1;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment