Commit cd63a2ad authored by David Edmundson's avatar David Edmundson

Remove drkonqi from p-w

It's now in its own repo
parent 9c27d52f
......@@ -163,7 +163,6 @@ add_subdirectory(kuiserver)
add_subdirectory(menu)
add_subdirectory(phonon)
add_subdirectory(solidautoeject)
add_subdirectory(drkonqi)
ecm_optional_add_subdirectory(xembed-sni-proxy)
......
kate: replace-tabs on; indent-width 4;
\ No newline at end of file
Hans Petter Bieker <bieker@kde.org>
Dario Andres Rodriguez <andresbajotierra@gmail.com>
George Kiagiadakis <gkiagia@users.sourceforge.net>
A. L. Spehr <spehr@kde.org>
Lee Olson <leetolson@gmail.com>
\ No newline at end of file
include (CheckFunctionExists)
check_function_exists("strsignal" HAVE_STRSIGNAL)
check_function_exists("uname" HAVE_UNAME)
if (NOT DEBUG_PACKAGE_INSTALLER_NAME)
set (DEBUG_PACKAGE_INSTALLER_NAME "installdbgsymbols.sh")
endif ()
configure_file (config-drkonqi.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-drkonqi.h )
if (HAVE_X11)
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS X11Extras)
endif()
add_definitions(-DKDE_DEFAULT_DEBUG_AREA=1410)
add_subdirectory( data )
add_subdirectory( parser )
if ( WIN32 )
add_subdirectory( kdbgwin )
endif ()
set(drkonqi_SRCS
main.cpp
drkonqidialog.cpp
statuswidget.cpp
aboutbugreportingdialog.cpp
backtraceratingwidget.cpp
backtracewidget.cpp
backtracegenerator.cpp
drkonqi.cpp
drkonqibackends.cpp
detachedprocessmonitor.cpp
debugpackageinstaller.cpp
systeminformation.cpp
crashedapplication.cpp
debugger.cpp
debuggerlaunchers.cpp
debuggermanager.cpp
applicationdetailsexamples.cpp
gdbhighlighter.cpp
statusnotifier.cpp
)
ki18n_wrap_ui(drkonqi_SRCS
ui/maindialog.ui
ui/backtracewidget.ui
)
# if BACKTRACE_PARSER_DEBUG is enabled, it will show both the
# parsed and the unparsed backtrace in the backtrace widget.
# Comment this out for release.
#add_definitions(-DBACKTRACE_PARSER_DEBUG)
set(drkonqi_SRCS
${drkonqi_SRCS}
bugzillaintegration/bugzillalib.cpp
bugzillaintegration/reportassistantdialog.cpp
bugzillaintegration/reportassistantpage.cpp
bugzillaintegration/reportassistantpages_base.cpp
bugzillaintegration/reportassistantpages_bugzilla.cpp
bugzillaintegration/reportassistantpages_bugzilla_duplicates.cpp
bugzillaintegration/reportinterface.cpp
bugzillaintegration/productmapping.cpp
bugzillaintegration/parsebugbacktraces.cpp # Requires kxmlrpcclient
bugzillaintegration/duplicatefinderjob.cpp
)
ki18n_wrap_ui(drkonqi_SRCS
bugzillaintegration/ui/assistantpage_introduction.ui
bugzillaintegration/ui/assistantpage_bugawareness.ui
bugzillaintegration/ui/assistantpage_conclusions.ui
bugzillaintegration/ui/assistantpage_conclusions_dialog.ui
bugzillaintegration/ui/assistantpage_bugzilla_login.ui
bugzillaintegration/ui/assistantpage_bugzilla_duplicates.ui
bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog.ui
bugzillaintegration/ui/assistantpage_bugzilla_duplicates_dialog_confirmation.ui
bugzillaintegration/ui/assistantpage_bugzilla_information.ui
bugzillaintegration/ui/assistantpage_bugzilla_preview.ui
bugzillaintegration/ui/assistantpage_bugzilla_send.ui
)
add_executable(drkonqi ${drkonqi_SRCS})
ecm_mark_nongui_executable(drkonqi)
target_compile_definitions(drkonqi PRIVATE -DPROJECT_VERSION="${PROJECT_VERSION}")
target_link_libraries(drkonqi
KF5::I18n
KF5::CoreAddons
KF5::Service
KF5::ConfigWidgets
KF5::JobWidgets
KF5::KIOCore
KF5::Crash
KF5::Completion
Qt5::DBus
KF5::XmlRpcClient
KF5::WidgetsAddons
KF5::Wallet
KF5::Notifications # for status notifier
KF5::IdleTime # hide status notifier only if user saw it
drkonqi_backtrace_parser
)
if (HAVE_X11)
target_link_libraries(drkonqi
Qt5::X11Extras
)
endif()
install(TARGETS drkonqi DESTINATION ${KDE_INSTALL_LIBEXECDIR})
# Only go into tests once we have a drkonqi target so the tests can reference
# it.
add_subdirectory( tests )
#! /bin/sh
#This file has output in separate line each file with a .desktop syntax
#that needs to be translated but has a non .desktop extension
find data -name "*rc" -print
This diff is collapsed.
#! /usr/bin/env bash
$EXTRACTRC ui/*.ui bugzillaintegration/ui/*.ui >> rc.cpp
$XGETTEXT *.cpp bugzillaintegration/*.cpp -o $podir/drkonqi5.pot
rm -f rc.cpp
How to activate the debug button for DrKonqi:
$KDEHOME/share/config/drkonqirc:
[Drkonqi]
ShowDebugButton=true
##Main Tasks
-------------
##For KDE4.5+:
--------------
- Offer option to "subscribe" (addToCC) to a bug report
#P1:
- Check the wording of the new introduced texts (common crashes warnings and notes)
- Implement inline help (tooltip/whatsthis) for Bugzilla Duplicate Confirmation dialog
#P2
#- Have a "canceled " page (instead of directly exiting the assistant) ?????
- If the report was "dismissed" because it was not really useful, and the backtrace was not generated;
allow the advanced users to generate it later (on the "Show report's content" button or in the backtrace tab)
#P3
- Merge the two main dialogs (?)
#Other
- If attaching, include in the attach'description, a condensed string with the app/kdesc version
- Check for plugins / Read memory-maps (/proc/PID/maps) and upload as attachment
(example, if plasma crashes, which libs were loaded, which lib caused the crash)
This is useful to determine if some external plugin is involved
(I don't know if this is technically possible)
- Implement TerminalDebuggerLauncher (the idea is to use the same trick as the one used in the installdbgsymbols.sh examples)
- BacktraceGenerator should not be allowed to start if another debugger is running.
Add some check and possibly some signal indicating this state. As a consequence,
remove the call to DrKonqi::debuggerManager()->debuggerIsRunning() from BacktraceWidget
to make it trully independent from drkonqi.
- Make a docs dir and add documentation for:
1) the format of the debugger files
2) The dbus interface
+ move README.packagers in there with a proper name.
- Register dynamic debug area (see dfaure's mail on k-c-d).
- Use external .desktop files to provide examples of "useful crash details" for external applications
(ex. Amarok installs a amarokdrkonqiexamples.desktop file with a content like "Type of music you were listening to..."
- It can contain translations too.
## FUTURE
---------------
- Update DrKonqi to use the remote product mapping implementation (being done by Mattr)
[[ currently bugzillalib detects unexistent products to later use the "kde" product ]]
##Update: local mappings file support already implemented.
##Sample PHP script sent
Waiting for remote implementation to be complete.
- Implement a bugzilla field "Fixed at" X version, to show to the user... (mattr)
- Detect app versions and encourage the user to test new version?
(detect stable or devel)
- Custom usefulness values needed by application
(ex. Amarok wants only perfect backtraces...)
##Brainstorming
--------------
- Try to also provide full backtraces ("bt full")
The simple backtrace is going to be pasted inline as always
The complete backtrace could be added as an attachment
(how to retrieve both versions at the same time?, fetch only the full and "manually strip it" to get the simple one ?)
- Implement bugtracking-system-agnostic interface on KDE servers and adapt DrKonqi to interact with it
(this will also remove the HTML parsing code from DrKonqi itself, to put it on a remote script)
- Display the time of the crash
("I came back to the computer some time later and drkonqi was there..
when the application crashed? during the night?") (by sreich)
- Usability review and suggestions:
http://blogs.msdn.com/oldnewthing/archive/2003/09/01/54734.aspx (by Maciej)
- Hide backtrace from user (only show progress and backtrace status)??
- Search in backtrace (esp. for [KCrash Handler])
- Backtrace syntax highlighting (xml parser+ some qt/kde class ?)
- Option to "don't show DrKonqi for this(X) app"
(Do we want this?)
- Option to avoid drkonqi at all (setting KDE_DEBUG=1), and GUI to renable it
(Do we want this?)
#Later
---------
- Implement a proper DBus interface.
- Include help in the details page, near the "Details:" label (ex. "What should I write this?" link with help)
#DONE
-------
- Improve the "Enter manual bug ID" option in the Duplicates page to be more discoverable
- Improve the help about the information the user needs to provide
- Show the minimum text require length / or a "progress bar"(or capacitybar)
- If we are going to attach the bug report to an existent one, and that one has too much duplicates, warn the user that his/her attachment is only going to be useful if s/he provides good info
- In the "Details page" (user enters description) write the headers like
"What I was doing when app crashed: \n\n Other useful config details:" (depending on the options checked before)
- Exclude some backtrace functions to improve the search feature (like Qt base stuff at the top of the bt)
- Replace the progressbar of the StatusWidget with a throbber....
- The reporting dialog should check (on start) if the backtrace was already generated by the main dialog
(to use it when saving the report to a file, even when the backtrace page is not shown)
- If reproducibility is Always or Sometimes, set a minimum required char ammount in the details page
- Title is not needed when attaching the report to an existant one
- Remove the "Are you ready to submit this bug report" in the Preview page
- Application detection: ask for or detect specific things depending on application
ie konqueror: url, plasma: plasmoids in use, kopete: protocol, etc.
- REVIEW criteria of minimum chars/words to use in the Title and Details fields
"- If a possible duplicate is marked as FIXED, show a better (banner) message so the user will notice....
!!IMPORTANT: (to be done before 2009Nov25 / String Freeze)
- Update "AboutBugReporting" guide to reflect the new workflow
- Review the confirmation dialog in the Bug Report Information page:
if the text is not long enough, we dismiss the whole report saying something like "a report without a good description
will only waste bug triagers and developers time"...
##- Use https://bugs.kde.org/enter_bug.cgi?product=X to fetch product versions... (it will reduce server load)
##Bugzilla DrKonqi reports cleanup:
Wontfix: 143243, 185547
---------
---------
* Crashes on Shutdown:
https://bugs.kde.org/show_bug.cgi?id=126073 ->
**** Restore block shutdown/logout while DrKonqi window is up
(to catch crashes on shutdown)
- Config option to:
- (default) Show a feedback indicator for a "automatically closing window" timer (and continue with shutdown)
- non-default Block shutdown/logout completely, do not use a closing timer.
- Ask Seli for Session Management stuff (we need to ask from code if we are in the middle of a shutdown process)
- Use " unsetenv("SESSION_MANAGER");" again on main.cpp (http://websvn.kde.org/trunk/kdebase/drkonqi/main.cpp?r1=408177&r2=408176&pathrev=408177)
- Startkde waiting for drkonqi to exit->
# wait if there's any crashhandler shown
318 while dcop | grep -q ^drkonqi- ; do
319 sleep 5
320 done
" while qdbus | grep "^[^w]*org.kde.drkonqi" > /dev/null ; do sleep 5; done "
http://websvn.kde.org/trunk/kdebase/startkde?r1=408177&r2=408176&pathrev=408177
http://websvn.kde.org/?view=rev&revision=408177
bool KSessionManager::saveState ( QSessionManager & sm ) [virtual]
void QApplication::saveState ( QSessionManager & manager )
---------------------
---------------------
Improving symbol loading speed using GDB
---
- Create a temp file "init"
"init" contents:
set auto-solib-add off
(this will disable the symbols autoload)
Start gdb with .. "-x init" (init includes the fullpath)
"bt full" will show an empty backtrace, but with the libraries path.
Use "shar path" to load the debug symbols for that file
"bt full" will now be more complete (but it may need more symbols to be loaded)
--
The current gdb commands could be adapted to...
- Do not include the PID on the command line
- "set auto-solib-add off" could be the first command of the BatchCommands (passed tempfile with -x)
- "attach PID" could be the second command
This diff is collapsed.
/*******************************************************************
* aboutbugreportingdialog.h
* Copyright 2009 Dario Andres Rodriguez <andresbajotierra@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, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#ifndef ABOUTBUGREPORTINGDIALOG__H
#define ABOUTBUGREPORTINGDIALOG__H
#include <QDialog>
class QTextBrowser;
class AboutBugReportingDialog: public QDialog
{
Q_OBJECT
public:
explicit AboutBugReportingDialog(QWidget * parent = 0);
~AboutBugReportingDialog() override;
void showSection(const QString&);
private Q_SLOTS:
void handleInternalLinks(const QUrl& url);
private:
QTextBrowser * m_textBrowser;
};
#endif
/*******************************************************************
* applicationdetailsexamples.cpp
* Copyright 2010 Dario Andres Rodriguez <andresbajotierra@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, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#include "applicationdetailsexamples.h"
#include <KLocalizedString>
#include "drkonqi.h"
#include "crashedapplication.h"
ApplicationDetailsExamples::ApplicationDetailsExamples(QObject * parent)
: QObject(parent)
{
QString binaryName = DrKonqi::crashedApplication()->fakeExecutableBaseName();
if (binaryName == QLatin1String("plasmashell")) {
m_examples = i18nc("@info examples about information the user can provide",
"Widgets you have in your desktop and panels (both official and unofficial), "
"desktop settings (wallpaper plugin, themes) and activities.");
} else if (binaryName == QLatin1String("kwin_x11") || binaryName == QLatin1String("kwin_wayland")) {
m_examples = i18nc("@info examples about information the user can provide",
"State of Desktop Effects (Compositing), kind of effects enabled, window decoration, "
"and specific window rules and configuration.");
} else if (binaryName == QLatin1String("konqueror") ||
binaryName == QLatin1String("rekonq")) {
m_examples = i18nc("@info examples about information the user can provide",
"sites you were visiting, number of opened tabs, plugins you have installed, "
"and any other non-default setting.");
} else if (binaryName == QLatin1String("dolphin")) {
m_examples = i18nc("@info examples about information the user can provide",
"File view mode, grouping and sorting settings, preview settings, and directory you were browsing.");
} else if (binaryName == QLatin1String("kopete")) {
m_examples = i18nc("@info examples about information the user can provide",
"Instant Messaging protocols you use, and plugins you have installed (official and unofficial).");
} else if (binaryName == QLatin1String("kmail")) {
m_examples = i18nc("@info examples about information the user can provide",
"Mail protocols and account-types you use.");
} else if (binaryName == QLatin1String("kwrite") ||
binaryName == QLatin1String("kate") ||
binaryName == QLatin1String("kword")) {
m_examples = i18nc("@info examples about information the user can provide",
"Type of the document you were editing.");
} else if (binaryName == QLatin1String("juk") ||
binaryName == QLatin1String("amarok") ||
binaryName == QLatin1String("dragon") ||
binaryName == QLatin1String("kaffeine")) {
m_examples = i18nc("@info examples about information the user can provide",
"Type of media (extension and format) you were watching and/or listening to.");
}
}
bool ApplicationDetailsExamples::hasExamples() const
{
return !m_examples.isEmpty();
}
QString ApplicationDetailsExamples::examples() const
{
return m_examples;
}
/*******************************************************************
* applicationdetailsexamples.h
* Copyright 2010 Dario Andres Rodriguez <andresbajotierra@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, see <http://www.gnu.org/licenses/>.
*
******************************************************************/
#ifndef APPLICATIONDETAILSEXAMPLES__H
#define APPLICATIONDETAILSEXAMPLES__H
#include <QtCore/QObject>
#include <QtCore/QString>
class ApplicationDetailsExamples : QObject
{
Q_OBJECT
public:
explicit ApplicationDetailsExamples(QObject * parent);
bool hasExamples() const;
QString examples() const;
private:
QString m_examples;
};
#endif
/*****************************************************************
* drkonqi - The KDE Crash Handler
*
* Copyright (C) 2000-2003 Hans Petter Bieker <bieker@kde.org>
* Copyright (C) 2009 George Kiagiadakis <gkiagia@users.sourceforge.net>
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*****************************************************************/
#include "backtracegenerator.h"
#include <QTemporaryFile>
#include <QDebug>
#include <KShell>
#include <KProcess>
#include "parser/backtraceparser.h"
BacktraceGenerator::BacktraceGenerator(const Debugger & debugger, QObject *parent)
: QObject(parent),
m_debugger(debugger), m_proc(NULL),
m_temp(NULL), m_state(NotLoaded)
{
m_parser = BacktraceParser::newParser(m_debugger.codeName(), this);
m_parser->connectToGenerator(this);
#ifdef BACKTRACE_PARSER_DEBUG
m_debugParser = BacktraceParser::newParser(QString(), this); //uses the null parser
m_debugParser->connectToGenerator(this);
#endif
}
BacktraceGenerator::~BacktraceGenerator()
{
if (m_proc && m_proc->state() == QProcess::Running) {
qWarning() << "Killing running debugger instance";
m_proc->disconnect(this);
m_proc->terminate();
if (!m_proc->waitForFinished(10000)) {
m_proc->kill();
m_proc->waitForFinished();
}
delete m_proc;
delete m_temp;
}
}
bool BacktraceGenerator::start()
{
//they should always be null before entering this function.
Q_ASSERT(m_proc == NULL && m_temp == NULL);
m_parsedBacktrace.clear();
m_state = Loading;
emit starting();
if (!m_debugger.isValid() || !m_debugger.isInstalled()) {
m_state = FailedToStart;
emit failedToStart();
return false;
}
m_proc = new KProcess;
m_proc->setEnv(QStringLiteral("LC_ALL"), QStringLiteral("C")); // force C locale
m_temp = new QTemporaryFile;
m_temp->open();
m_temp->write(m_debugger.backtraceBatchCommands().toLatin1());
m_temp->write("\n", 1);
m_temp->flush();
// start the debugger
QString str = m_debugger.command();
Debugger::expandString(str, Debugger::ExpansionUsageShell, m_temp->fileName());
*m_proc << KShell::splitArgs(str);
m_proc->setOutputChannelMode(KProcess::OnlyStdoutChannel);
m_proc->setNextOpenMode(QIODevice::ReadWrite | QIODevice::Text);
connect(m_proc, &KProcess::readyReadStandardOutput, this, &BacktraceGenerator::slotReadInput);
connect(m_proc, static_cast<void (KProcess::*)(int, QProcess::ExitStatus)>(&KProcess::finished), this, &BacktraceGenerator::slotProcessExited);
m_proc->start();
if (!m_proc->waitForStarted()) {
//we mustn't keep these around...
m_proc->deleteLater();
m_temp->deleteLater();
m_proc = NULL;
m_temp = NULL;
m_state = FailedToStart;
emit failedToStart();
return false;
}
return true