Merge branch '2.6'

Conflicts:
	src/libs/utils/consoleprocess_unix.cpp

Change-Id: I196f61e882bfce94e165d9c724bffee9df1011b7
This commit is contained in:
Oswald Buddenhagen
2012-08-30 20:43:02 +02:00
77 changed files with 916 additions and 1088 deletions

View File

@@ -259,7 +259,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters)
m_stackNeeded = false;
m_preparedForQmlBreak = false;
m_disassembleUsesComma = false;
m_actingOnExpectedStop = false;
m_terminalTrap = startParameters.useTerminal;
m_fullStartDone = false;
m_forceAsyncModel = false;
@@ -467,9 +467,10 @@ void GdbEngine::handleResponse(const QByteArray &buff)
m_pendingLogStreamOutput.clear();
m_pendingConsoleStreamOutput.clear();
} else if (asyncClass == "running") {
if (state() == InferiorRunOk) {
// We get multiple *running after thread creation.
showMessage(_("NOTE: INFERIOR STILL RUNNING."));
if (state() == InferiorRunOk || state() == InferiorSetupRequested) {
// We get multiple *running after thread creation and in Windows terminals.
showMessage(QString::fromLatin1("NOTE: INFERIOR STILL RUNNING IN STATE %1.").
arg(QLatin1String(DebuggerEngine::stateName(state()))));
} else {
notifyInferiorRunOk();
}
@@ -1376,9 +1377,15 @@ void GdbEngine::handleAqcuiredInferior()
void GdbEngine::handleStopResponse(const GdbMi &data)
{
// Ignore trap on Windows terminals, which results in
// spurious "* stopped" message.
if (!data.isValid() && m_terminalTrap && Abi::hostAbi().os() == Abi::WindowsOS) {
m_terminalTrap = false;
showMessage(_("IGNORING TERMINAL SIGTRAP"), LogMisc);
return;
}
// This is gdb 7+'s initial *stopped in response to attach.
// For consistency, we just discard it.
m_actingOnExpectedStop = false;
if (state() == InferiorSetupRequested)
return;
@@ -1421,11 +1428,19 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
BreakpointResponseId rid(data.findChild("bkptno").data());
const GdbMi frame = data.findChild("frame");
const int lineNumber = frame.findChild("line").data().toInt();
QString fullName = cleanupFullName(QString::fromLocal8Bit(frame.findChild("fullname").data()));
if (fullName.isEmpty())
fullName = QString::fromLocal8Bit(frame.findChild("file").data());
int lineNumber = 0;
QString fullName;
if (frame.isValid()) {
const GdbMi lineNumberG = frame.findChild("line");
if (lineNumberG.isValid()) {
lineNumber = lineNumberG.data().toInt();
fullName = cleanupFullName(QString::fromLocal8Bit(frame.findChild("fullname").data()));
if (fullName.isEmpty())
fullName = QString::fromLocal8Bit(frame.findChild("file").data());
} // found line number
} else {
showMessage(_("INVALID STOPPED REASON"), LogWarning);
}
if (rid.isValid() && frame.isValid()
&& !isQmlStepBreakpoint(rid)
@@ -1456,7 +1471,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (!m_commandsToRunOnTemporaryBreak.isEmpty()) {
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state());
m_actingOnExpectedStop = true;
notifyInferiorStopOk();
flushQueuedCommands();
if (state() == InferiorStopOk) {
@@ -1489,7 +1503,6 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
// That's expected.
} else {
QTC_ASSERT(state() == InferiorStopRequested, qDebug() << state());
m_actingOnExpectedStop = true;
notifyInferiorStopOk();
}
@@ -1656,12 +1669,6 @@ void GdbEngine::handleStop2(const GdbMi &data)
&& reason == "signal-received"
&& data.findChild("signal-name").data() == "SIGTRAP")
{
if (!m_actingOnExpectedStop) {
// Ignore signals from command line start up traps.
showMessage(_("INTERNAL CONTINUE AFTER SIGTRAP"), LogMisc);
continueInferiorInternal();
return;
}
// This is the stopper thread. That also means that the
// reported thread is not the one we'd like to expose
// to the user.
@@ -3771,9 +3778,23 @@ void GdbEngine::handleRegisterListNames(const GdbResponse &response)
}
Registers registers;
foreach (const GdbMi &item, response.data.findChild("register-names").children())
if (!item.data().isEmpty())
int gdbRegisterNumber = 0, internalIndex = 0;
// This both handles explicitly having space for all the registers and
// initializes all indices to 0, giving missing registers a sane default
// in the event of something wacky.
GdbMi names = response.data.findChild("register-names");
m_registerNumbers.resize(names.childCount());
foreach (const GdbMi &item, names.children()) {
// Since we throw away missing registers to eliminate empty rows
// we need to maintain a mapping of GDB register numbers to their
// respective indices in the register list.
if (!item.data().isEmpty()) {
m_registerNumbers[gdbRegisterNumber] = internalIndex++;
registers.append(Register(item.data()));
}
gdbRegisterNumber++;
}
registerHandler()->setRegisters(registers);
}
@@ -3785,14 +3806,15 @@ void GdbEngine::handleRegisterListValues(const GdbResponse &response)
Registers registers = registerHandler()->registers();
const int registerCount = registers.size();
const int gdbRegisterCount = m_registerNumbers.size();
// 24^done,register-values=[{number="0",value="0xf423f"},...]
const GdbMi values = response.data.findChild("register-values");
QTC_ASSERT(registerCount == values.children().size(), return);
foreach (const GdbMi &item, values.children()) {
const int number = item.findChild("number").data().toInt();
if (number >= 0 && number < registerCount)
registers[number].value = item.findChild("value").data();
if (number >= 0 && number < gdbRegisterCount)
registers[m_registerNumbers[number]].value = item.findChild("value").data();
}
registerHandler()->setAndMarkRegisters(registers);
}
@@ -5217,7 +5239,9 @@ bool GdbEngine::attemptQuickStart() const
void GdbEngine::checkForReleaseBuild()
{
QString binary = startParameters().executable;
const QString binary = startParameters().executable;
if (binary.isEmpty())
return;
ElfReader reader(binary);
ElfData elfData = reader.readHeaders();
QString error = reader.errorString();