Commit 75f18c27 authored by dt's avatar dt
Browse files

Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline

parents 6d17ee56 d15b7fff
......@@ -9,7 +9,11 @@ unix {
QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp
QCH_FILE = $$OUT_PWD/doc/qtcreator.qch
html_docs.commands =$$QDOC $$PWD/qtcreator.qdocconf
unix {
html_docs.commands = $$QDOC $$PWD/qtcreator.qdocconf
} else {
html_docs.commands = \"$$QDOC $$PWD/qtcreator.qdocconf\"
}
html_docs.depends += $$PWD/qtcreator.qdoc $$PWD/qtcreator.qdocconf
html_docs.files = $$QHP_FILE
......
......@@ -237,10 +237,14 @@
\i
\row
\i Indenting
\i Indenting Blocks
\i
\row
\i Commenting or Uncommenting
\i Commenting or Uncommenting Blocks
\i
\row
\i Switch between Header and Source
\i
\endtable
......@@ -265,6 +269,11 @@
*/
/*!
*/
/*!
\contentspage index.html
......@@ -758,6 +767,126 @@
*/
/*!
\contentspage index.html
\previouspage creator-navigation.html
\page creator-version-control.html
\nextpage creator-debugging.html
\title Qt Creator and Version Control Systems
\table
\caption Version control systems supported by Qt Creator
\row
\i \bold{git}
\i \l{http://git-scm.com/}
\row
\i \bold{Subversion}
\i \l{http://subversion.tigris.org/}
\row
\i \bold{Perforce}
\i \l{http://www.perforce.com}
\endtable
\section1 Setup
Qt Creator uses the version control system's command line clients to
access your repositories. To set it up, you must ensure that these command
line clients can be located via the \c{PATH} environment variable. You can
specify the path to the command line client's executable in the settings
pages that can be found under \gui{Options...} in the \gui{Tools} menu.
\section1 Usage
You can find the version control menu entires in a sub-menu of the
\gui{Tools} menu. The version control system displayed here is the system
that manages the current project.
Each version control system adds a pane to the \gui{Application Output}
panes within which it will log the commands it executes, prepended by a
timestamp and the relevant output.
\image qtcreator-vcs-pane.png
\section2 Addings Files
When you create a new file or a new project, the wizards will display page
requesting whether the files should be added to a version control system.
This depends on whether the parent directory or the project is already
under version control and the system supports the concept of adding files,
e.g., \bold{Perforce} and \bold{Subversion}. Alternatively, you can also
add files later on using the version control tool menus.
With \bold{git}, there is no concept of adding files. Instead, all modified
files must be \e{staged} for a commit.
\section2 Viewing Diff Output
All version control systems provide menu options to \e{diff} the current
file or project - comparing with the latest version stored in the
repository and displaying the differences. In Qt Creator, a diff is
displayed in a read-only editor. If the file is accessible, you can double
-click on a selected diff chunk and Qt Creator will open an editor
displaying the file, scrolled to the line in question.
\image qtcreator-vcs-diff.png
\section2 Viewing Versioning History and Change Details
The versioning history of a file can be displayed by selecting the
\gui{Log} (for \bold{git}) or \gui{Filelog (for \bold{Perforce} and
\bold{Subversion})} option. Typically, the log output will contain the
date, the commit message, and a change or revision identifier. If you
click on the identifier, a description of the change including the diff
will be displayed.
\image qtcreator-vcs-log.png
\image qtcreaotr-vcs-describe.png
\section2 Annotating Files
Annotation views are obtained by selecting \gui{Annotate} or \gui{Blame}.
This will display the lines of the file prepended by the change identifier
they originate from. Clicking on the change identifier shows a detailed
description of the file.
\section2 Committing Changes
Once you have finished making changes, you can submit them to the version
control system by choosing \gui{Commit} or \gui{Submit}. Qt Creator will
display a commit page containing a text editor, where you can enter your
commit message, and a checkable list of modified files to be included.
When you are done, click \gui{Commit} to start committing. In addition,
there is a \gui{Diff selected} button that brings up a diff view of the
files selected in the file list. Since the commit page is just another
editor, you can go back to it by closing the diff view. Alternatively, you
can view it from the editor combo box showing the \gui{Opened files}.
\image qtcreator-vcs-commit.png
\section2 Menu Entries Specific to git
The git sub-menu contains additional entries:
\table
\row
\i \gui{Stash}
\i Stash local changes prior to executing a \bold{pull}.
\row
\i
\i
\endtable
*/
/*!
\contentspage index.html
......
......@@ -26,11 +26,11 @@ HEADERS += attachexternaldialog.h \
disassemblerwindow.h \
gdbengine.h \
gdbmi.h \
gdboptionpage.h \
idebuggerengine.h \
imports.h \
moduleshandler.h \
moduleswindow.h \
outputcollector.h \
procinterrupt.h \
registerhandler.h \
registerwindow.h \
......@@ -41,7 +41,7 @@ HEADERS += attachexternaldialog.h \
threadswindow.h \
watchhandler.h \
watchwindow.h
SOURCES += attachexternaldialog.cpp \
attachremotedialog.cpp \
breakhandler.cpp \
......@@ -55,10 +55,9 @@ SOURCES += attachexternaldialog.cpp \
disassemblerwindow.cpp \
gdbengine.cpp \
gdbmi.cpp \
gdboptionpage.cpp \
gdbengine.h \
moduleshandler.cpp \
moduleswindow.cpp \
outputcollector.cpp \
procinterrupt.cpp \
registerhandler.cpp \
registerwindow.cpp \
......
......@@ -86,6 +86,18 @@ using namespace Debugger::Constants;
static const QString tooltipIName = "tooltip";
DebuggerSettings::DebuggerSettings()
{
m_autoRun = false;
m_autoQuit = false;
m_skipKnownFrames = false;
m_debugDumpers = false;
m_useToolTips = false;
m_useToolTips = false;
m_useCustomDumpers = true;
}
///////////////////////////////////////////////////////////////////////
//
// BreakByFunctionDialog
......@@ -322,56 +334,6 @@ void DebuggerManager::init()
m_breakAtMainAction = new QAction(this);
m_breakAtMainAction->setText(tr("Set Breakpoint at Function 'main'"));
m_debugDumpersAction = new QAction(this);
m_debugDumpersAction->setText(tr("Debug Custom Dumpers"));
m_debugDumpersAction->setToolTip(tr("This is an internal tool to "
"make debugging the Custom Data Dumper code easier. "
"Using this action is in general not needed unless you "
"want do debug Qt Creator itself."));
m_debugDumpersAction->setCheckable(true);
m_skipKnownFramesAction = new QAction(this);
m_skipKnownFramesAction->setText(tr("Skip Known Frames When Stepping"));
m_skipKnownFramesAction->setToolTip(tr("After checking this option"
"'Step Into' combines in certain situations several steps, "
"leading to 'less noisy' debugging. So will, e.g., the atomic "
"reference counting code be skipped, and a single 'Step Into' "
"for a signal emission will end up directly in the slot connected "
"to it"));
m_skipKnownFramesAction->setCheckable(true);
m_useCustomDumpersAction = new QAction(this);
m_useCustomDumpersAction->setText(tr("Use Custom Display for Qt Objects"));
m_useCustomDumpersAction->setToolTip(tr("Checking this will make the debugger "
"try to use code to format certain data (QObject, QString, ...) nicely. "));
m_useCustomDumpersAction->setCheckable(true);
m_useCustomDumpersAction->setChecked(true);
m_useFastStartAction = new QAction(this);
m_useFastStartAction->setText(tr("Fast Debugger Start"));
m_useFastStartAction->setToolTip(tr("Checking this will make the debugger "
"start fast by loading only very few debug symbols on start up. This "
"might lead to situations where breakpoints can not be set properly. "
"So uncheck this option if you experience breakpoint related problems."));
m_useFastStartAction->setCheckable(true);
m_useFastStartAction->setChecked(true);
m_useToolTipsAction = new QAction(this);
m_useToolTipsAction->setText(tr("Use Tooltips While Debugging"));
m_useToolTipsAction->setToolTip(tr("Checking this will make enable "
"tooltips for variable values during debugging. Since this can slow "
"down debugging and does not provide reliable information as it does "
"not use scope information, it is switched off by default."));
m_useToolTipsAction->setCheckable(true);
m_useToolTipsAction->setChecked(false);
// FIXME
m_useFastStartAction->setChecked(false);
m_useFastStartAction->setEnabled(false);
m_dumpLogAction = new QAction(this);
m_dumpLogAction->setText(tr("Dump Log File for Debugging Purposes"));
m_watchAction = new QAction(this);
m_watchAction->setText(tr("Add to Watch Window"));
......@@ -416,14 +378,6 @@ void DebuggerManager::init()
connect(m_breakAtMainAction, SIGNAL(triggered()),
this, SLOT(breakAtMain()));
connect(m_useFastStartAction, SIGNAL(triggered()),
this, SLOT(saveSessionData()));
connect(m_useCustomDumpersAction, SIGNAL(triggered()),
this, SLOT(saveSessionData()));
connect(m_skipKnownFramesAction, SIGNAL(triggered()),
this, SLOT(saveSessionData()));
connect(m_dumpLogAction, SIGNAL(triggered()),
this, SLOT(dumpLog()));
connect(m_statusTimer, SIGNAL(timeout()),
this, SLOT(clearStatusMessage()));
......@@ -636,9 +590,9 @@ void DebuggerManager::notifyInferiorPidChanged(int pid)
emit inferiorPidChanged(pid);
}
void DebuggerManager::showApplicationOutput(const QString &prefix, const QString &str)
void DebuggerManager::showApplicationOutput(const QString &str)
{
emit applicationOutputAvailable(prefix, str);
emit applicationOutputAvailable(str);
}
void DebuggerManager::shutdown()
......@@ -947,16 +901,6 @@ void DebuggerManager::loadSessionData()
{
m_breakHandler->loadSessionData();
m_watchHandler->loadSessionData();
QVariant value;
querySessionValue(QLatin1String("UseFastStart"), &value);
m_useFastStartAction->setChecked(value.toBool());
querySessionValue(QLatin1String("UseToolTips"), &value);
m_useToolTipsAction->setChecked(value.toBool());
querySessionValue(QLatin1String("UseCustomDumpers"), &value);
m_useCustomDumpersAction->setChecked(!value.isValid() || value.toBool());
querySessionValue(QLatin1String("SkipKnownFrames"), &value);
m_skipKnownFramesAction->setChecked(value.toBool());
engine()->loadSessionData();
}
......@@ -964,15 +908,6 @@ void DebuggerManager::saveSessionData()
{
m_breakHandler->saveSessionData();
m_watchHandler->saveSessionData();
setSessionValue(QLatin1String("UseFastStart"),
m_useFastStartAction->isChecked());
setSessionValue(QLatin1String("UseToolTips"),
m_useToolTipsAction->isChecked());
setSessionValue(QLatin1String("UseCustomDumpers"),
m_useCustomDumpersAction->isChecked());
setSessionValue(QLatin1String("SkipKnownFrames"),
m_skipKnownFramesAction->isChecked());
engine()->saveSessionData();
}
......@@ -1139,22 +1074,22 @@ void DebuggerManager::setBusyCursor(bool busy)
bool DebuggerManager::skipKnownFrames() const
{
return m_skipKnownFramesAction->isChecked();
return m_settings.m_skipKnownFrames;
}
bool DebuggerManager::debugDumpers() const
{
return m_debugDumpersAction->isChecked();
return m_settings.m_debugDumpers;
}
bool DebuggerManager::useCustomDumpers() const
{
return m_useCustomDumpersAction->isChecked();
return m_settings.m_useCustomDumpers;
}
bool DebuggerManager::useFastStart() const
{
return 0; // && m_useFastStartAction->isChecked();
return 0; // && m_settings.m_useFastStart;
}
void DebuggerManager::queryCurrentTextEditor(QString *fileName, int *lineNumber,
......
......@@ -166,9 +166,9 @@ private:
virtual ThreadsHandler *threadsHandler() = 0;
virtual WatchHandler *watchHandler() = 0;
virtual void showApplicationOutput(const QString &prefix, const QString &data) = 0;
virtual QAction *useCustomDumpersAction() const = 0;
virtual QAction *debugDumpersAction() const = 0;
virtual void showApplicationOutput(const QString &data) = 0;
//virtual QAction *useCustomDumpersAction() const = 0;
//virtual QAction *debugDumpersAction() const = 0;
virtual bool skipKnownFrames() const = 0;
virtual bool debugDumpers() const = 0;
virtual bool useCustomDumpers() const = 0;
......@@ -180,6 +180,30 @@ private:
};
//
// DebuggerSettings
//
class DebuggerSettings
{
public:
DebuggerSettings();
public:
QString m_gdbCmd;
QString m_gdbEnv;
bool m_autoRun;
bool m_autoQuit;
bool m_useCustomDumpers;
bool m_skipKnownFrames;
bool m_debugDumpers;
bool m_useFastStart;
bool m_useToolTips;
QString m_scriptFile;
};
//
// DebuggerManager
//
......@@ -196,6 +220,7 @@ public:
IDebuggerManagerAccessForEngines *engineInterface();
QMainWindow *mainWindow() const { return m_mainWindow; }
QLabel *statusLabel() const { return m_statusLabel; }
DebuggerSettings *settings() { return &m_settings; }
enum StartMode { startInternal, startExternal, attachExternal };
enum DebuggerType { GdbDebugger, ScriptDebugger, WinDebugger };
......@@ -260,7 +285,7 @@ public slots:
private slots:
void showDebuggerOutput(const QString &prefix, const QString &msg);
void showDebuggerInput(const QString &prefix, const QString &msg);
void showApplicationOutput(const QString &prefix, const QString &msg);
void showApplicationOutput(const QString &data);
void reloadDisassembler();
void disassemblerDockToggled(bool on);
......@@ -286,9 +311,9 @@ private:
StackHandler *stackHandler() { return m_stackHandler; }
ThreadsHandler *threadsHandler() { return m_threadsHandler; }
WatchHandler *watchHandler() { return m_watchHandler; }
QAction *useCustomDumpersAction() const { return m_useCustomDumpersAction; }
QAction *useToolTipsAction() const { return m_useToolTipsAction; }
QAction *debugDumpersAction() const { return m_debugDumpersAction; }
//QAction *useCustomDumpersAction() const { return m_useCustomDumpersAction; }
//QAction *useToolTipsAction() const { return m_useToolTipsAction; }
//QAction *debugDumpersAction() const { return m_debugDumpersAction; }
bool skipKnownFrames() const;
bool debugDumpers() const;
bool useCustomDumpers() const;
......@@ -340,8 +365,7 @@ signals:
void setSessionValueRequested(const QString &name, const QVariant &value);
void configValueRequested(const QString &name, QVariant *value);
void setConfigValueRequested(const QString &name, const QVariant &value);
void applicationOutputAvailable(const QString &prefix, const QString &msg);
void applicationOutputAvailable(const QString &output);
public:
// FIXME: make private
......@@ -406,13 +430,6 @@ private:
QAction *m_sepAction;
QAction *m_stepIAction;
QAction *m_nextIAction;
QAction *m_skipKnownFramesAction;
QAction *m_debugDumpersAction;
QAction *m_useCustomDumpersAction;
QAction *m_useFastStartAction;
QAction *m_useToolTipsAction;
QAction *m_dumpLogAction;
QWidget *m_breakWindow;
QWidget *m_disassemblerWindow;
......@@ -432,9 +449,9 @@ private:
IDebuggerEngine *engine();
IDebuggerEngine *m_engine;
DebuggerSettings m_settings;
};
} // namespace Internal
} // namespace Debugger
......
......@@ -36,12 +36,14 @@
#include "debuggerconstants.h"
#include "debuggermanager.h"
#include "debuggerrunner.h"
#include "gdboptionpage.h"
#include "gdbengine.h"
#include "ui_gdboptionpage.h"
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/basemode.h>
#include <coreplugin/coreconstants.h>
#include <coreplugin/dialogs/ioptionspage.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/findplaceholder.h>
#include <coreplugin/icore.h>
......@@ -53,6 +55,8 @@
#include <coreplugin/rightpane.h>
#include <coreplugin/uniqueidmanager.h>
#include <extensionsystem/pluginmanager.h>
#include <cplusplus/ExpressionUnderCursor.h>
#include <cppeditor/cppeditorconstants.h>
......@@ -73,6 +77,7 @@
#include <QtCore/QSettings>
#include <QtCore/QtPlugin>
#include <QtGui/QLineEdit>
#include <QtGui/QDockWidget>
#include <QtGui/QMainWindow>
#include <QtGui/QPlainTextEdit>
......@@ -80,6 +85,8 @@
#include <QtGui/QTextCursor>
namespace ExtensionSystem { class PluginManager; }
using namespace Core;
using namespace Debugger::Constants;
using namespace Debugger::Internal;
......@@ -99,13 +106,7 @@ const char * const JUMP_TO_LINE = "Debugger.JumpToLine";
const char * const TOGGLE_BREAK = "Debugger.ToggleBreak";
const char * const BREAK_BY_FUNCTION = "Debugger.BreakByFunction";
const char * const BREAK_AT_MAIN = "Debugger.BreakAtMain";
const char * const DEBUG_DUMPERS = "Debugger.DebugDumpers";
const char * const ADD_TO_WATCH = "Debugger.AddToWatch";
const char * const USE_CUSTOM_DUMPERS = "Debugger.UseCustomDumpers";
const char * const USE_FAST_START = "Debugger.UseFastStart";
const char * const USE_TOOL_TIPS = "Debugger.UseToolTips";
const char * const SKIP_KNOWN_FRAMES = "Debugger.SkipKnownFrames";
const char * const DUMP_LOG = "Debugger.DumpLog";
#ifdef Q_OS_MAC
const char * const INTERRUPT_KEY = "Shift+F5";
......@@ -143,6 +144,12 @@ const char * const ADD_TO_WATCH_KEY = "Ctrl+Alt+Q";
} // namespace Debugger
///////////////////////////////////////////////////////////////////////
//
// DebugMode
//
///////////////////////////////////////////////////////////////////////
namespace Debugger {
namespace Internal {
......@@ -159,9 +166,6 @@ public:
void shutdown() {}
};
} // namespace Internal
} // namespace Debugger
DebugMode::DebugMode(QObject *parent)
: BaseMode(parent)
{
......@@ -177,6 +181,9 @@ DebugMode::~DebugMode()
EditorManager::instance()->setParent(0);
}
} // namespace Internal
} // namespace Debugger
///////////////////////////////////////////////////////////////////////
//
......@@ -184,8 +191,10 @@ DebugMode::~DebugMode()
//
///////////////////////////////////////////////////////////////////////
class Debugger::Internal::LocationMark
: public TextEditor::BaseTextMark
namespace Debugger {
namespace Internal {
class LocationMark : public TextEditor::BaseTextMark
{
Q_OBJECT
......@@ -212,6 +221,108 @@ QIcon LocationMark::icon() const
return icon;
}
} // namespace Internal
} // namespace Debugger
///////////////////////////////////////////////////////////////////////
//
// GdbOptionPage
//
///////////////////////////////////////////////////////////////////////
namespace Debugger {
namespace Internal {
class GdbOptionPage : public Core::IOptionsPage
{
Q_OBJECT
public:
GdbOptionPage(DebuggerPlugin *plugin) : m_plugin(plugin) {}
// IOptionsPage
QString name() const { return tr("Gdb"); }
QString category() const { return "Debugger"; }
QString trCategory() const { return tr("Debugger"); }
QWidget *createPage(QWidget *parent);
void apply();
void finish() {} // automatically calls "apply"
private:
Ui::GdbOptionPage m_ui;
DebuggerSettings m_settings;
DebuggerPlugin *m_plugin;
};
QWidget *GdbOptionPage::createPage(QWidget *parent)
{
QWidget *w = new QWidget(parent);
m_settings = *m_plugin->m_manager->settings();
m_ui.setupUi(w);
m_ui.gdbLocationChooser->setExpectedKind(Core::Utils::PathChooser::Command);
m_ui.gdbLocationChooser->setPromptDialogTitle(tr("Choose Gdb Location"));
m_ui.gdbLocationChooser->setPath(m_settings.m_gdbCmd);
m_ui.scriptFileChooser->setExpectedKind(Core::Utils::PathChooser::File);
m_ui.scriptFileChooser->setPromptDialogTitle(tr("Choose Location of Startup Script File"));
m_ui.scriptFileChooser->setPath(m_settings.m_scriptFile);
m_ui.environmentEdit->setText(m_settings.m_gdbEnv);
m_ui.autoStartBox->setChecked(m_settings.m_autoRun);
m_ui.autoQuitBox->setChecked(m_settings.m_autoQuit);
m_ui.checkBoxSkipKnownFrames->setChecked(m_settings.m_skipKnownFrames);
m_ui.checkBoxDebugDumpers->setChecked(m_settings.m_debugDumpers);
m_ui.checkBoxUseCustomDumpers->setChecked(m_settings.m_useCustomDumpers);
m_ui.checkBoxFastStart->setChecked(m_settings.m_useFastStart);