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
83f3119c
Commit
83f3119c
authored
Aug 18, 2010
by
Friedemann Kleint
Browse files
Debugger: Improve exit handling.
parent
172288b5
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerengine.cpp
View file @
83f3119c
...
...
@@ -1466,13 +1466,18 @@ void DebuggerEngine::quitDebugger()
{
showMessage
(
"QUIT DEBUGGER REQUESTED"
);
d
->
m_targetState
=
DebuggerFinished
;
if
(
state
()
==
InferiorStopOk
)
{
switch
(
state
())
{
case
InferiorStopOk
:
case
InferiorStopFailed
:
d
->
queueShutdownInferior
();
}
else
if
(
state
()
==
InferiorRunOk
)
{
break
;
case
InferiorRunOk
:
d
->
doInterruptInferior
();
}
else
{
break
;
default:
// FIXME: We should disable the actions connected to that
notifyInferiorIll
();
break
;
}
}
...
...
src/plugins/debugger/debuggerplugin.cpp
View file @
83f3119c
...
...
@@ -953,6 +953,8 @@ public slots:
void
executeDebuggerCommand
();
QList
<
DebuggerRunControl
*>
runControls
()
const
{
return
m_snapshotHandler
->
runControls
();
}
public:
DebuggerState
m_state
;
uint
m_capabilities
;
...
...
@@ -1651,13 +1653,15 @@ void DebuggerPluginPrivate::onCurrentProjectChanged(ProjectExplorer::Project *pr
QTC_ASSERT
(
activeRc
,
/**/
);
}
for
(
int
i
=
0
,
n
=
m_snapshotHandler
->
size
();
i
!=
n
;
++
i
)
{
DebuggerRunControl
*
runControl
=
m_snapshotHandler
->
at
(
i
);
RunConfiguration
*
rc
=
runControl
->
runConfiguration
();
if
(
rc
==
activeRc
)
{
m_snapshotHandler
->
setCurrentIndex
(
i
);
DebuggerEngine
*
engine
=
runControl
->
engine
();
updateState
(
engine
);
return
;
// Run controls might be deleted during exit.
if
(
DebuggerRunControl
*
runControl
=
m_snapshotHandler
->
at
(
i
))
{
RunConfiguration
*
rc
=
runControl
->
runConfiguration
();
if
(
rc
==
activeRc
)
{
m_snapshotHandler
->
setCurrentIndex
(
i
);
DebuggerEngine
*
engine
=
runControl
->
engine
();
updateState
(
engine
);
return
;
}
}
}
// No corresponding debugger found. So we are ready to start one.
...
...
src/plugins/debugger/snapshothandler.cpp
View file @
83f3119c
...
...
@@ -286,10 +286,22 @@ void SnapshotHandler::setCurrentIndex(int index)
reset
();
}
DebuggerRunControl
*
SnapshotHandler
::
at
(
int
i
)
DebuggerRunControl
*
SnapshotHandler
::
at
(
int
i
)
const
{
return
m_snapshots
.
at
(
i
).
data
();
}
QList
<
DebuggerRunControl
*>
SnapshotHandler
::
runControls
()
const
{
// Return unique list of run controls
QList
<
DebuggerRunControl
*>
rc
;
rc
.
reserve
(
m_snapshots
.
size
());
foreach
(
const
QPointer
<
DebuggerRunControl
>
&
runControlPtr
,
m_snapshots
)
if
(
DebuggerRunControl
*
runControl
=
runControlPtr
)
if
(
!
rc
.
contains
(
runControl
))
rc
.
push_back
(
runControl
);
return
rc
;
}
}
// namespace Internal
}
// namespace Debugger
src/plugins/debugger/snapshothandler.h
View file @
83f3119c
...
...
@@ -67,7 +67,8 @@ public:
void
removeSnapshot
(
DebuggerRunControl
*
rc
);
void
setCurrentIndex
(
int
index
);
int
size
()
const
{
return
m_snapshots
.
size
();
}
DebuggerRunControl
*
at
(
int
i
);
DebuggerRunControl
*
at
(
int
i
)
const
;
QList
<
DebuggerRunControl
*>
runControls
()
const
;
private:
// QAbstractTableModel
...
...
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