Commit affbbd85 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use debug categories

parent 165dad0c
......@@ -45,5 +45,6 @@ add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_subdirectory(src)
install( FILES drkonqi.categories DESTINATION ${KDE_INSTALL_CONFDIR} )
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)
org.kde.drkonqi (drkonqi)
org.kde.drkonqi.parser (drkonqi parser)
......@@ -75,6 +75,9 @@ ki18n_wrap_ui(drkonqi_SRCS
bugzillaintegration/ui/assistantpage_bugzilla_send.ui
)
ecm_qt_declare_logging_category(drkonqi_SRCS HEADER drkonqi_debug.h IDENTIFIER DRKONQI_LOG CATEGORY_NAME org.kde.drkonqi)
add_executable(drkonqi ${drkonqi_SRCS})
ecm_mark_nongui_executable(drkonqi)
......
......@@ -28,7 +28,7 @@
#include "backtracegenerator.h"
#include <QTemporaryFile>
#include <QDebug>
#include "drkonqi_debug.h"
#include <KShell>
#include <KProcess>
......@@ -51,7 +51,7 @@ BacktraceGenerator::BacktraceGenerator(const Debugger & debugger, QObject *paren
BacktraceGenerator::~BacktraceGenerator()
{
if (m_proc && m_proc->state() == QProcess::Running) {
qWarning() << "Killing running debugger instance";
qCWarning(DRKONQI_LOG) << "Killing running debugger instance";
m_proc->disconnect(this);
m_proc->terminate();
if (!m_proc->waitForFinished(10000)) {
......
......@@ -20,10 +20,10 @@
#include "bugzillalib.h"
#include <QtCore/QtGlobal>
#include <QtCore/QTextStream>
#include <QtCore/QByteArray>
#include <QtCore/QString>
#include <QtGlobal>
#include <QTextStream>
#include <QByteArray>
#include <QString>
#include <QtXml/QDomNode>
#include <QtXml/QDomNodeList>
......@@ -32,7 +32,7 @@
#include <KIO/Job>
#include <KLocalizedString>
#include <QDebug>
#include "drkonqi_debug.h"
#define MAKE_BUGZILLA_VERSION(a,b,c) (((a) << 16) | ((b) << 8) | (c))
......@@ -63,10 +63,14 @@ BugzillaManager::BugzillaManager(const QString &bugTrackerUrl, QObject *parent)
, m_searchJob(nullptr)
{
m_xmlRpcClient = new KXmlRpc::Client(QUrl(m_bugTrackerUrl + QStringLiteral("xmlrpc.cgi")), this);
m_xmlRpcClient->setUserAgent(QLatin1String("DrKonqi"));
m_xmlRpcClient->setUserAgent(QStringLiteral("DrKonqi"));
// Allow constructors for ReportInterface and assistant dialogs to finish.
// We do not want them to be racing the remote Bugzilla database.
#if QT_VERSION >= QT_VERSION_CHECK(5, 10, 0)
QMetaObject::invokeMethod (this, &BugzillaManager::lookupVersion, Qt::QueuedConnection);
#else
QMetaObject::invokeMethod (this, "lookupVersion", Qt::QueuedConnection);
#endif
}
// BEGIN Checks of Bugzilla software versions.
......@@ -99,7 +103,7 @@ void BugzillaManager::setFeaturesForVersion(const QString& version)
digits << QLatin1String("0");
}
if (digits.count() > nVersionParts) {
qWarning() << QStringLiteral("Current Bugzilla version %1 has more than %2 parts. Check that this is not a problem.").arg(version).arg(nVersionParts);
qCWarning(DRKONQI_LOG) << QStringLiteral("Current Bugzilla version %1 has more than %2 parts. Check that this is not a problem.").arg(version).arg(nVersionParts);
}
int currentVersion = MAKE_BUGZILLA_VERSION(digits.at(0).toUInt(),
digits.at(1).toUInt(), digits.at(2).toUInt());
......@@ -115,7 +119,7 @@ void BugzillaManager::setFeaturesForVersion(const QString& version)
m_security = UsePasswords;
}
qDebug() << "VERSION" << version << "SECURITY" << m_security;
qCDebug(DRKONQI_LOG) << "VERSION" << version << "SECURITY" << m_security;
}
// END Checks of Bugzilla software versions.
......@@ -127,16 +131,16 @@ void BugzillaManager::callBugzilla(const char* method, const char* id,
if (security == SecurityEnabled) {
switch (m_security) {
case UseTokens:
qDebug() << method << id << "using token";
qCDebug(DRKONQI_LOG) << method << id << "using token";
args.insert(QLatin1String("Bugzilla_token"), m_token);
break;
case UsePasswords:
qDebug() << method << id << "using username" << m_username;
qCDebug(DRKONQI_LOG) << method << id << "using username" << m_username;
args.insert(QLatin1String("Bugzilla_login"), m_username);
args.insert(QLatin1String("Bugzilla_password"), m_password);
break;
case UseCookies:
qDebug() << method << id << "using cookies";
qCDebug(DRKONQI_LOG) << method << id << "using cookies";
// Some KDE process other than Dr Konqi should provide cookies.
break;
}
......@@ -407,7 +411,7 @@ void BugzillaManager::fetchProductInfoFinished(const QVariantMap & map)
void BugzillaManager::callMessage(const QList<QVariant> & result, const QVariant & id)
{
qDebug() << id << result;
qCDebug(DRKONQI_LOG) << id << result;
if (id.toString() == QLatin1String("login")) {
if ((m_security == UseTokens) && (result.count() > 0)) {
......@@ -450,7 +454,7 @@ void BugzillaManager::callMessage(const QList<QVariant> & result, const QVariant
void BugzillaManager::callFault(int errorCode, const QString & errorString, const QVariant & id)
{
qDebug() << id << errorCode << errorString;
qCDebug(DRKONQI_LOG) << id << errorCode << errorString;
QString genericError = i18nc("@info", "Received unexpected error code %1 from bugzilla. "
"Error message was: %2", errorCode, errorString);
......
......@@ -19,7 +19,7 @@
#include "duplicatefinderjob.h"
#include <QDebug>
#include "drkonqi_debug.h"
#include "backtracegenerator.h"
#include "parser/backtraceparser.h"
......@@ -32,7 +32,7 @@ DuplicateFinderJob::DuplicateFinderJob(const QList<int> &bugIds, BugzillaManager
m_manager(manager),
m_bugIds(bugIds)
{
qDebug() << "Possible duplicates:" << m_bugIds;
qCDebug(DRKONQI_LOG) << "Possible duplicates:" << m_bugIds;
connect(m_manager, &BugzillaManager::bugReportFetched, this, &DuplicateFinderJob::slotBugReportFetched);
connect(m_manager, &BugzillaManager::bugReportError, this, &DuplicateFinderJob::slotBugReportError);
}
......@@ -59,7 +59,7 @@ void DuplicateFinderJob::analyzeNextBug()
}
const int bugId = m_bugIds.takeFirst();
qDebug() << "Fetching:" << bugId;
qCDebug(DRKONQI_LOG) << "Fetching:" << bugId;
m_manager->fetchBugReport(bugId, this);
}
......@@ -68,10 +68,10 @@ void DuplicateFinderJob::fetchBug(const QString &bugId)
bool ok;
const int num = bugId.toInt(&ok);
if (ok) {
qDebug() << "Fetching:" << bugId;
qCDebug(DRKONQI_LOG) << "Fetching:" << bugId;
m_manager->fetchBugReport(num, this);
} else {
qDebug() << "Bug id not valid:" << bugId;
qCDebug(DRKONQI_LOG) << "Bug id not valid:" << bugId;
analyzeNextBug();
}
}
......@@ -87,26 +87,26 @@ void DuplicateFinderJob::slotBugReportFetched(const BugReport &bug, QObject *own
BacktraceGenerator *btGenerator = DrKonqi::debuggerManager()->backtraceGenerator();
const ParseBugBacktraces::DuplicateRating rating = parse.findDuplicate(btGenerator->parser()->parsedBacktraceLines());
qDebug() << "Duplicate rating:" << rating;
qCDebug(DRKONQI_LOG) << "Duplicate rating:" << rating;
//TODO handle more cases here
if (rating != ParseBugBacktraces::PerfectDuplicate) {
qDebug() << "Bug" << bug.bugNumber() << "most likely not a duplicate:" << rating;
qCDebug(DRKONQI_LOG) << "Bug" << bug.bugNumber() << "most likely not a duplicate:" << rating;
analyzeNextBug();
return;
}
//The Bug is a duplicate, now find out the status and resolution of the existing report
if (bug.resolutionValue() == BugReport::Duplicate) {
qDebug() << "Found duplicate is a duplicate itself.";
qCDebug(DRKONQI_LOG) << "Found duplicate is a duplicate itself.";
if (!m_result.duplicate) {
m_result.duplicate = bug.bugNumberAsInt();
}
fetchBug(bug.markedAsDuplicateOf());
} else if ((bug.statusValue() == BugReport::UnknownStatus) || (bug.resolutionValue() == BugReport::UnknownResolution)) {
qDebug() << "Either the status or the resolution is unknown.";
qDebug() << "Status \"" << bug.bugStatus() << "\" known:" << (bug.statusValue() != BugReport::UnknownStatus);
qDebug() << "Resolution \"" << bug.resolution() << "\" known:" << (bug.resolutionValue() != BugReport::UnknownResolution);
qCDebug(DRKONQI_LOG) << "Either the status or the resolution is unknown.";
qCDebug(DRKONQI_LOG) << "Status \"" << bug.bugStatus() << "\" known:" << (bug.statusValue() != BugReport::UnknownStatus);
qCDebug(DRKONQI_LOG) << "Resolution \"" << bug.resolution() << "\" known:" << (bug.resolutionValue() != BugReport::UnknownResolution);
analyzeNextBug();
} else {
if (!m_result.duplicate) {
......@@ -115,7 +115,7 @@ void DuplicateFinderJob::slotBugReportFetched(const BugReport &bug, QObject *own
m_result.parentDuplicate = bug.bugNumberAsInt();
m_result.status = bug.statusValue();
m_result.resolution = bug.resolutionValue();
qDebug() << "Found duplicate information (id/status/resolution):" << bug.bugNumber() << bug.bugStatus() << bug.resolution();
qCDebug(DRKONQI_LOG) << "Found duplicate information (id/status/resolution):" << bug.bugNumber() << bug.bugStatus() << bug.resolution();
emitResult();
}
}
......@@ -125,6 +125,6 @@ void DuplicateFinderJob::slotBugReportError(const QString &message, QObject *own
if (this != owner) {
return;
}
qDebug() << "Error fetching bug:" << message;
qCDebug(DRKONQI_LOG) << "Error fetching bug:" << message;
analyzeNextBug();
}
......@@ -21,7 +21,7 @@
#include <KConfig>
#include <KConfigGroup>
#include <QDebug>
#include "drkonqi_debug.h"
#include <QStandardPaths>
#include "bugzillalib.h"
......@@ -68,10 +68,10 @@ void ProductMapping::mapUsingInternalFile(const QString & appName)
m_bugzillaComponent = list.at(1);
m_relatedBugzillaProducts = QStringList() << m_bugzillaProduct;
} else {
qWarning() << "Error while reading mapping entry. Sections found " << list.count();
qCWarning(DRKONQI_LOG) << "Error while reading mapping entry. Sections found " << list.count();
}
} else {
qWarning() << "Error while reading mapping entry. Entry exists but it is empty "
qCWarning(DRKONQI_LOG) << "Error while reading mapping entry. Entry exists but it is empty "
"(or there was an error when reading)";
}
}
......@@ -90,7 +90,7 @@ void ProductMapping::getRelatedProductsUsingInternalFile(const QString & bugzill
if (productGroup.hasKey(bugzillaProduct)) {
QString group = productGroup.readEntry(bugzillaProduct);
if (group.isEmpty()) {
qWarning() << "Error while reading mapping entry. Entry exists but it is empty "
qCWarning(DRKONQI_LOG) << "Error while reading mapping entry. Entry exists but it is empty "
"(or there was an error when reading)";
return;
}
......@@ -114,7 +114,7 @@ void ProductMapping::getRelatedProductsUsingInternalFile(const QString & bugzill
m_relatedBugzillaProducts.append(relatedGroups);
}
} else {
qWarning() << "Error while reading mapping entry. Entry exists but it is empty "
qCWarning(DRKONQI_LOG) << "Error while reading mapping entry. Entry exists but it is empty "
"(or there was an error when reading)";
}
}
......
......@@ -33,7 +33,7 @@
#include <QtDBus/QDBusInterface>
#include <QtDBus/QDBusReply>
#include <QDebug>
#include "drkonqi_debug.h"
#include <KMessageBox>
#include <KToolInvocation>
#include <KLocalizedString>
......@@ -235,7 +235,7 @@ void BugzillaLoginPage::walletLogin()
bool BugzillaLoginPage::canSetCookies()
{
if (bugzillaManager()->securityMethod() != BugzillaManager::UseCookies) {
qDebug() << "Bugzilla software no longer issues cookies.";
qCDebug(DRKONQI_LOG) << "Bugzilla software no longer issues cookies.";
return false;
}
QDBusInterface kded(QStringLiteral("org.kde.kded5"),
......@@ -263,7 +263,7 @@ bool BugzillaLoginPage::canSetCookies()
return false;
}
qDebug() << "Got reply from KCookieServer:" << advice.value();
qCDebug(DRKONQI_LOG) << "Got reply from KCookieServer:" << advice.value();
if (advice.value() == QLatin1String("Reject")) {
QString msg = i18nc("@info 1 is the bugzilla website url",
......@@ -283,7 +283,7 @@ bool BugzillaLoginPage::canSetCookies()
KDE_BUGZILLA_URL,
QStringLiteral("Accept"));
if (!success.isValid() || !success.value()) {
qWarning() << "Failed to set domain advice in KCookieServer";
qCWarning(DRKONQI_LOG) << "Failed to set domain advice in KCookieServer";
return false;
} else {
return true;
......
......@@ -20,7 +20,7 @@
#include <KShell>
#include <KProcess>
#include <QDebug>
#include "drkonqi_debug.h"
#include "detachedprocessmonitor.h"
#include "drkonqi.h"
......@@ -41,7 +41,7 @@ QString DefaultDebuggerLauncher::name() const
void DefaultDebuggerLauncher::start()
{
if ( qobject_cast<DebuggerManager*>(parent())->debuggerIsRunning() ) {
qWarning() << "Another debugger is already running";
qCWarning(DRKONQI_LOG) << "Another debugger is already running";
return;
}
......@@ -53,7 +53,7 @@ void DefaultDebuggerLauncher::start()
if ( pid > 0 ) {
m_monitor->startMonitoring(pid);
} else {
qWarning() << "Could not start debugger:" << name();
qCWarning(DRKONQI_LOG) << "Could not start debugger:" << name();
emit finished();
}
}
......
......@@ -15,6 +15,7 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "detachedprocessmonitor.h"
#include "drkonqi_debug.h"
#include <errno.h>
#include <signal.h>
......@@ -37,7 +38,7 @@ void DetachedProcessMonitor::timerEvent(QTimerEvent *event)
{
Q_ASSERT(m_pid != 0);
if (::kill(m_pid, 0) < 0) {
qDebug() << "Process" << m_pid << "finished. kill(2) returned errno:" << errno;
qCDebug(DRKONQI_LOG) << "Process" << m_pid << "finished. kill(2) returned errno:" << errno;
killTimer(event->timerId());
m_pid = 0;
emit processFinished();
......
......@@ -40,6 +40,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "drkonqi.h"
#include "drkonqi_debug.h"
#include <QtCore/QPointer>
#include <QtCore/QTextStream>
......@@ -96,7 +97,7 @@ public:
}
protected:
void timerEvent(QTimerEvent *event) override {
qDebug() << "Enabling drkonqi crash catching";
qCDebug(DRKONQI_LOG) << "Enabling drkonqi crash catching";
KCrash::setDrKonqiEnabled(true);
killTimer(event->timerId());
this->deleteLater();
......@@ -113,7 +114,7 @@ bool DrKonqi::init()
// is not drkonqi already. If it is drkonqi, delay enabling crash catching
// to prevent recursive crashes (in case it crashes at startup)
if (crashedApplication()->fakeExecutableBaseName() != QLatin1String("drkonqi")) {
qDebug() << "Enabling drkonqi crash catching";
qCDebug(DRKONQI_LOG) << "Enabling drkonqi crash catching";
KCrash::setDrKonqiEnabled(true);
} else {
new EnableCrashCatchingDelayed;
......
......@@ -28,7 +28,7 @@
#include <KConfigGroup>
#include <KCrash>
#include <QStandardPaths>
#include <QDebug>
#include "drkonqi_debug.h"
#include "crashedapplication.h"
#include "debugger.h"
......@@ -64,7 +64,7 @@ bool KCrashBackend::init()
//check whether the attached process exists and whether we have permissions to inspect it
if (crashedApplication()->pid() <= 0) {
qWarning() << "Invalid pid specified";
qCWarning(DRKONQI_LOG) << "Invalid pid specified";
return false;
}
......@@ -72,10 +72,10 @@ bool KCrashBackend::init()
if (::kill(crashedApplication()->pid(), 0) < 0) {
switch (errno) {
case EPERM:
qWarning() << "DrKonqi doesn't have permissions to inspect the specified process";
qCWarning(DRKONQI_LOG) << "DrKonqi doesn't have permissions to inspect the specified process";
break;
case ESRCH:
qWarning() << "The specified process does not exist.";
qCWarning(DRKONQI_LOG) << "The specified process does not exist.";
break;
default:
break;
......@@ -123,7 +123,7 @@ CrashedApplication *KCrashBackend::constructCrashedApplication()
//try to determine the executable that crashed
if ( QFileInfo(QStringLiteral("/proc/%1/exe").arg(a->m_pid)).exists() ) {
//on linux, the fastest and most reliable way is to get the path from /proc
qDebug() << "Using /proc to determine executable path";
qCDebug(DRKONQI_LOG) << "Using /proc to determine executable path";
a->m_executable.setFile(QFile::symLinkTarget(QStringLiteral("/proc/%1/exe").arg(a->m_pid)));
if (DrKonqi::isKdeinit() ||
......@@ -148,8 +148,8 @@ CrashedApplication *KCrashBackend::constructCrashedApplication()
}
}
qDebug() << "Executable is:" << a->m_executable.absoluteFilePath();
qDebug() << "Executable exists:" << a->m_executable.exists();
qCDebug(DRKONQI_LOG) << "Executable is:" << a->m_executable.absoluteFilePath();
qCDebug(DRKONQI_LOG) << "Executable exists:" << a->m_executable.exists();
return a;
}
......@@ -181,7 +181,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager()
if (firstKnownGoodDebugger.isValid()) {
preferredDebugger = firstKnownGoodDebugger;
} else {
qWarning() << "Unable to find an internal debugger that can work with the KCrash backend";
qCWarning(DRKONQI_LOG) << "Unable to find an internal debugger that can work with the KCrash backend";
}
}
......@@ -191,7 +191,7 @@ DebuggerManager *KCrashBackend::constructDebuggerManager()
void KCrashBackend::stopAttachedProcess()
{
if (m_state == ProcessRunning) {
qDebug() << "Sending SIGSTOP to process";
qCDebug(DRKONQI_LOG) << "Sending SIGSTOP to process";
::kill(crashedApplication()->pid(), SIGSTOP);
m_state = ProcessStopped;
}
......@@ -200,7 +200,7 @@ void KCrashBackend::stopAttachedProcess()
void KCrashBackend::continueAttachedProcess()
{
if (m_state == ProcessStopped) {
qDebug() << "Sending SIGCONT to process";
qCDebug(DRKONQI_LOG) << "Sending SIGCONT to process";
::kill(crashedApplication()->pid(), SIGCONT);
m_state = ProcessRunning;
}
......
......@@ -26,7 +26,7 @@
#include <QStandardPaths>
#include <QMenu>
#include <QDialogButtonBox>
#include <QDebug>
#include "drkonqi_debug.h"
#include <QDesktopServices>
#include "drkonqi.h"
......@@ -254,7 +254,7 @@ void DrKonqiDialog::removeDebugger(AbstractDebuggerLauncher *launcher)
m_debugMenu->removeAction(action);
action->deleteLater();
} else {
qWarning() << "Invalid launcher";
qCWarning(DRKONQI_LOG) << "Invalid launcher";
}
}
......@@ -281,7 +281,7 @@ void DrKonqiDialog::linkActivated(const QString& link)
} else if (link == DRKONQI_REPORT_BUG_URL) {
QDesktopServices::openUrl(QUrl(link));
} else if (link.startsWith(QLatin1String("http"))) {
qWarning() << "unexpected link";
qCWarning(DRKONQI_LOG) << "unexpected link";
QDesktopServices::openUrl(QUrl(link));
}
}
......
......@@ -89,7 +89,7 @@ QStringList FindConfigDataJob::data(InformationType type)
result = temp.split(',', QString::SkipEmptyParts);
}
kDebug() << "Found data for " + key + ':' << result << result.count();
qCDebug(DRKONQI_LOG) << "Found data for " + key + ':' << result << result.count();
return result;
}
......
......@@ -46,7 +46,7 @@ QString AbstractBTGenerator::GetModuleName()
if (!SymGetModuleInfo64(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &module))
{
kError() << "SymGetModuleInfo64 failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "SymGetModuleInfo64 failed: " << GetLastError();
return QLatin1String(DEFAULT_MODULE);
}
......@@ -62,7 +62,7 @@ QString AbstractBTGenerator::GetModulePath()
if (!SymGetModuleInfo64(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &module))
{
kError() << "SymGetModuleInfo64 failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "SymGetModuleInfo64 failed: " << GetLastError();
return QLatin1String(DEFAULT_MODULE);
}
......@@ -93,7 +93,7 @@ void AbstractBTGenerator::Run(HANDLE hThread, bool bFaultingThread)
assert(dw != DWORD(-1));
if (dw == DWORD(-1))
{
kError() << "SuspendThread() failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "SuspendThread() failed: " << GetLastError();
return;
}
......@@ -107,7 +107,7 @@ void AbstractBTGenerator::Run(HANDLE hThread, bool bFaultingThread)
{
ResumeThread(hThread);
assert(false);
kError() << "GetThreadContext() failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "GetThreadContext() failed: " << GetLastError();
return;
}
}
......@@ -117,13 +117,13 @@ void AbstractBTGenerator::Run(HANDLE hThread, bool bFaultingThread)
HANDLE hMapFile = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, L"Local\\KCrashShared");
if (hMapFile == NULL)
{
kError() << "OpenFileMapping() failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "OpenFileMapping() failed: " << GetLastError();
return;
}
CONTEXT *othercontext = (CONTEXT*) MapViewOfFile(hMapFile, FILE_MAP_ALL_ACCESS, 0, 0, sizeof(CONTEXT));
if (othercontext == NULL)
{
kError() << "MapViewOfFile() failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "MapViewOfFile() failed: " << GetLastError();
SafeCloseHandle(hMapFile);
return;
}
......@@ -173,7 +173,7 @@ void AbstractBTGenerator::Run(HANDLE hThread, bool bFaultingThread)
NULL))
{
emit Finished();
kDebug() << "Stackwalk finished; GetLastError=" << GetLastError();
qCDebug(DRKONQI_LOG) << "Stackwalk finished; GetLastError=" << GetLastError();
break;
}
......
......@@ -30,20 +30,20 @@ BOOL Callbacks::ReadProcessMemory(HANDLE hProcess, DWORD64 qwBaseAddr, PVOID lpB
SIZE_T st;
BOOL bRet = ::ReadProcessMemory(hProcess, (LPVOID) qwBaseAddr, (LPVOID) lpBuf, nSize, &st);
*lpBytesRead = (DWORD) st;
//kDebug() << "bytes read=" << st << "; bRet=" << bRet << "; LastError: " << GetLastError();
//qCDebug(DRKONQI_LOG) << "bytes read=" << st << "; bRet=" << bRet << "; LastError: " << GetLastError();
return bRet;
}
PVOID Callbacks::SymFunctionTableAccess64(HANDLE hProcess, DWORD64 qwAddr)
{
PVOID ret = ::SymFunctionTableAccess64(hProcess, qwAddr);
//kDebug() << "ret=" << ret << "; LastError: " << GetLastError();
//qCDebug(DRKONQI_LOG) << "ret=" << ret << "; LastError: " << GetLastError();
return ret;
}
DWORD64 Callbacks::SymGetModuleBase64(HANDLE hProcess, DWORD64 qwAddr)
{
DWORD64 ret = ::SymGetModuleBase64(hProcess, qwAddr);
//kDebug() << "ret=" << ret << "; LastError: " << GetLastError();
//qCDebug(DRKONQI_LOG) << "ret=" << ret << "; LastError: " << GetLastError();
return ret;
}
......@@ -36,13 +36,13 @@ int main(int argc, char *argv[])
if (argc != 3)
{
kFatal() << "Parameters are incorrect";
qCCritical(DRKONQI_LOG) << "Parameters are incorrect";
return -1;
}
if (!Process::EnableDebugPrivilege())
{
kFatal() << "Cannot enable debug privilege, exiting";
qCCritical(DRKONQI_LOG) << "Cannot enable debug privilege, exiting";
return -1;
}
......@@ -51,7 +51,7 @@ int main(int argc, char *argv[])
Process proc;
if (!proc.GetInfo(argv[1], argv[2]))
{
kFatal() << "Cannot attach to process, exiting";
qCCritical(DRKONQI_LOG) << "Cannot attach to process, exiting";
return -1;
}
......
......@@ -50,7 +50,7 @@ QString MsvcGenerator::GetFunctionName()
if (!SymFromAddr(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &dwDisplacement, symbol))
{
kError() << "SymFromAddr() failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "SymFromAddr() failed: " << GetLastError();
return QString::fromLatin1(DEFAULT_FUNC);
}
......@@ -58,7 +58,7 @@ QString MsvcGenerator::GetFunctionName()
if (!UnDecorateSymbolName(symbol->Name, undecoratedName, MAX_PATH, UNDNAME_COMPLETE))
{
// if this fails, show the decorated name anyway, don't fail
kError() << "UnDecorateSymbolName() failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "UnDecorateSymbolName() failed: " << GetLastError();
return QString::fromLatin1(symbol->Name);
}
......@@ -74,7 +74,7 @@ QString MsvcGenerator::GetFile()
if (!SymGetLineFromAddr64(m_process.GetHandle(), m_currentFrame.AddrPC.Offset, &dwDisplacement, &line))
{
kError() << "SymGetLineFromAddr64 failed: " << GetLastError();
qCCritical(DRKONQI_LOG) << "SymGetLineFromAddr64 failed: " << GetLastError();