diff --git a/src/data/debuggers/external/cdbrc b/src/data/debuggers/external/cdbrc new file mode 100644 --- /dev/null +++ b/src/data/debuggers/external/cdbrc @@ -0,0 +1,7 @@ +[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 diff --git a/src/data/debuggers/internal/cdbrc b/src/data/debuggers/internal/cdbrc new file mode 100644 --- /dev/null +++ b/src/data/debuggers/internal/cdbrc @@ -0,0 +1,7 @@ +[General] +Name=cdb +TryExec=cdb +Backends=KCrash + +[KCrash] +Exec=cdb.exe -p %pid -lines -c "~*kv; q" \ No newline at end of file diff --git a/src/drkonqibackends.cpp b/src/drkonqibackends.cpp --- a/src/drkonqibackends.cpp +++ b/src/drkonqibackends.cpp @@ -167,7 +167,7 @@ #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; diff --git a/src/parser/CMakeLists.txt b/src/parser/CMakeLists.txt --- a/src/parser/CMakeLists.txt +++ b/src/parser/CMakeLists.txt @@ -4,6 +4,7 @@ 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) diff --git a/src/parser/backtraceparser.cpp b/src/parser/backtraceparser.cpp --- a/src/parser/backtraceparser.cpp +++ b/src/parser/backtraceparser.cpp @@ -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 @@ -34,6 +35,8 @@ 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); } diff --git a/src/parser/backtraceparsercdb.h b/src/parser/backtraceparsercdb.h new file mode 100644 --- /dev/null +++ b/src/parser/backtraceparsercdb.h @@ -0,0 +1,41 @@ +/* + Copyright (C) 2019 Patrick José Pereira + + 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); +}; diff --git a/src/parser/backtraceparsercdb.cpp b/src/parser/backtraceparsercdb.cpp new file mode 100644 --- /dev/null +++ b/src/parser/backtraceparsercdb.cpp @@ -0,0 +1,44 @@ +/* + Copyright (C) 2019 Patrick José Pereira + + 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