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
3eef8a43
Commit
3eef8a43
authored
Jul 12, 2010
by
hjk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debugger: more state work
parent
cb68ec66
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
13 deletions
+24
-13
src/plugins/debugger/debuggerengine.cpp
src/plugins/debugger/debuggerengine.cpp
+3
-1
src/plugins/debugger/gdb/abstractgdbadapter.h
src/plugins/debugger/gdb/abstractgdbadapter.h
+0
-2
src/plugins/debugger/gdb/attachgdbadapter.cpp
src/plugins/debugger/gdb/attachgdbadapter.cpp
+6
-2
src/plugins/debugger/gdb/gdbengine.cpp
src/plugins/debugger/gdb/gdbengine.cpp
+12
-6
src/plugins/debugger/gdb/gdbengine.h
src/plugins/debugger/gdb/gdbengine.h
+1
-0
src/plugins/debugger/gdb/remotegdbserveradapter.cpp
src/plugins/debugger/gdb/remotegdbserveradapter.cpp
+1
-1
src/plugins/debugger/gdb/trkgdbadapter.cpp
src/plugins/debugger/gdb/trkgdbadapter.cpp
+1
-1
No files found.
src/plugins/debugger/debuggerengine.cpp
View file @
3eef8a43
...
...
@@ -1223,7 +1223,9 @@ void DebuggerEnginePrivate::doShutdownEngine()
{
SDEBUG
(
Q_FUNC_INFO
);
QTC_ASSERT
(
state
()
==
InferiorShutdownOk
||
state
()
==
InferiorShutdownFailed
,
qDebug
()
<<
state
());
||
state
()
==
InferiorShutdownFailed
||
state
()
==
InferiorSetupFailed
,
qDebug
()
<<
state
());
m_targetState
=
DebuggerFinished
;
m_engine
->
setState
(
EngineShutdownRequested
);
m_engine
->
shutdownEngine
();
...
...
src/plugins/debugger/gdb/abstractgdbadapter.h
View file @
3eef8a43
...
...
@@ -89,8 +89,6 @@ public:
protected:
DebuggerState
state
()
const
{
return
m_engine
->
state
();
}
void
setState
(
DebuggerState
state
)
{
m_engine
->
setState
(
state
);
}
const
DebuggerStartParameters
&
startParameters
()
const
{
return
m_engine
->
startParameters
();
}
void
showMessage
(
const
QString
&
msg
,
int
channel
=
LogDebug
,
int
timeout
=
1
)
...
...
src/plugins/debugger/gdb/attachgdbadapter.cpp
View file @
3eef8a43
...
...
@@ -77,7 +77,11 @@ void AttachGdbAdapter::setupInferior()
void
AttachGdbAdapter
::
runEngine
()
{
QTC_ASSERT
(
state
()
==
EngineRunRequested
,
qDebug
()
<<
state
());
m_engine
->
notifyInferiorStopOk
();
m_engine
->
notifyEngineRunAndInferiorStopOk
();
m_engine
->
notifyInferiorRunRequested
();
m_engine
->
continueInferiorInternal
();
m_engine
->
showStatusMessage
(
tr
(
"Attached to process %1."
)
.
arg
(
m_engine
->
inferiorPid
()));
}
void
AttachGdbAdapter
::
handleAttach
(
const
GdbResponse
&
response
)
...
...
@@ -87,7 +91,7 @@ void AttachGdbAdapter::handleAttach(const GdbResponse &response)
showMessage
(
_
(
"INFERIOR ATTACHED"
));
showMessage
(
msgAttachedToStoppedInferior
(),
StatusBar
);
m_engine
->
handleInferiorPrepared
();
m_engine
->
updateAll
();
//
m_engine->updateAll();
}
else
{
QString
msg
=
QString
::
fromLocal8Bit
(
response
.
data
.
findChild
(
"msg"
).
data
());
m_engine
->
notifyInferiorSetupFailed
(
msg
);
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
3eef8a43
...
...
@@ -1073,7 +1073,7 @@ void GdbEngine::handleExecuteJumpToLine(const GdbResponse &response)
}
else
if
(
response
.
resultClass
==
GdbResultDone
)
{
// This happens on old gdb. Trigger the effect of a '*stopped'.
showStatusMessage
(
tr
(
"Jumped. Stopped"
));
setState
(
Inferior
Stop
Ok
);
notifyInferiorSpontaneous
Stop
(
);
handleStop1
(
response
);
}
}
...
...
@@ -1091,7 +1091,7 @@ void GdbEngine::handleExecuteRunToLine(const GdbResponse &response)
//>122^done
gotoLocation
(
m_targetFrame
,
true
);
showStatusMessage
(
tr
(
"Target line hit. Stopped"
));
setState
(
Inferior
Stop
Ok
);
notifyInferiorSpontaneous
Stop
(
);
handleStop1
(
response
);
}
}
...
...
@@ -1712,7 +1712,7 @@ void GdbEngine::handleGdbExit(const GdbResponse &response)
postCommand("-gdb-exit", GdbEngine::ExitRequest, CB(handleGdbExit));
break;
case InferiorSetupRequested: // This may take some time, so just short-circuit it
setState(
InferiorSetupFailed);
notify
InferiorSetupFailed
(
);
gdbProc()->kill();
break;
case InferiorStopFailed: // Tough luck, I guess. But unreachable as of now anyway.
...
...
@@ -1725,7 +1725,13 @@ void GdbEngine::detachDebugger()
{
QTC_ASSERT
(
state
()
==
InferiorStopOk
,
qDebug
()
<<
state
());
QTC_ASSERT
(
startMode
()
!=
AttachCore
,
qDebug
()
<<
startMode
());
postCommand
(
"detach"
);
postCommand
(
"detach"
,
GdbEngine
::
ExitRequest
,
CB
(
handleDetach
));
}
void
GdbEngine
::
handleDetach
(
const
GdbResponse
&
response
)
{
Q_UNUSED
(
response
);
QTC_ASSERT
(
state
()
==
InferiorStopOk
,
qDebug
()
<<
state
());
notifyInferiorExited
();
}
...
...
@@ -1737,8 +1743,8 @@ void GdbEngine::quitDebugger()
// and regular the inferior shutdown procedure could take a while.
// And the RunControl::stop() is called synchroneously.
shutdownEngine
();
initializeVariables
();
setState
(
DebuggerNotReady
);
//
initializeVariables();
//
setState(DebuggerNotReady);
}
int
GdbEngine
::
currentFrame
()
const
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
3eef8a43
...
...
@@ -490,6 +490,7 @@ private: ////////// View & Data Stuff //////////
void
handleDebuggingHelperEditValue
(
const
GdbResponse
&
response
);
void
handleDebuggingHelperSetup
(
const
GdbResponse
&
response
);
void
handleDebuggingHelperVersionCheckClassic
(
const
GdbResponse
&
response
);
void
handleDetach
(
const
GdbResponse
&
response
);
Q_SLOT
void
createFullBacktrace
();
void
handleCreateFullBacktrace
(
const
GdbResponse
&
response
);
...
...
src/plugins/debugger/gdb/remotegdbserveradapter.cpp
View file @
3eef8a43
...
...
@@ -210,7 +210,7 @@ void RemoteGdbServerAdapter::handleTargetRemote(const GdbResponse &record)
{
QTC_ASSERT
(
state
()
==
InferiorSetupRequested
,
qDebug
()
<<
state
());
if
(
record
.
resultClass
==
GdbResultDone
)
{
setState
(
InferiorStopOk
);
m_engine
->
notify
InferiorStopOk
(
);
// gdb server will stop the remote application itself.
showMessage
(
_
(
"INFERIOR STARTED"
));
showMessage
(
msgAttachedToStoppedInferior
(),
StatusBar
);
...
...
src/plugins/debugger/gdb/trkgdbadapter.cpp
View file @
3eef8a43
...
...
@@ -1604,7 +1604,7 @@ void TrkGdbAdapter::handleTargetRemote(const GdbResponse &record)
{
QTC_ASSERT
(
state
()
==
InferiorSetupRequested
,
qDebug
()
<<
state
());
if
(
record
.
resultClass
==
GdbResultDone
)
{
setState
(
InferiorStopOk
);
m_engine
->
notify
InferiorStopOk
(
);
m_engine
->
handleInferiorPrepared
();
}
else
{
QString
msg
=
tr
(
"Connecting to TRK server adapter failed:
\n
"
)
...
...
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