forked from qt-creator/qt-creator
Debugger: Split Expressions view into dock of its own
Change-Id: Ie86a5bd72c3140219f925835a065d9f6a3ae0ea4 Task-number: QTCREATORBUG-19167 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -639,8 +639,9 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
If the address is displayed in the \uicontrol {Locals and Expressions} view,
|
If the address is displayed in the \uicontrol {Locals} or
|
||||||
you can select \uicontrol {Add Data Breakpoint at Object's Address} in the
|
\uicontrol {Expressions} view, you can select
|
||||||
|
\uicontrol {Add Data Breakpoint at Object's Address} in the
|
||||||
context menu to set the data breakpoint.
|
context menu to set the data breakpoint.
|
||||||
|
|
||||||
Data breakpoints will be disabled when the debugged program exits, as it
|
Data breakpoints will be disabled when the debugged program exits, as it
|
||||||
@@ -665,8 +666,8 @@
|
|||||||
corresponding source locations are grayed out in the \uicontrol Stack view.
|
corresponding source locations are grayed out in the \uicontrol Stack view.
|
||||||
|
|
||||||
If you click a frame with a known source location, the text editor jumps to
|
If you click a frame with a known source location, the text editor jumps to
|
||||||
the corresponding location and updates the
|
the corresponding location and updates the \uicontrol {Locals} and
|
||||||
\uicontrol {Locals and Expressions} view, making it seem like the program
|
\uicontrol {Expressions} views, making it seem like the program
|
||||||
was interrupted before entering the function.
|
was interrupted before entering the function.
|
||||||
|
|
||||||
To find out which QML file is causing a Qt Quick 2 application to crash,
|
To find out which QML file is causing a Qt Quick 2 application to crash,
|
||||||
@@ -676,28 +677,29 @@
|
|||||||
should it find any. You can click a frame in the QML stack to open the QML
|
should it find any. You can click a frame in the QML stack to open the QML
|
||||||
file in the editor.
|
file in the editor.
|
||||||
|
|
||||||
\section1 Locals and Expressions
|
\section1 Local Variables and Function Parameters
|
||||||
|
|
||||||
The Locals and Expressions view consists of three parts: the
|
The Locals view consists of two parts: the \uicontrol Locals pane at the top
|
||||||
\uicontrol Locals pane at the top, the \uicontrol {Return Value} pane in
|
and the \uicontrol {Return Value} pane at the bottom. The
|
||||||
the middle, and the \uicontrol Expressions pane at the bottom. The
|
\uicontrol {Return Value} is only visible if it is not empty.
|
||||||
\uicontrol {Return Value} and \uicontrol Expression panes are only visible
|
|
||||||
if they are not empty.
|
|
||||||
|
|
||||||
\image qtcreator-locals-expressions.png "Locals and Expressions view"
|
\image qtcreator-locals-expressions.png "Locals view"
|
||||||
|
|
||||||
Whenever a program stops under the control of the debugger, it retrieves
|
Whenever a program stops under the control of the debugger, it retrieves
|
||||||
information about the topmost stack frame and displays it in the
|
information about the topmost stack frame and displays it in the
|
||||||
\uicontrol {Locals and Expressions} view. The \uicontrol Locals pane shows
|
\uicontrol {Locals} view. The \uicontrol Locals pane shows
|
||||||
information about parameters of the function in that frame as well as the
|
information about parameters of the function in that frame as well as the
|
||||||
local variables. If the last operation in the debugger was returning from a
|
local variables. If the last operation in the debugger was returning from a
|
||||||
function after pressing \key {Shift+F11}, the \uicontrol {Return Value}
|
function after pressing \key {Shift+F11}, the \uicontrol {Return Value}
|
||||||
pane displays the value returned by the function.
|
pane displays the value returned by the function.
|
||||||
|
|
||||||
|
|
||||||
|
\section1 Evaluating Expresssion
|
||||||
|
|
||||||
To compute values of arithmetic expressions or function calls, use
|
To compute values of arithmetic expressions or function calls, use
|
||||||
expression evaluators in the \uicontrol Expressions pane. To insert a new
|
expression evaluators in the \uicontrol Expressions view. To insert a new
|
||||||
expression evaluator, either double-click on an empty part of the
|
expression evaluator, either double-click on an empty part of the
|
||||||
\uicontrol {Locals and Expressions} view, or select
|
\uicontrol {Expressions} or \uicontrol {Locals} view, or select
|
||||||
\uicontrol {Add New Expression Evaluator} from the context menu, or drag and
|
\uicontrol {Add New Expression Evaluator} from the context menu, or drag and
|
||||||
drop an expression from the code editor.
|
drop an expression from the code editor.
|
||||||
|
|
||||||
@@ -734,8 +736,8 @@
|
|||||||
\li GDB and LLDB, and therefore \QC's debugger, also work for optimized
|
\li GDB and LLDB, and therefore \QC's debugger, also work for optimized
|
||||||
builds on Linux and \macos. Optimization can lead to re-ordering
|
builds on Linux and \macos. Optimization can lead to re-ordering
|
||||||
of instructions or removal of some local variables, causing the
|
of instructions or removal of some local variables, causing the
|
||||||
\uicontrol {Locals and Expressions} view to show unexpected
|
\uicontrol {Locals} and \uicontrol {Expressions} view to show
|
||||||
data.
|
unexpected data.
|
||||||
\row
|
\row
|
||||||
\li The debug information provided by GCC does not include enough
|
\li The debug information provided by GCC does not include enough
|
||||||
information about the time when a variable is initialized.
|
information about the time when a variable is initialized.
|
||||||
@@ -747,8 +749,8 @@
|
|||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
|
||||||
The \uicontrol {Locals and Expressions} view also provides access to the
|
The \uicontrol {Locals} and \uicontrol {Expressions} views also provide access
|
||||||
most powerful feature of the debugger: comprehensive display of data
|
to the most powerful feature of the debugger: comprehensive display of data
|
||||||
belonging to Qt's basic objects. For example, in case of QObject, instead of
|
belonging to Qt's basic objects. For example, in case of QObject, instead of
|
||||||
displaying a pointer to some private data structure, you see a list of
|
displaying a pointer to some private data structure, you see a list of
|
||||||
children, signals and slots.
|
children, signals and slots.
|
||||||
@@ -758,8 +760,8 @@
|
|||||||
debugger displays access data for QFileInfo and provides access to the
|
debugger displays access data for QFileInfo and provides access to the
|
||||||
"real" contents of QVariant.
|
"real" contents of QVariant.
|
||||||
|
|
||||||
Right-click in the \uicontrol {Locals and Expressions} view to open a
|
Right-click in the \uicontrol {Locals} or the \uicontrol {Expressions} view
|
||||||
context menu that provides additional options for viewing data. The
|
to open a context menu that provides additional options for viewing data. The
|
||||||
available options depend on the type of the current items, and are provided
|
available options depend on the type of the current items, and are provided
|
||||||
by the \l{Using Debugging Helpers}{Debugging Helpers}. Typically,
|
by the \l{Using Debugging Helpers}{Debugging Helpers}. Typically,
|
||||||
string-like data, such as \c{QByteArray} and \c{std::string}, offer a
|
string-like data, such as \c{QByteArray} and \c{std::string}, offer a
|
||||||
@@ -770,8 +772,8 @@
|
|||||||
example, to expand all the values of QMap, select
|
example, to expand all the values of QMap, select
|
||||||
\uicontrol {Change Value Display Format} > \uicontrol Compact.
|
\uicontrol {Change Value Display Format} > \uicontrol Compact.
|
||||||
|
|
||||||
You can use the \uicontrol {Locals and Expressions} view to change the
|
You can use the \uicontrol {Locals} and \uicontrol {Expressions} view to change
|
||||||
contents of variables of simple data types, for example, \c int, \c float,
|
the contents of variables of simple data types, for example, \c int, \c float,
|
||||||
\c QString and \c std::string when the program is interrupted. To do so,
|
\c QString and \c std::string when the program is interrupted. To do so,
|
||||||
click the \uicontrol Value column, modify the value with the inplace editor,
|
click the \uicontrol Value column, modify the value with the inplace editor,
|
||||||
and press \key Enter (or \key Return).
|
and press \key Enter (or \key Return).
|
||||||
@@ -798,7 +800,7 @@
|
|||||||
\note Usually, you do not need this feature, because \QC provides you
|
\note Usually, you do not need this feature, because \QC provides you
|
||||||
with better ways to handle the task. For example, instead of using the GDB
|
with better ways to handle the task. For example, instead of using the GDB
|
||||||
\c print command from the command line, you can evaluate an expression in
|
\c print command from the command line, you can evaluate an expression in
|
||||||
the \uicontrol {Locals and Expressions} view.
|
the \uicontrol {Expressions} view.
|
||||||
|
|
||||||
\section1 Debugging C++ Based Applications
|
\section1 Debugging C++ Based Applications
|
||||||
|
|
||||||
@@ -932,8 +934,8 @@
|
|||||||
|
|
||||||
\title Using Debugging Helpers
|
\title Using Debugging Helpers
|
||||||
|
|
||||||
Structured data, such as objects of \c class, \c struct, or \c union
|
Structured data, such as objects of \c class, \c struct, or \c union types,
|
||||||
types, is displayed in the \uicontrol {Locals and Expressions} view as part
|
is displayed in the \uicontrol {Locals} and \uicontrol {Expressions} views as part
|
||||||
of a tree. To access sub-structures of the objects, expand the tree nodes.
|
of a tree. To access sub-structures of the objects, expand the tree nodes.
|
||||||
The sub-structures are presented in their in-memory order, unless the
|
The sub-structures are presented in their in-memory order, unless the
|
||||||
\uicontrol {Sort Members of Classes and Structs Alphabetically} option
|
\uicontrol {Sort Members of Classes and Structs Alphabetically} option
|
||||||
@@ -970,8 +972,8 @@
|
|||||||
|
|
||||||
\QC uses Python scripts to translate raw memory contents and type information
|
\QC uses Python scripts to translate raw memory contents and type information
|
||||||
data from native debugger backends (GDB, LLDB, and CDB are currently supported)
|
data from native debugger backends (GDB, LLDB, and CDB are currently supported)
|
||||||
into the form presented to the user in the \uicontrol {Locals and Expressions}
|
into the form presented to the user in the \uicontrol {Locals} and
|
||||||
view.
|
\uicontrol {Expressions} views.
|
||||||
|
|
||||||
Unlike GDB's
|
Unlike GDB's
|
||||||
\l{https://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing.html#Pretty-Printing}
|
\l{https://sourceware.org/gdb/onlinedocs/gdb/Pretty-Printing.html#Pretty-Printing}
|
||||||
|
|||||||
@@ -149,7 +149,10 @@
|
|||||||
|
|
||||||
\li \l{Viewing Call Stack Trace}{Viewing call stack trace}
|
\li \l{Viewing Call Stack Trace}{Viewing call stack trace}
|
||||||
|
|
||||||
\li \l{Locals and Expressions}{Viewing locals and expressions}
|
\li \l{Local Variables and Function Parameters}
|
||||||
|
{Viewing local variables and function parameters}
|
||||||
|
|
||||||
|
\li \l{Evaluating Expressions}{Evaluating expressions at run time}
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -167,21 +170,21 @@
|
|||||||
\section1 Applying QML Changes at Runtime
|
\section1 Applying QML Changes at Runtime
|
||||||
|
|
||||||
When you change property values in the \uicontrol {Debugger Console} or in the
|
When you change property values in the \uicontrol {Debugger Console} or in the
|
||||||
\uicontrol {Locals and Expressions} view, they are immediately updated in the running
|
\uicontrol {Locals} or \uicontrol {Expression} view, they are immediately updated
|
||||||
application, but not in the source code.
|
in the running application, but not in the source code.
|
||||||
|
|
||||||
\section1 Inspecting Items
|
\section1 Inspecting Items
|
||||||
|
|
||||||
While the application is running, you can use the
|
While the application is running, you can use the \uicontrol {Locals}
|
||||||
\uicontrol {Locals and Expressions} view to explore the QML item structure.
|
and \uicontrol{Expressions} views to explore the QML item structure.
|
||||||
|
|
||||||
\image qml-observer-view.png "QML item tree"
|
\image qml-observer-view.png "QML item tree"
|
||||||
|
|
||||||
To keep the application visible while you interact with the debugger, select
|
To keep the application visible while you interact with the debugger, select
|
||||||
\uicontrol Debug > \uicontrol {Show Application on Top}.
|
\uicontrol Debug > \uicontrol {Show Application on Top}.
|
||||||
|
|
||||||
You can view a QML item in \uicontrol {Locals and Expressions} in the following
|
You can view a QML item in \uicontrol {Locals} and \uicontrol {Expressions}
|
||||||
ways:
|
in the following ways:
|
||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
@@ -205,7 +208,7 @@
|
|||||||
|
|
||||||
In the selection mode, you can click items in the running
|
In the selection mode, you can click items in the running
|
||||||
application to jump to their definitions in the code. The properties of the
|
application to jump to their definitions in the code. The properties of the
|
||||||
selected item are displayed in the \uicontrol {Locals and Expressions} view.
|
selected item are displayed in the \uicontrol {Locals} view.
|
||||||
|
|
||||||
The \uicontrol Select tool will be enabled either if your application is
|
The \uicontrol Select tool will be enabled either if your application is
|
||||||
using Qt 5.7 or later, or if your application is using an earlier version
|
using Qt 5.7 or later, or if your application is using an earlier version
|
||||||
|
|||||||
@@ -168,15 +168,14 @@
|
|||||||
If an instance of a class is derived from QObject, and you would like to
|
If an instance of a class is derived from QObject, and you would like to
|
||||||
find all other objects connected to one of your object's slots using
|
find all other objects connected to one of your object's slots using
|
||||||
Qt's signals and slots mechanism, select \uicontrol Tools > \uicontrol Options
|
Qt's signals and slots mechanism, select \uicontrol Tools > \uicontrol Options
|
||||||
> \uicontrol{Debugger} > \uicontrol{Locals and Expressions} >
|
> \uicontrol{Debugger} > \uicontrol{Locals} > \uicontrol{Use Debugging Helper}.
|
||||||
\uicontrol{Use Debugging Helper}.
|
|
||||||
|
|
||||||
In the \uicontrol{Locals and Expressions} view, expand the object's entry and open
|
In the \uicontrol{Locals} view, expand the object's entry and open
|
||||||
the slot in the \e slots subitem. The objects connected to this slot are
|
the slot in the \e slots subitem. The objects connected to this slot are
|
||||||
shown as children of the slot. This method works with signals too.
|
shown as children of the slot. This method works with signals too.
|
||||||
|
|
||||||
For more information about the \uicontrol{Locals and Expressions} view, see
|
For more information about the \uicontrol{Locals} view, see
|
||||||
\l{Locals and Expressions}.
|
\l{Local Variables and Function Parameters}.
|
||||||
|
|
||||||
\section1 Displaying Low Level Data
|
\section1 Displaying Low Level Data
|
||||||
|
|
||||||
@@ -188,7 +187,7 @@
|
|||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Debugger >
|
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Debugger >
|
||||||
\uicontrol{Locals and Expressions}.
|
\uicontrol{Locals}.
|
||||||
|
|
||||||
\li Uncheck the \uicontrol{Use Debugging Helper} checkbox.
|
\li Uncheck the \uicontrol{Use Debugging Helper} checkbox.
|
||||||
|
|
||||||
@@ -216,8 +215,8 @@
|
|||||||
\image qtcreator-pin-tooltip.png
|
\image qtcreator-pin-tooltip.png
|
||||||
|
|
||||||
Pinned tooltips are stored in the session. To close all pinned tooltips,
|
Pinned tooltips are stored in the session. To close all pinned tooltips,
|
||||||
select \uicontrol {Close Editor Tooltips} in the context menu in the \uicontrol {Locals
|
select \uicontrol {Close Editor Tooltips} in the context menu in the
|
||||||
and Expressions} view.
|
\uicontrol {Locals} view.
|
||||||
|
|
||||||
\section1 Locating Files
|
\section1 Locating Files
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,6 @@
|
|||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
class QIcon;
|
|
||||||
class QMessageBox;
|
class QMessageBox;
|
||||||
class QWidget;
|
class QWidget;
|
||||||
class QMenu;
|
class QMenu;
|
||||||
@@ -67,7 +66,7 @@ enum TestCases
|
|||||||
|
|
||||||
// Some convenience.
|
// Some convenience.
|
||||||
void updateState(DebuggerRunTool *runTool);
|
void updateState(DebuggerRunTool *runTool);
|
||||||
void updateWatchersWindow(bool showWatch, bool showReturn);
|
void updateLocalsWindow(bool showReturn);
|
||||||
const CPlusPlus::Snapshot &cppCodeModelSnapshot();
|
const CPlusPlus::Snapshot &cppCodeModelSnapshot();
|
||||||
bool hasSnapshots();
|
bool hasSnapshots();
|
||||||
void openTextEditor(const QString &titlePattern, const QString &contents);
|
void openTextEditor(const QString &titlePattern, const QString &contents);
|
||||||
@@ -83,6 +82,7 @@ void synchronizeBreakpoints();
|
|||||||
|
|
||||||
void saveModeToRestore();
|
void saveModeToRestore();
|
||||||
QWidget *mainWindow();
|
QWidget *mainWindow();
|
||||||
|
void raiseWatchersWindow();
|
||||||
bool isRegistersWindowVisible();
|
bool isRegistersWindowVisible();
|
||||||
bool isModulesWindowVisible();
|
bool isModulesWindowVisible();
|
||||||
void showModuleSymbols(const QString &moduleName, const QVector<Internal::Symbol> &symbols);
|
void showModuleSymbols(const QString &moduleName, const QVector<Internal::Symbol> &symbols);
|
||||||
|
|||||||
@@ -39,7 +39,8 @@ const char DOCKWIDGET_SNAPSHOTS[] = "Debugger.Docks.Snapshots";
|
|||||||
const char DOCKWIDGET_STACK[] = "Debugger.Docks.Stack";
|
const char DOCKWIDGET_STACK[] = "Debugger.Docks.Stack";
|
||||||
const char DOCKWIDGET_SOURCE_FILES[] = "Debugger.Docks.SourceFiles";
|
const char DOCKWIDGET_SOURCE_FILES[] = "Debugger.Docks.SourceFiles";
|
||||||
const char DOCKWIDGET_THREADS[] = "Debugger.Docks.Threads";
|
const char DOCKWIDGET_THREADS[] = "Debugger.Docks.Threads";
|
||||||
const char DOCKWIDGET_WATCHERS[] = "Debugger.Docks.LocalsAndWatchers";
|
const char DOCKWIDGET_LOCALS_AND_INSPECTOR[] = "Debugger.Docks.LocalsAndInspector";
|
||||||
|
const char DOCKWIDGET_WATCHERS[] = "Debugger.Docks.Watchers";
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|
||||||
|
|||||||
@@ -51,6 +51,7 @@
|
|||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
#include <QTimer>
|
||||||
#include <QToolButton>
|
#include <QToolButton>
|
||||||
|
|
||||||
using namespace Debugger;
|
using namespace Debugger;
|
||||||
@@ -127,6 +128,16 @@ QDockWidget *DebuggerMainWindow::dockWidget(const QByteArray &dockId) const
|
|||||||
return m_dockForDockId.value(dockId);
|
return m_dockForDockId.value(dockId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DebuggerMainWindow::raiseDock(const QByteArray &dockId)
|
||||||
|
{
|
||||||
|
QDockWidget *dock = m_dockForDockId.value(dockId);
|
||||||
|
QTC_ASSERT(dock, return);
|
||||||
|
QAction *act = dock->toggleViewAction();
|
||||||
|
if (!act->isChecked())
|
||||||
|
QTimer::singleShot(1, act, [act, dock] { act->trigger(); });
|
||||||
|
dock->raise();
|
||||||
|
}
|
||||||
|
|
||||||
void DebuggerMainWindow::onModeChanged(Core::Id mode)
|
void DebuggerMainWindow::onModeChanged(Core::Id mode)
|
||||||
{
|
{
|
||||||
if (mode == Debugger::Constants::MODE_DEBUG) {
|
if (mode == Debugger::Constants::MODE_DEBUG) {
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ public:
|
|||||||
|
|
||||||
void showStatusMessage(const QString &message, int timeoutMS);
|
void showStatusMessage(const QString &message, int timeoutMS);
|
||||||
QDockWidget *dockWidget(const QByteArray &dockId) const;
|
QDockWidget *dockWidget(const QByteArray &dockId) const;
|
||||||
|
void raiseDock(const QByteArray &dockId);
|
||||||
QByteArray currentPerspective() const { return m_currentPerspectiveId; }
|
QByteArray currentPerspective() const { return m_currentPerspectiveId; }
|
||||||
QStackedWidget *centralWidgetStack() const { return m_centralWidgetStack; }
|
QStackedWidget *centralWidgetStack() const { return m_centralWidgetStack; }
|
||||||
|
|
||||||
|
|||||||
@@ -695,12 +695,10 @@ public:
|
|||||||
toggleBreakpoint(data, message);
|
toggleBreakpoint(data, message);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateWatchersHeader(int section, int, int newSize)
|
void updateReturnViewHeader(int section, int, int newSize)
|
||||||
{
|
{
|
||||||
if (m_shuttingDown)
|
if (m_shuttingDown)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_watchersView->header()->resizeSection(section, newSize);
|
|
||||||
m_returnView->header()->resizeSection(section, newSize);
|
m_returnView->header()->resizeSection(section, newSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1036,7 +1034,7 @@ public:
|
|||||||
QWidget *m_stackWindow = 0;
|
QWidget *m_stackWindow = 0;
|
||||||
QWidget *m_threadsWindow = 0;
|
QWidget *m_threadsWindow = 0;
|
||||||
LogWindow *m_logWindow = 0;
|
LogWindow *m_logWindow = 0;
|
||||||
LocalsAndExpressionsWindow *m_localsAndExpressionsWindow = 0;
|
LocalsAndInspectorWindow *m_localsAndInspectorWindow = 0;
|
||||||
|
|
||||||
bool m_busy;
|
bool m_busy;
|
||||||
QString m_lastPermanentStatusMessage;
|
QString m_lastPermanentStatusMessage;
|
||||||
@@ -1369,18 +1367,19 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
|
|||||||
m_threadsWindow = addSearch(m_threadsView, tr("&Threads"), DOCKWIDGET_THREADS);
|
m_threadsWindow = addSearch(m_threadsView, tr("&Threads"), DOCKWIDGET_THREADS);
|
||||||
|
|
||||||
m_returnView = new WatchTreeView(ReturnType); // No settings.
|
m_returnView = new WatchTreeView(ReturnType); // No settings.
|
||||||
m_returnWindow = addSearch(m_returnView, tr("Locals and &Expressions"), "CppDebugReturn");
|
m_returnWindow = addSearch(m_returnView, tr("Locals"), "CppDebugReturn");
|
||||||
|
|
||||||
m_localsView = new WatchTreeView(LocalsType);
|
m_localsView = new WatchTreeView(LocalsType);
|
||||||
m_localsView->setSettings(settings, "Debugger.LocalsView");
|
m_localsView->setSettings(settings, "Debugger.LocalsView");
|
||||||
m_localsWindow = addSearch(m_localsView, tr("Locals and &Expressions"), "CppDebugLocals");
|
m_localsWindow = addSearch(m_localsView, tr("Locals"), "CppDebugLocals");
|
||||||
|
|
||||||
m_watchersView = new WatchTreeView(WatchersType); // No settings.
|
m_inspectorView = new WatchTreeView(InspectType); // No settings.
|
||||||
m_watchersWindow = addSearch(m_watchersView, tr("Locals and &Expressions"), "CppDebugWatchers");
|
|
||||||
|
|
||||||
m_inspectorView = new WatchTreeView(InspectType);
|
|
||||||
m_inspectorView->setSettings(settings, "Debugger.LocalsView"); // sic! same as locals view.
|
m_inspectorView->setSettings(settings, "Debugger.LocalsView"); // sic! same as locals view.
|
||||||
m_inspectorWindow = addSearch(m_inspectorView, tr("Locals and &Expressions"), "Inspector");
|
m_inspectorWindow = addSearch(m_inspectorView, tr("Locals"), "Inspector");
|
||||||
|
|
||||||
|
m_watchersView = new WatchTreeView(WatchersType);
|
||||||
|
m_watchersView->setSettings(settings, "Debugger.WatchersView");
|
||||||
|
m_watchersWindow = addSearch(m_watchersView, tr("&Expressions"), "CppDebugWatchers");
|
||||||
|
|
||||||
// Snapshot
|
// Snapshot
|
||||||
m_snapshotHandler = new SnapshotHandler;
|
m_snapshotHandler = new SnapshotHandler;
|
||||||
@@ -1390,9 +1389,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
|
|||||||
m_snapshotView->setModel(m_snapshotHandler->model());
|
m_snapshotView->setModel(m_snapshotHandler->model());
|
||||||
m_snapshotWindow = addSearch(m_snapshotView, tr("Snapshots"), DOCKWIDGET_SNAPSHOTS);
|
m_snapshotWindow = addSearch(m_snapshotView, tr("Snapshots"), DOCKWIDGET_SNAPSHOTS);
|
||||||
|
|
||||||
// Watchers
|
// Locals
|
||||||
connect(m_localsView->header(), &QHeaderView::sectionResized,
|
connect(m_localsView->header(), &QHeaderView::sectionResized,
|
||||||
this, &DebuggerPluginPrivate::updateWatchersHeader, Qt::QueuedConnection);
|
this, &DebuggerPluginPrivate::updateReturnViewHeader, Qt::QueuedConnection);
|
||||||
|
|
||||||
auto act = m_continueAction = new QAction(tr("Continue"), this);
|
auto act = m_continueAction = new QAction(tr("Continue"), this);
|
||||||
act->setIcon(visibleStartIcon(Id(Constants::CONTINUE), false));
|
act->setIcon(visibleStartIcon(Id(Constants::CONTINUE), false));
|
||||||
@@ -1474,10 +1473,10 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
|
|||||||
|
|
||||||
ActionContainer *debugMenu = ActionManager::actionContainer(PE::M_DEBUG);
|
ActionContainer *debugMenu = ActionManager::actionContainer(PE::M_DEBUG);
|
||||||
|
|
||||||
m_localsAndExpressionsWindow = new LocalsAndExpressionsWindow(
|
m_localsAndInspectorWindow = new LocalsAndInspectorWindow(
|
||||||
m_localsWindow, m_inspectorWindow, m_returnWindow, m_watchersWindow);
|
m_localsWindow, m_inspectorWindow, m_returnWindow);
|
||||||
m_localsAndExpressionsWindow->setObjectName(QLatin1String(DOCKWIDGET_WATCHERS));
|
m_localsAndInspectorWindow->setObjectName(DOCKWIDGET_LOCALS_AND_INSPECTOR);
|
||||||
m_localsAndExpressionsWindow->setWindowTitle(m_localsWindow->windowTitle());
|
m_localsAndInspectorWindow->setWindowTitle(m_localsWindow->windowTitle());
|
||||||
|
|
||||||
RunConfiguration::registerAspect<DebuggerRunConfigurationAspect>();
|
RunConfiguration::registerAspect<DebuggerRunConfigurationAspect>();
|
||||||
|
|
||||||
@@ -1830,7 +1829,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
|
|||||||
{DOCKWIDGET_MODULES, m_modulesWindow, DOCKWIDGET_THREADS, Perspective::AddToTab, false},
|
{DOCKWIDGET_MODULES, m_modulesWindow, DOCKWIDGET_THREADS, Perspective::AddToTab, false},
|
||||||
{DOCKWIDGET_SOURCE_FILES, m_sourceFilesWindow, DOCKWIDGET_MODULES, Perspective::AddToTab, false},
|
{DOCKWIDGET_SOURCE_FILES, m_sourceFilesWindow, DOCKWIDGET_MODULES, Perspective::AddToTab, false},
|
||||||
{DOCKWIDGET_SNAPSHOTS, m_snapshotWindow, DOCKWIDGET_SOURCE_FILES, Perspective::AddToTab, false},
|
{DOCKWIDGET_SNAPSHOTS, m_snapshotWindow, DOCKWIDGET_SOURCE_FILES, Perspective::AddToTab, false},
|
||||||
{DOCKWIDGET_WATCHERS, m_localsAndExpressionsWindow, {}, Perspective::AddToTab, true,
|
{DOCKWIDGET_LOCALS_AND_INSPECTOR, m_localsAndInspectorWindow, {}, Perspective::AddToTab, true,
|
||||||
|
Qt::RightDockWidgetArea},
|
||||||
|
{DOCKWIDGET_WATCHERS, m_watchersWindow, DOCKWIDGET_LOCALS_AND_INSPECTOR, Perspective::AddToTab, true,
|
||||||
Qt::RightDockWidgetArea},
|
Qt::RightDockWidgetArea},
|
||||||
{DOCKWIDGET_OUTPUT, m_logWindow, {}, Perspective::AddToTab, false, Qt::TopDockWidgetArea},
|
{DOCKWIDGET_OUTPUT, m_logWindow, {}, Perspective::AddToTab, false, Qt::TopDockWidgetArea},
|
||||||
{DOCKWIDGET_BREAK, 0, {}, Perspective::Raise}
|
{DOCKWIDGET_BREAK, 0, {}, Perspective::Raise}
|
||||||
@@ -1865,7 +1866,6 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
|
|||||||
m_plugin->addAutoReleasedObject(m_commonOptionsPage);
|
m_plugin->addAutoReleasedObject(m_commonOptionsPage);
|
||||||
|
|
||||||
m_globalDebuggerOptions->fromSettings();
|
m_globalDebuggerOptions->fromSettings();
|
||||||
m_watchersWindow->setVisible(false);
|
|
||||||
m_returnWindow->setVisible(false);
|
m_returnWindow->setVisible(false);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -2491,7 +2491,6 @@ void DebuggerPluginPrivate::setBusyCursor(bool busy)
|
|||||||
|
|
||||||
void DebuggerPluginPrivate::setInitialState()
|
void DebuggerPluginPrivate::setInitialState()
|
||||||
{
|
{
|
||||||
m_watchersWindow->setVisible(false);
|
|
||||||
m_returnWindow->setVisible(false);
|
m_returnWindow->setVisible(false);
|
||||||
setBusyCursor(false);
|
setBusyCursor(false);
|
||||||
m_reverseDirectionAction->setChecked(false);
|
m_reverseDirectionAction->setChecked(false);
|
||||||
@@ -2575,7 +2574,7 @@ void DebuggerPluginPrivate::updateState(DebuggerRunTool *runTool)
|
|||||||
m_debugWithoutDeployAction->setEnabled(false);
|
m_debugWithoutDeployAction->setEnabled(false);
|
||||||
setProxyAction(m_visibleStartAction, Id(Constants::CONTINUE));
|
setProxyAction(m_visibleStartAction, Id(Constants::CONTINUE));
|
||||||
m_hiddenStopAction->setAction(m_exitAction);
|
m_hiddenStopAction->setAction(m_exitAction);
|
||||||
m_localsAndExpressionsWindow->setShowLocals(true);
|
m_localsAndInspectorWindow->setShowLocals(true);
|
||||||
} else if (state == InferiorRunOk) {
|
} else if (state == InferiorRunOk) {
|
||||||
// Shift-F5 interrupts. It is also "interruptible".
|
// Shift-F5 interrupts. It is also "interruptible".
|
||||||
m_interruptAction->setEnabled(true);
|
m_interruptAction->setEnabled(true);
|
||||||
@@ -2585,7 +2584,7 @@ void DebuggerPluginPrivate::updateState(DebuggerRunTool *runTool)
|
|||||||
m_debugWithoutDeployAction->setEnabled(false);
|
m_debugWithoutDeployAction->setEnabled(false);
|
||||||
setProxyAction(m_visibleStartAction, Id(Constants::INTERRUPT));
|
setProxyAction(m_visibleStartAction, Id(Constants::INTERRUPT));
|
||||||
m_hiddenStopAction->setAction(m_interruptAction);
|
m_hiddenStopAction->setAction(m_interruptAction);
|
||||||
m_localsAndExpressionsWindow->setShowLocals(false);
|
m_localsAndInspectorWindow->setShowLocals(false);
|
||||||
} else if (state == DebuggerFinished) {
|
} else if (state == DebuggerFinished) {
|
||||||
const bool canRun = ProjectExplorerPlugin::canRunStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
const bool canRun = ProjectExplorerPlugin::canRunStartupProject(ProjectExplorer::Constants::DEBUG_RUN_MODE);
|
||||||
// We don't want to do anything anymore.
|
// We don't want to do anything anymore.
|
||||||
@@ -2609,7 +2608,7 @@ void DebuggerPluginPrivate::updateState(DebuggerRunTool *runTool)
|
|||||||
m_visibleStartAction->setAction(m_undisturbableAction);
|
m_visibleStartAction->setAction(m_undisturbableAction);
|
||||||
m_hiddenStopAction->setAction(m_exitAction);
|
m_hiddenStopAction->setAction(m_exitAction);
|
||||||
// show locals in core dumps
|
// show locals in core dumps
|
||||||
m_localsAndExpressionsWindow->setShowLocals(true);
|
m_localsAndInspectorWindow->setShowLocals(true);
|
||||||
} else {
|
} else {
|
||||||
// Everything else is "undisturbable".
|
// Everything else is "undisturbable".
|
||||||
m_interruptAction->setEnabled(false);
|
m_interruptAction->setEnabled(false);
|
||||||
@@ -3143,9 +3142,8 @@ void updateState(DebuggerRunTool *runTool)
|
|||||||
dd->updateState(runTool);
|
dd->updateState(runTool);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateWatchersWindow(bool showWatch, bool showReturn)
|
void updateLocalsWindow(bool showReturn)
|
||||||
{
|
{
|
||||||
dd->m_watchersWindow->setVisible(showWatch);
|
|
||||||
dd->m_returnWindow->setVisible(showReturn);
|
dd->m_returnWindow->setVisible(showReturn);
|
||||||
dd->m_localsView->resizeColumns();
|
dd->m_localsView->resizeColumns();
|
||||||
}
|
}
|
||||||
@@ -3203,6 +3201,11 @@ QWidget *mainWindow()
|
|||||||
return dd->m_mainWindow;
|
return dd->m_mainWindow;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void raiseWatchersWindow()
|
||||||
|
{
|
||||||
|
return dd->m_mainWindow->raiseDock(DOCKWIDGET_WATCHERS);
|
||||||
|
}
|
||||||
|
|
||||||
bool isRegistersWindowVisible()
|
bool isRegistersWindowVisible()
|
||||||
{
|
{
|
||||||
return dd->m_registerWindow->isVisible();
|
return dd->m_registerWindow->isVisible();
|
||||||
|
|||||||
@@ -35,8 +35,8 @@ namespace Internal {
|
|||||||
|
|
||||||
enum { LocalsIndex = 0, InspectorIndex = 1 };
|
enum { LocalsIndex = 0, InspectorIndex = 1 };
|
||||||
|
|
||||||
LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(QWidget *locals,
|
LocalsAndInspectorWindow::LocalsAndInspectorWindow(QWidget *locals,
|
||||||
QWidget *inspector, QWidget *returnWidget, QWidget *watchers)
|
QWidget *inspector, QWidget *returnWidget)
|
||||||
: m_showLocals(false)
|
: m_showLocals(false)
|
||||||
{
|
{
|
||||||
auto layout = new QVBoxLayout(this);
|
auto layout = new QVBoxLayout(this);
|
||||||
@@ -53,7 +53,6 @@ LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(QWidget *locals,
|
|||||||
|
|
||||||
splitter->addWidget(localsAndInspector);
|
splitter->addWidget(localsAndInspector);
|
||||||
splitter->addWidget(returnWidget);
|
splitter->addWidget(returnWidget);
|
||||||
splitter->addWidget(watchers);
|
|
||||||
|
|
||||||
splitter->setStretchFactor(0, 3);
|
splitter->setStretchFactor(0, 3);
|
||||||
splitter->setStretchFactor(2, 1);
|
splitter->setStretchFactor(2, 1);
|
||||||
@@ -68,7 +67,7 @@ LocalsAndExpressionsWindow::LocalsAndExpressionsWindow(QWidget *locals,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void LocalsAndExpressionsWindow::setShowLocals(bool showLocals)
|
void LocalsAndInspectorWindow::setShowLocals(bool showLocals)
|
||||||
{
|
{
|
||||||
m_showLocals = showLocals;
|
m_showLocals = showLocals;
|
||||||
m_timer.start();
|
m_timer.start();
|
||||||
|
|||||||
@@ -31,11 +31,11 @@
|
|||||||
namespace Debugger {
|
namespace Debugger {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
class LocalsAndExpressionsWindow : public QWidget
|
class LocalsAndInspectorWindow : public QWidget
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LocalsAndExpressionsWindow(QWidget *locals, QWidget *inspector,
|
LocalsAndInspectorWindow(QWidget *locals, QWidget *inspector,
|
||||||
QWidget *returnWidget, QWidget *watchers);
|
QWidget *returnWidget);
|
||||||
|
|
||||||
void setShowLocals(bool showLocals);
|
void setShowLocals(bool showLocals);
|
||||||
|
|
||||||
|
|||||||
@@ -1326,7 +1326,7 @@ void QmlEnginePrivate::handleEvaluateExpression(const QVariantMap &response,
|
|||||||
}
|
}
|
||||||
insertSubItems(item, body.properties);
|
insertSubItems(item, body.properties);
|
||||||
watchHandler->insertItem(item);
|
watchHandler->insertItem(item);
|
||||||
watchHandler->updateWatchersWindow();
|
watchHandler->updateLocalsWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlEnginePrivate::lookup(const LookupItems &items)
|
void QmlEnginePrivate::lookup(const LookupItems &items)
|
||||||
|
|||||||
@@ -537,7 +537,7 @@ void QmlInspectorAgent::insertObjectInTree(const ObjectReference &object)
|
|||||||
m_qmlEngine->watchHandler()->setCurrentItem(iname);
|
m_qmlEngine->watchHandler()->setCurrentItem(iname);
|
||||||
m_objectToSelect = WatchItem::InvalidId;
|
m_objectToSelect = WatchItem::InvalidId;
|
||||||
}
|
}
|
||||||
m_qmlEngine->watchHandler()->updateWatchersWindow();
|
m_qmlEngine->watchHandler()->updateLocalsWindow();
|
||||||
m_qmlEngine->watchHandler()->reexpandItems();
|
m_qmlEngine->watchHandler()->reexpandItems();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1127,7 +1127,7 @@ bool WatchModel::setData(const QModelIndex &idx, const QVariant &value, int role
|
|||||||
m_expandedINames.remove(item->iname);
|
m_expandedINames.remove(item->iname);
|
||||||
}
|
}
|
||||||
if (item->iname.contains('.'))
|
if (item->iname.contains('.'))
|
||||||
m_handler->updateWatchersWindow();
|
m_handler->updateLocalsWindow();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case LocalsTypeFormatRole:
|
case LocalsTypeFormatRole:
|
||||||
@@ -2086,7 +2086,7 @@ void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters)
|
|||||||
|
|
||||||
m_model->m_requestUpdateTimer.start(80);
|
m_model->m_requestUpdateTimer.start(80);
|
||||||
m_model->m_contentsValid = false;
|
m_model->m_contentsValid = false;
|
||||||
updateWatchersWindow();
|
updateLocalsWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::notifyUpdateFinished()
|
void WatchHandler::notifyUpdateFinished()
|
||||||
@@ -2111,7 +2111,7 @@ void WatchHandler::notifyUpdateFinished()
|
|||||||
});
|
});
|
||||||
|
|
||||||
m_model->m_contentsValid = true;
|
m_model->m_contentsValid = true;
|
||||||
updateWatchersWindow();
|
updateLocalsWindow();
|
||||||
m_model->reexpandItems();
|
m_model->reexpandItems();
|
||||||
m_model->m_requestUpdateTimer.stop();
|
m_model->m_requestUpdateTimer.stop();
|
||||||
emit m_model->updateFinished();
|
emit m_model->updateFinished();
|
||||||
@@ -2130,7 +2130,7 @@ void WatchModel::removeWatchItem(WatchItem *item)
|
|||||||
saveWatchers();
|
saveWatchers();
|
||||||
}
|
}
|
||||||
destroyItem(item);
|
destroyItem(item);
|
||||||
m_handler->updateWatchersWindow();
|
m_handler->updateLocalsWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString WatchHandler::watcherName(const QString &exp)
|
QString WatchHandler::watcherName(const QString &exp)
|
||||||
@@ -2162,7 +2162,8 @@ void WatchHandler::watchExpression(const QString &exp, const QString &name, bool
|
|||||||
} else {
|
} else {
|
||||||
m_model->m_engine->updateWatchData(item->iname);
|
m_model->m_engine->updateWatchData(item->iname);
|
||||||
}
|
}
|
||||||
updateWatchersWindow();
|
updateLocalsWindow();
|
||||||
|
Internal::raiseWatchersWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::updateWatchExpression(WatchItem *item, const QString &newExp)
|
void WatchHandler::updateWatchExpression(WatchItem *item, const QString &newExp)
|
||||||
@@ -2184,7 +2185,7 @@ void WatchHandler::updateWatchExpression(WatchItem *item, const QString &newExp)
|
|||||||
} else {
|
} else {
|
||||||
m_model->m_engine->updateWatchData(item->iname);
|
m_model->m_engine->updateWatchData(item->iname);
|
||||||
}
|
}
|
||||||
updateWatchersWindow();
|
updateLocalsWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watch something obtained from the editor.
|
// Watch something obtained from the editor.
|
||||||
@@ -2340,16 +2341,14 @@ void WatchModel::clearWatches()
|
|||||||
m_watchRoot->removeChildren();
|
m_watchRoot->removeChildren();
|
||||||
theWatcherNames.clear();
|
theWatcherNames.clear();
|
||||||
theWatcherCount = 0;
|
theWatcherCount = 0;
|
||||||
m_handler->updateWatchersWindow();
|
|
||||||
saveWatchers();
|
saveWatchers();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WatchHandler::updateWatchersWindow()
|
void WatchHandler::updateLocalsWindow()
|
||||||
{
|
{
|
||||||
// Force show/hide of watchers and return view.
|
// Force show/hide of return view.
|
||||||
int showWatch = !theWatcherNames.isEmpty();
|
bool showReturn = m_model->m_returnRoot->childCount() != 0;
|
||||||
int showReturn = m_model->m_returnRoot->childCount() != 0;
|
Internal::updateLocalsWindow(showReturn);
|
||||||
Internal::updateWatchersWindow(showWatch, showReturn);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList WatchHandler::watchedExpressions()
|
QStringList WatchHandler::watchedExpressions()
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ public:
|
|||||||
void resetLocation();
|
void resetLocation();
|
||||||
|
|
||||||
void setCurrentItem(const QString &iname);
|
void setCurrentItem(const QString &iname);
|
||||||
void updateWatchersWindow();
|
void updateLocalsWindow();
|
||||||
|
|
||||||
bool insertItem(WatchItem *item); // Takes ownership, returns whether item was added, not overwritten.
|
bool insertItem(WatchItem *item); // Takes ownership, returns whether item was added, not overwritten.
|
||||||
void insertItems(const GdbMi &data);
|
void insertItems(const GdbMi &data);
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ void WatchTreeView::setModel(QAbstractItemModel *model)
|
|||||||
setRootIsDecorated(true);
|
setRootIsDecorated(true);
|
||||||
if (header()) {
|
if (header()) {
|
||||||
header()->setDefaultAlignment(Qt::AlignLeft);
|
header()->setDefaultAlignment(Qt::AlignLeft);
|
||||||
if (m_type != LocalsType && m_type != InspectType)
|
if (m_type == ReturnType && m_type == TooltipType)
|
||||||
header()->hide();
|
header()->hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user