Commit a32ec5e2 authored by patrick pereira's avatar patrick pereira 🏃

cdb: First working version

Summary:
This patch introduces support to CDB, providing useful backtraces in bug tickets created through DrKonqi on windows.
CDB is normally used on windows to debug MSVC applications, this also will help us to create smaller deployment packages since everything will be MSVC compatible.

This is also based on lldb support.
Signed-off-by: patrick pereira's avatarPatrick José Pereira <patrickelectric@gmail.com>

Reviewers: davidedmundson, tcanabrava, ngraham

Reviewed By: tcanabrava

Subscribers: ngraham, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D18859
parent 7c8c5a87
[General]
Name=cdb
TryExec=cdb
Backends=KCrash
[KCrash]
Exec=konsole --nofork -e cdb.exe -p %pid -lines -c "~*kv; q"
\ No newline at end of file
[General]
Name=cdb
TryExec=cdb
Backends=KCrash
[KCrash]
Exec=cdb.exe -p %pid -lines -c "~*kv; q"
\ No newline at end of file
......@@ -167,7 +167,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager()
#elif !defined(Q_OS_WIN)
QString defaultDebuggerName = config.readEntry("Debugger", QStringLiteral("gdb"));
#else
QString defaultDebuggerName = config.readEntry("Debugger", QStringLiteral("kdbgwin"));
QString defaultDebuggerName = config.readEntry("Debugger", QStringLiteral("cdb"));
#endif
Debugger firstKnownGoodDebugger, preferredDebugger;
......
......@@ -4,6 +4,7 @@ set(BACKTRACEPARSER_SRCS
backtraceparserkdbgwin.cpp
backtraceparsernull.cpp
backtraceparserlldb.cpp
backtraceparsercdb.cpp
)
ecm_qt_declare_logging_category(BACKTRACEPARSER_SRCS HEADER drkonqi_parser_debug.h IDENTIFIER DRKONQI_PARSER_LOG CATEGORY_NAME org.kde.drkonqi.parser)
......
......@@ -19,6 +19,7 @@
#include "backtraceparsergdb.h"
#include "backtraceparserkdbgwin.h"
#include "backtraceparserlldb.h"
#include "backtraceparsercdb.h"
#include "backtraceparsernull.h"
#include "drkonqi_parser_debug.h"
#include <QRegExp>
......@@ -34,6 +35,8 @@ BacktraceParser *BacktraceParser::newParser(const QString & debuggerName, QObjec
return new BacktraceParserKdbgwin(parent);
} else if (debuggerName == QLatin1String("lldb")) {
return new BacktraceParserLldb(parent);
} else if (debuggerName == QLatin1String("cdb")) {
return new BacktraceParserCdb(parent);
} else {
return new BacktraceParserNull(parent);
}
......
/*
Copyright (C) 2019 Patrick José Pereira <patrickelectric@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#include "backtraceparsercdb.h"
#include "backtraceparser_p.h"
BacktraceParserCdb::BacktraceParserCdb(QObject *parent)
: BacktraceParser(parent)
{
}
BacktraceParserPrivate *BacktraceParserCdb::constructPrivate() const
{
BacktraceParserPrivate *d = BacktraceParser::constructPrivate();
d->m_usefulness = MayBeUseful;
return d;
}
void BacktraceParserCdb::newLine(const QString &lineStr)
{
d_ptr->m_linesList.append(BacktraceLineCdb(lineStr));
}
BacktraceLineCdb::BacktraceLineCdb(const QString &line)
: BacktraceLine()
{
d->m_line = line;
// We should do the faith jump to believe that cdb will provides useful information
d->m_rating = Good;
}
\ No newline at end of file
/*
Copyright (C) 2019 Patrick José Pereira <patrickelectric@gmail.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#pragma once
#include "backtraceparser.h"
class BacktraceParserCdb : public BacktraceParser
{
Q_OBJECT
Q_DECLARE_PRIVATE(BacktraceParser)
public:
explicit BacktraceParserCdb(QObject *parent = nullptr);
protected Q_SLOTS:
void newLine(const QString &lineStr) override;
protected:
BacktraceParserPrivate *constructPrivate() const override;
};
class BacktraceLineCdb : public BacktraceLine
{
public:
BacktraceLineCdb(const QString & line);
};
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