Commit b6f187d0 authored by hjk's avatar hjk

Debugger: split editor related code off watchutils.{h,cpp}

This is now in sourceutils.{h,cpp} to make watchutils.{h,cpp}
better acessible to the debugger auto-tests.

Change-Id: Ie87e715bc7018ca190a460c37dfd19bc897059f0
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent fb502785
......@@ -55,6 +55,7 @@
#include "shared/cdbsymbolpathlisteditor.h"
#include "shared/hostutils.h"
#include "procinterrupt.h"
#include "sourceutils.h"
#include <TranslationUnit.h>
......
......@@ -57,6 +57,7 @@ HEADERS += \
sourceagent.h \
sourcefileshandler.h \
sourcefileswindow.h \
sourceutils.h \
stackframe.h \
stackhandler.h \
stackwindow.h \
......@@ -107,6 +108,7 @@ SOURCES += \
sourceagent.cpp \
sourcefileshandler.cpp \
sourcefileswindow.cpp \
sourceutils.cpp \
stackhandler.cpp \
stackwindow.cpp \
threadshandler.cpp \
......
......@@ -117,6 +117,8 @@ QtcPlugin {
"sourcefileshandler.h",
"sourcefileswindow.cpp",
"sourcefileswindow.h",
"sourceutils.cpp",
"sourceutils.h",
"stackframe.cpp",
"stackframe.h",
"stackhandler.cpp",
......
......@@ -62,6 +62,7 @@
#include "localsandexpressionswindow.h"
#include "loadcoredialog.h"
#include "hostutils.h"
#include "sourceutils.h"
#include "snapshothandler.h"
#include "threadshandler.h"
......
......@@ -34,6 +34,7 @@
#include "debuggerprotocol.h"
#include "debuggerstartparameters.h"
#include "debuggerstringutils.h"
#include "sourceutils.h"
#include "stackhandler.h"
#include "watchhandler.h"
......
......@@ -51,6 +51,7 @@
#include "disassembleragent.h"
#include "gdboptionspage.h"
#include "memoryagent.h"
#include "sourceutils.h"
#include "watchutils.h"
#include "breakhandler.h"
......@@ -5448,6 +5449,14 @@ void GdbEngine::interruptLocalInferior(qint64 pid)
}
}
QByteArray GdbEngine::dotEscape(QByteArray str)
{
str.replace(' ', '.');
str.replace('\\', '.');
str.replace('/', '.');
return str;
}
//
// Factory
//
......
......@@ -720,6 +720,7 @@ protected:
static QString msgInferiorSetupOk();
static QString msgInferiorRunOk();
static QString msgConnectRemoteServerFailed(const QString &why);
static QByteArray dotEscape(QByteArray str);
protected:
enum DumperHandling
......
......@@ -42,6 +42,7 @@
#include "moduleshandler.h"
#include "registerhandler.h"
#include "stackhandler.h"
#include "sourceutils.h"
#include "watchhandler.h"
#include "watchutils.h"
......
......@@ -37,6 +37,7 @@
#include "debuggerstringutils.h"
#include "moduleshandler.h"
#include "registerhandler.h"
#include "sourceutils.h"
#include "stackhandler.h"
#include "watchhandler.h"
#include "watchutils.h"
......
This diff is collapsed.
/****************************************************************************
**
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and Digia. For licensing terms and
** conditions see http://qt.digia.com/licensing. For further information
** use the contact form at http://qt.digia.com/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively, this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** In addition, as a special exception, Digia gives you certain additional
** rights. These rights are described in the Digia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
****************************************************************************/
#ifndef SOURCE_UTILS_H
#define SOURCE_UTILS_H
#include <QSet>
#include <QString>
namespace TextEditor { class ITextEditor; }
namespace Core { class IEditor; }
namespace CPlusPlus { class Snapshot; }
namespace Debugger {
namespace Internal {
// Editor tooltip support
bool isCppEditor(Core::IEditor *editor);
QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
int *line, int *column, QString *function = 0);
QString fixCppExpression(const QString &exp);
QString cppFunctionAt(const QString &fileName, int line);
// Get variables that are not initialized at a certain line
// of a function from the code model. Shadowed variables will
// be reported using the debugger naming conventions '<shadowed n>'
bool getUninitializedVariables(const CPlusPlus::Snapshot &snapshot,
const QString &function, const QString &file, int line,
QStringList *uninitializedVariables);
} // namespace Internal
} // namespace Debugger
#endif // SOURCE_UTILS_H
......@@ -27,11 +27,14 @@
**
****************************************************************************/
// NOTE: Don't add dependencies to other files.
// This is used in the debugger auto-tests.
#include "watchdata.h"
#include "watchutils.h"
#include <QTextStream>
#include <QTextDocument>
#include <QTextStream>
#include <QDebug>
////////////////////////////////////////////////////////////////////
......
This diff is collapsed.
......@@ -30,29 +30,18 @@
#ifndef WATCHUTILS_H
#define WATCHUTILS_H
// NOTE: Don't add dependencies to other files.
// This is used in the debugger auto-tests.
#include <QSet>
#include <QString>
namespace TextEditor {
class ITextEditor;
}
namespace Core {
class IEditor;
}
namespace CPlusPlus {
class Snapshot;
}
namespace Debugger {
namespace Internal {
class WatchData;
class GdbMi;
QByteArray dotEscape(QByteArray str);
QString currentTime();
bool isSkippableFunction(const QString &funcName, const QString &fileName);
bool isLeavableFunction(const QString &funcName, const QString &fileName);
......@@ -69,25 +58,12 @@ bool isIntOrFloatType(const QByteArray &type);
bool isIntType(const QByteArray &type);
QString formatToolTipAddress(quint64 a);
// Editor tooltip support
bool isCppEditor(Core::IEditor *editor);
QString cppExpressionAt(TextEditor::ITextEditor *editor, int pos,
int *line, int *column, QString *function = 0);
QString removeObviousSideEffects(const QString &exp);
QString fixCppExpression(const QString &exp);
QString cppFunctionAt(const QString &fileName, int line);
// Decode string data as returned by the dumper helpers.
void decodeArray(WatchData *list, const WatchData &tmplate,
const QByteArray &rawData, int encoding);
// Get variables that are not initialized at a certain line
// of a function from the code model. Shadowed variables will
// be reported using the debugger naming conventions '<shadowed n>'
bool getUninitializedVariables(const CPlusPlus::Snapshot &snapshot,
const QString &function, const QString &file, int line,
QStringList *uninitializedVariables);
//
// GdbMi interaction
......
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