Commit 02b042a9 authored by Igor Kushnir's avatar Igor Kushnir Committed by Milian Wolff

Debugger plugin fixes

Rename Qt logging category: common -> debuggercommon

The old name was too generic and undescriptive. This resulted in
the following confusing lines in KDevelop output:
  kdevelop.plugins.common: Change session  QObject(0x0)
  kdevelop.plugins.common: Will reparse arch

MIDebugger: print a specific process error message

Information in the messageboxes is general and sometimes insufficient
to understand why the process could not be started. In such cases
a warning-level error message can be useful. For example:
  Debugger ERRORED QProcess::FailedToStart "execvp: Exec format error"
  Debugger ERRORED QProcess::WriteError "Error writing to process"

GdbDebugger: pass correct string in userCommandOutput()

When Shell script was not empty, both the shell path and the debugger
executable were duplicated in the string sent to userCommandOutput()
because they are prepended to arguments in if(!shell.isEmpty()) branch.

Test Plan:
Run test_gdb, test_gdbprinters, test_lldb and test_lldbformatters.
The number of failed and skipped tests did not change with these fixes.

Reviewers: mwolff

Reviewed By: mwolff

Subscribers: mwolff, kdevelop-devel

Tags: #kdevelop

Differential Revision:
parent e86c5a72
......@@ -41,8 +41,7 @@ declare_qt_logging_category(debuggercommon_SRCS
HEADER debuglog.h
DESCRIPTION "debuggers common"
CATEGORY_BASENAME "debuggercommon"
......@@ -340,7 +340,7 @@ void MIDebugger::processFinished(int exitCode, QProcess::ExitStatus exitStatus)
void MIDebugger::processErrored(QProcess::ProcessError error)
qCDebug(DEBUGGERCOMMON) << "Debugger ERRORED" << error;
qCWarning(DEBUGGERCOMMON) << "Debugger ERRORED" << error << m_process->errorString();
if(error == QProcess::FailedToStart)
......@@ -61,6 +61,8 @@ bool GdbDebugger::start(KConfigGroup& config, const QStringList& extraArguments)
QStringList arguments = extraArguments;
arguments << QStringLiteral("--interpreter=mi2") << QStringLiteral("-quiet");
QString fullCommand;
QUrl shell = config.readEntry(Config::DebuggerShellEntry, QUrl());
if(!shell.isEmpty()) {
qCDebug(DEBUGGERGDB) << "have shell" << shell;
......@@ -85,14 +87,14 @@ bool GdbDebugger::start(KConfigGroup& config, const QStringList& extraArguments)
} else {
m_process->setProgram(m_debuggerExecutable, arguments);
fullCommand = m_debuggerExecutable + QLatin1Char(' ');
fullCommand += arguments.join(QLatin1Char(' '));
qCDebug(DEBUGGERGDB) << "Starting GDB with command" << shell.toLocalFile() + QLatin1Char(' ') + m_debuggerExecutable
+ QLatin1Char(' ') + arguments.join(QLatin1Char(' '));
qCDebug(DEBUGGERGDB) << "Starting GDB with command" << fullCommand;
qCDebug(DEBUGGERGDB) << "GDB process pid:" << m_process->pid();
emit userCommandOutput(shell.toLocalFile() + QLatin1Char(' ') + m_debuggerExecutable
+ QLatin1Char(' ') + arguments.join(QLatin1Char(' ')) + QLatin1Char('\n'));
emit userCommandOutput(fullCommand + QLatin1Char('\n'));
return true;
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