Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
ed2862ac
Commit
ed2862ac
authored
Jun 23, 2010
by
hjk
Browse files
debugger: remove special mechanism to update watcher and return window
parent
e7088e9c
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerengine.cpp
View file @
ed2862ac
...
...
@@ -696,9 +696,10 @@ void DebuggerEngine::addToWatchWindow()
int
line
,
column
;
exp
=
cppExpressionAt
(
textEditor
,
tc
.
position
(),
&
line
,
&
column
);
}
if
(
!
exp
.
isEmpty
())
watchHandler
()
->
watchExpression
(
exp
);
if
(
exp
.
isEmpty
())
return
;
watchHandler
()
->
watchExpression
(
exp
);
plugin
()
->
updateState
(
this
);
}
// Called from RunControl.
...
...
@@ -860,24 +861,18 @@ void DebuggerEngine::setState(DebuggerState state, bool forced)
//qDebug() << "STATUS CHANGE: FROM " << stateName(d->m_state)
// << " TO " << stateName(state);
DebuggerState
oldState
=
d
->
m_state
;
d
->
m_state
=
state
;
QString
msg
=
_
(
"State changed from %1(%2) to %3(%4)."
)
.
arg
(
stateName
(
d
->
m_state
)).
arg
(
d
->
m_state
).
arg
(
stateName
(
state
)).
arg
(
state
);
//if (!((d->m_state == -1 && state == 0) || (d->m_state == 0 && state == 0)))
// qDebug() << msg;
if
(
!
forced
&&
!
isAllowedTransition
(
d
->
m_state
,
state
))
.
arg
(
stateName
(
oldState
)).
arg
(
oldState
).
arg
(
stateName
(
state
)).
arg
(
state
);
if
(
!
forced
&&
!
isAllowedTransition
(
oldState
,
state
))
qDebug
()
<<
"UNEXPECTED STATE TRANSITION: "
<<
msg
;
showMessage
(
msg
,
LogDebug
);
//resetLocation();
if
(
state
==
d
->
m_state
)
return
;
d
->
m_state
=
state
;
plugin
()
->
updateState
(
this
);
if
(
d
->
m_
state
==
DebuggerNotReady
)
if
(
state
!=
oldState
&&
state
==
DebuggerNotReady
)
d
->
m_runControl
->
debuggingFinished
();
}
...
...
src/plugins/debugger/debuggerengine.h
View file @
ed2862ac
...
...
@@ -253,6 +253,7 @@ public slots:
void
quitDebugger
()
{
exitDebugger
();
}
protected:
friend
class
WatchHandler
;
void
setState
(
DebuggerState
state
,
bool
forced
=
false
);
private:
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
ed2862ac
...
...
@@ -52,7 +52,7 @@
#include "watchwindow.h"
#include "watchutils.h"
#include "breakhandler.h"
#include "breakhandler.h"
#include "stackhandler.h"
#include "watchhandler.h"
...
...
@@ -2072,7 +2072,15 @@ void DebuggerPluginPrivate::setSimpleDockWidgetArrangement(const QString &active
void
DebuggerPluginPrivate
::
updateState
(
DebuggerEngine
*
engine
)
{
m_watchersWindow
->
setVisible
(
m_watchersWindow
->
model
()
->
rowCount
(
QModelIndex
())
>
0
);
m_returnWindow
->
setVisible
(
m_returnWindow
->
model
()
->
rowCount
(
QModelIndex
())
>
0
);
QTC_ASSERT
(
engine
,
return
);
if
(
m_state
==
engine
->
state
())
return
;
m_state
=
engine
->
state
();
bool
actionsEnabled
=
DebuggerEngine
::
debuggerActionsEnabled
(
m_state
);
...
...
@@ -2171,9 +2179,6 @@ void DebuggerPluginPrivate::updateState(DebuggerEngine *engine)
theDebuggerAction
(
ExpandStack
)
->
setEnabled
(
actionsEnabled
);
theDebuggerAction
(
ExecuteCommand
)
->
setEnabled
(
m_state
==
InferiorStopped
);
m_watchersWindow
->
setVisible
(
false
);
m_returnWindow
->
setVisible
(
false
);
const
bool
notbusy
=
m_state
==
InferiorStopped
||
m_state
==
DebuggerNotReady
||
m_state
==
InferiorUnrunnable
;
...
...
@@ -2565,12 +2570,6 @@ void DebuggerPlugin::extensionsInitialized()
//d->m_uiSwitcher->initialize();
}
void
DebuggerPlugin
::
updateWatchersWindow
(
bool
showWatchers
,
bool
showReturn
)
{
d
->
m_watchersWindow
->
setVisible
(
showWatchers
);
d
->
m_returnWindow
->
setVisible
(
showReturn
);
}
QWidget
*
DebuggerPlugin
::
mainWindow
()
const
{
return
d
->
m_uiSwitcher
->
mainWindow
();
...
...
src/plugins/debugger/debuggerplugin.h
View file @
ed2862ac
...
...
@@ -101,12 +101,12 @@ public:
// This contains per-session data like breakpoints and watched
// expression. It serves as a template for new engine instantiations.
Internal
::
DebuggerEngine
*
sessionTemplate
();
void
updateState
(
Internal
::
DebuggerEngine
*
engine
);
public
slots
:
void
exitDebugger
();
// FIXME: remove
void
clearCppCodeModelSnapshot
();
void
ensureLogVisible
();
void
updateWatchersWindow
(
bool
showWatchers
,
bool
showReturn
);
// void runTest(const QString &fileName);
void
showMessage
(
const
QString
&
msg
,
int
channel
,
int
timeout
=
-
1
);
...
...
@@ -123,8 +123,6 @@ private:
void
extensionsInitialized
();
void
remoteCommand
(
const
QStringList
&
options
,
const
QStringList
&
arguments
);
void
updateState
(
Internal
::
DebuggerEngine
*
engine
);
QWidget
*
mainWindow
()
const
;
private:
...
...
src/plugins/debugger/watchhandler.cpp
View file @
ed2862ac
...
...
@@ -1226,6 +1226,7 @@ void WatchHandler::watchExpression(const QString &exp)
m_engine
->
updateWatchData
(
data
);
updateWatchersWindow
();
saveWatchers
();
emitAllChanged
();
}
static
void
swapEndian
(
char
*
d
,
int
nchar
)
...
...
@@ -1340,13 +1341,14 @@ void WatchHandler::removeWatchExpression(const QString &exp0)
break
;
}
}
updateWatchersWindow
();
emitAllChanged
();
}
void
WatchHandler
::
updateWatchersWindow
()
{
const
bool
showWatchers
=
m_watchers
->
rowCount
(
QModelIndex
())
>
0
;
const
bool
showReturn
=
m_return
->
rowCount
(
QModelIndex
())
>
0
;
plugin
()
->
updateWatchersWindow
(
showWatchers
,
showReturn
);
// Force show/hide of watchers and return view.
plugin
()
->
updateState
(
m_engine
);
}
void
WatchHandler
::
updateWatchers
()
...
...
@@ -1370,7 +1372,6 @@ void WatchHandler::loadWatchers()
m_watcherNames
[
exp
.
toLatin1
()]
=
watcherCounter
++
;
//qDebug() << "LOAD WATCHERS: " << m_watchers;
//reinitializeWatchersHelper();
}
QStringList
WatchHandler
::
watchedExpressions
()
const
...
...
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