Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
7100d29f
Commit
7100d29f
authored
Feb 28, 2011
by
Christiaan Janssen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
QmlDebugger: user input on watches
Reviewed-by: hjk
parent
fd66f686
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
54 additions
and
7 deletions
+54
-7
src/plugins/debugger/debuggerengine.cpp
src/plugins/debugger/debuggerengine.cpp
+10
-0
src/plugins/debugger/debuggerengine.h
src/plugins/debugger/debuggerengine.h
+2
-0
src/plugins/debugger/debuggerplugin.cpp
src/plugins/debugger/debuggerplugin.cpp
+1
-1
src/plugins/debugger/gdb/gdbengine.cpp
src/plugins/debugger/gdb/gdbengine.cpp
+5
-0
src/plugins/debugger/gdb/gdbengine.h
src/plugins/debugger/gdb/gdbengine.h
+1
-0
src/plugins/debugger/qml/qmlcppengine.cpp
src/plugins/debugger/qml/qmlcppengine.cpp
+10
-0
src/plugins/debugger/qml/qmlcppengine.h
src/plugins/debugger/qml/qmlcppengine.h
+2
-0
src/plugins/debugger/qml/qmlengine.cpp
src/plugins/debugger/qml/qmlengine.cpp
+5
-0
src/plugins/debugger/qml/qmlengine.h
src/plugins/debugger/qml/qmlengine.h
+1
-0
src/plugins/debugger/watchhandler.cpp
src/plugins/debugger/watchhandler.cpp
+5
-1
src/plugins/debugger/watchwindow.cpp
src/plugins/debugger/watchwindow.cpp
+12
-5
No files found.
src/plugins/debugger/debuggerengine.cpp
View file @
7100d29f
...
...
@@ -1311,6 +1311,16 @@ unsigned DebuggerEngine::debuggerCapabilities() const
return
0
;
}
bool
DebuggerEngine
::
canWatchWidgets
()
const
{
return
false
;
}
bool
DebuggerEngine
::
acceptsWatchesWhileRunning
()
const
{
return
false
;
}
bool
DebuggerEngine
::
isSynchronous
()
const
{
return
false
;
...
...
src/plugins/debugger/debuggerengine.h
View file @
7100d29f
...
...
@@ -180,6 +180,8 @@ public:
virtual
void
setRegisterValue
(
int
regnr
,
const
QString
&
value
);
virtual
void
addOptionPages
(
QList
<
Core
::
IOptionsPage
*>
*
)
const
;
virtual
unsigned
debuggerCapabilities
()
const
;
virtual
bool
canWatchWidgets
()
const
;
virtual
bool
acceptsWatchesWhileRunning
()
const
;
virtual
bool
isSynchronous
()
const
;
virtual
QByteArray
qtNamespace
()
const
;
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
7100d29f
...
...
@@ -482,7 +482,7 @@ public:
void
runEngine
()
{}
void
shutdownEngine
()
{}
void
shutdownInferior
()
{}
unsigned
debuggerCapabilities
()
const
{
return
0
;
}
unsigned
debuggerCapabilities
()
const
{
return
AddWatcherCapability
;
}
bool
acceptsBreakpoint
(
BreakpointId
)
const
{
return
false
;
}
bool
acceptsDebuggerCommands
()
const
{
return
false
;
}
};
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
7100d29f
...
...
@@ -1895,6 +1895,11 @@ unsigned GdbEngine::debuggerCapabilities() const
return
caps
|
SnapshotCapability
;
}
bool
GdbEngine
::
canWatchWidgets
()
const
{
return
true
;
}
void
GdbEngine
::
continueInferiorInternal
()
{
QTC_ASSERT
(
state
()
==
InferiorStopOk
,
qDebug
()
<<
state
());
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
7100d29f
...
...
@@ -110,6 +110,7 @@ private: ////////// General Interface //////////
virtual
void
runEngine
();
virtual
unsigned
debuggerCapabilities
()
const
;
virtual
bool
canWatchWidgets
()
const
;
virtual
void
detachDebugger
();
virtual
void
shutdownEngine
();
virtual
void
shutdownInferior
();
...
...
src/plugins/debugger/qml/qmlcppengine.cpp
View file @
7100d29f
...
...
@@ -248,6 +248,16 @@ unsigned QmlCppEngine::debuggerCapabilities() const
return
d
->
m_cppEngine
->
debuggerCapabilities
();
}
bool
QmlCppEngine
::
canWatchWidgets
()
const
{
return
d
->
m_activeEngine
->
canWatchWidgets
();
}
bool
QmlCppEngine
::
acceptsWatchesWhileRunning
()
const
{
return
d
->
m_activeEngine
->
acceptsWatchesWhileRunning
();
}
bool
QmlCppEngine
::
isSynchronous
()
const
{
return
d
->
m_activeEngine
->
isSynchronous
();
...
...
src/plugins/debugger/qml/qmlcppengine.h
View file @
7100d29f
...
...
@@ -75,6 +75,8 @@ public:
void
setRegisterValue
(
int
regnr
,
const
QString
&
value
);
unsigned
debuggerCapabilities
()
const
;
virtual
bool
canWatchWidgets
()
const
;
virtual
bool
acceptsWatchesWhileRunning
()
const
;
bool
isSynchronous
()
const
;
QByteArray
qtNamespace
()
const
;
...
...
src/plugins/debugger/qml/qmlengine.cpp
View file @
7100d29f
...
...
@@ -353,6 +353,11 @@ void QmlEngine::showMessage(const QString &msg, int channel, int timeout) const
DebuggerEngine
::
showMessage
(
msg
,
channel
,
timeout
);
}
bool
QmlEngine
::
acceptsWatchesWhileRunning
()
const
{
return
true
;
}
void
QmlEngine
::
closeConnection
()
{
disconnect
(
&
d
->
m_adapter
,
SIGNAL
(
connectionStartupFailed
()),
...
...
src/plugins/debugger/qml/qmlengine.h
View file @
7100d29f
...
...
@@ -63,6 +63,7 @@ public:
void
showMessage
(
const
QString
&
msg
,
int
channel
=
LogDebug
,
int
timeout
=
-
1
)
const
;
void
filterApplicationMessage
(
const
QString
&
msg
,
int
channel
);
virtual
bool
acceptsWatchesWhileRunning
()
const
;
public
slots
:
void
messageReceived
(
const
QByteArray
&
message
);
...
...
src/plugins/debugger/watchhandler.cpp
View file @
7100d29f
...
...
@@ -811,7 +811,7 @@ Qt::ItemFlags WatchModel::flags(const QModelIndex &idx) const
// Disable editing if debuggee is positively running.
const
bool
isRunning
=
engine
()
&&
engine
()
->
state
()
==
InferiorRunOk
;
if
(
isRunning
)
if
(
isRunning
&&
engine
()
&&
!
engine
()
->
acceptsWatchesWhileRunning
()
)
return
notEditable
;
const
WatchData
&
data
=
*
watchItem
(
idx
);
...
...
@@ -1186,6 +1186,10 @@ void WatchHandler::insertData(const WatchData &data)
if
(
data
.
isSomethingNeeded
()
&&
data
.
iname
.
contains
(
'.'
))
{
MODEL_DEBUG
(
"SOMETHING NEEDED: "
<<
data
.
toString
());
if
(
!
m_engine
->
isSynchronous
())
{
WatchModel
*
model
=
modelForIName
(
data
.
iname
);
QTC_ASSERT
(
model
,
return
);
model
->
insertData
(
data
);
m_engine
->
updateWatchData
(
data
);
}
else
{
m_engine
->
showMessage
(
QLatin1String
(
"ENDLESS LOOP: SOMETHING NEEDED: "
)
...
...
src/plugins/debugger/watchwindow.cpp
View file @
7100d29f
...
...
@@ -59,6 +59,7 @@
#include <QtGui/QMenu>
#include <QtGui/QPainter>
#include <QtGui/QResizeEvent>
#include <QtGui/QInputDialog>
/////////////////////////////////////////////////////////////////////
//
...
...
@@ -361,15 +362,15 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
const
bool
actionsEnabled
=
engine
->
debuggerActionsEnabled
();
const
unsigned
engineCapabilities
=
engine
->
debuggerCapabilities
();
const
bool
canHandleWatches
=
actionsEnabled
&&
(
engineCapabilities
&
AddWatcherCapability
);
const
bool
canHandleWatches
=
engineCapabilities
&
AddWatcherCapability
;
const
DebuggerState
state
=
engine
->
state
();
const
bool
canInsertWatches
=
(
state
==
InferiorStopOk
)
||
((
state
==
InferiorRunOk
)
&&
engine
->
acceptsWatchesWhileRunning
());
QMenu
menu
;
QAction
*
actInsertNewWatchItem
=
menu
.
addAction
(
tr
(
"Insert New Watch Item"
));
actInsertNewWatchItem
->
setEnabled
(
canHandleWatches
);
actInsertNewWatchItem
->
setEnabled
(
canHandleWatches
&&
canInsertWatches
);
QAction
*
actSelectWidgetToWatch
=
menu
.
addAction
(
tr
(
"Select Widget to Watch"
));
actSelectWidgetToWatch
->
setEnabled
(
canHandleWatches
);
actSelectWidgetToWatch
->
setEnabled
(
canHandleWatches
&&
(
engine
->
canWatchWidgets
())
);
// Offer to open address pointed to or variable address.
const
bool
createPointerActions
=
pointerValue
&&
pointerValue
!=
address
;
...
...
@@ -497,7 +498,13 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
if
(
act
==
actAdjustColumnWidths
)
{
resizeColumnsToContents
();
}
else
if
(
act
==
actInsertNewWatchItem
)
{
watchExpression
(
QString
());
bool
ok
;
QString
newExp
=
QInputDialog
::
getText
(
this
,
tr
(
"Enter watch expression"
),
tr
(
"Expression:"
),
QLineEdit
::
Normal
,
QString
(),
&
ok
);
if
(
ok
&&
!
newExp
.
isEmpty
())
{
watchExpression
(
newExp
);
}
}
else
if
(
act
==
actOpenMemoryEditAtVariableAddress
)
{
currentEngine
()
->
openMemoryView
(
address
);
}
else
if
(
act
==
actOpenMemoryEditAtPointerValue
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment