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
bc15777e
Commit
bc15777e
authored
Sep 28, 2009
by
hjk
Browse files
debugger: retrieve InferiorRunning state from gdb output, not from business logic
parent
214d998b
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
bc15777e
...
...
@@ -555,18 +555,21 @@ void GdbEngine::handleResponse(const QByteArray &buff)
break
;
QByteArray
resultClass
=
QByteArray
::
fromRawData
(
from
,
inner
-
from
);
if
(
resultClass
==
"done"
)
if
(
resultClass
==
"done"
)
{
response
.
resultClass
=
GdbResultDone
;
else
if
(
resultClass
==
"running"
)
}
else
if
(
resultClass
==
"running"
)
{
setState
(
InferiorRunning
);
showStatusMessage
(
tr
(
"Running..."
));
response
.
resultClass
=
GdbResultRunning
;
else
if
(
resultClass
==
"connected"
)
}
else
if
(
resultClass
==
"connected"
)
{
response
.
resultClass
=
GdbResultConnected
;
else
if
(
resultClass
==
"error"
)
}
else
if
(
resultClass
==
"error"
)
{
response
.
resultClass
=
GdbResultError
;
else
if
(
resultClass
==
"exit"
)
}
else
if
(
resultClass
==
"exit"
)
{
response
.
resultClass
=
GdbResultExit
;
else
}
else
{
response
.
resultClass
=
GdbResultUnknown
;
}
from
=
inner
;
if
(
from
!=
to
)
{
...
...
@@ -1422,12 +1425,11 @@ void GdbEngine::handleFileExecAndSymbols(const GdbResponse &response)
void
GdbEngine
::
handleExecContinue
(
const
GdbResponse
&
response
)
{
QTC_ASSERT
(
state
()
==
InferiorRunningRequested
,
/**/
);
if
(
response
.
resultClass
==
GdbResultRunning
)
{
setState
(
InferiorRunning
);
showStatusMessage
(
tr
(
"Running..."
),
5000
);
}
else
{
QTC_ASSERT
(
response
.
resultClass
==
GdbResultError
,
/**/
);
// The "running" state is picked up in handleResponse()
QTC_ASSERT
(
state
()
==
InferiorRunning
,
/**/
);
}
else
if
(
response
.
resultClass
==
GdbResultError
)
{
QTC_ASSERT
(
state
()
==
InferiorRunningRequested
,
/**/
);
const
QByteArray
&
msg
=
response
.
data
.
findChild
(
"msg"
).
data
();
if
(
msg
==
"Cannot find bounds of current function"
)
{
setState
(
InferiorStopped
);
...
...
@@ -1441,6 +1443,8 @@ void GdbEngine::handleExecContinue(const GdbResponse &response)
QTC_ASSERT
(
state
()
==
InferiorRunning
,
/**/
);
shutdown
();
}
}
else
{
QTC_ASSERT
(
false
,
/**/
);
}
}
...
...
@@ -4150,7 +4154,7 @@ void GdbEngine::handleInferiorStartFailed(const QString &msg)
void
GdbEngine
::
handleInferiorStarted
()
{
QTC_ASSERT
(
state
()
==
InferiorRunning
Requested
QTC_ASSERT
(
state
()
==
InferiorRunning
||
state
()
==
InferiorStopped
,
qDebug
()
<<
state
());
debugMessage
(
_
(
"INFERIOR STARTED"
));
if
(
state
()
==
InferiorStopped
)
...
...
src/plugins/debugger/gdb/plaingdbadapter.cpp
View file @
bc15777e
...
...
@@ -209,11 +209,11 @@ void PlainGdbAdapter::handleInfoTarget(const GdbResponse &response)
void
PlainGdbAdapter
::
handleExecRun
(
const
GdbResponse
&
response
)
{
QTC_ASSERT
(
state
()
==
InferiorRunningRequested
,
qDebug
()
<<
state
());
if
(
response
.
resultClass
==
GdbResultRunning
)
{
QTC_ASSERT
(
state
()
==
InferiorRunning
,
qDebug
()
<<
state
());
emit
inferiorStarted
();
setState
(
InferiorRunning
);
}
else
{
QTC_ASSERT
(
state
()
==
InferiorRunningRequested
,
qDebug
()
<<
state
());
QTC_ASSERT
(
response
.
resultClass
==
GdbResultError
,
/**/
);
const
QByteArray
&
msg
=
response
.
data
.
findChild
(
"msg"
).
data
();
//QTC_ASSERT(status() == InferiorRunning, /**/);
...
...
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