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
Tobias Hunger
qt-creator
Commits
5d8bd5e0
Commit
5d8bd5e0
authored
May 07, 2009
by
Oswald Buddenhagen
Browse files
generalize auto-continue mechanism
parent
12f9c789
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdbengine.cpp
View file @
5d8bd5e0
...
...
@@ -192,7 +192,7 @@ void GdbEngine::initializeVariables()
m_oldestAcceptableToken
=
-
1
;
m_outputCodec
=
QTextCodec
::
codecForLocale
();
m_pendingRequests
=
0
;
m_
waitingForBreakpointSynchronizationT
oContinue
=
false
;
m_
aut
oContinue
=
false
;
m_waitingForFirstBreakpointToBeHit
=
false
;
m_commandsToRunOnTemporaryBreak
.
clear
();
}
...
...
@@ -522,8 +522,8 @@ void GdbEngine::handleResponse(const QByteArray &buff)
void
GdbEngine
::
handleStubAttached
(
const
GdbResultRecord
&
,
const
QVariant
&
)
{
qq
->
notifyInferiorStopped
();
m_waitingForBreakpointSynchronizationToContinue
=
true
;
handleAqcuiredInferior
();
m_autoContinue
=
true
;
}
void
GdbEngine
::
stubStarted
()
...
...
@@ -713,6 +713,16 @@ void GdbEngine::handleResultRecord(const GdbResultRecord &record)
PENDING_DEBUG
(
" UNKNOWN TYPE "
<<
cmd
.
type
<<
" LEAVES PENDING AT: "
<<
m_pendingRequests
<<
cmd
.
command
);
}
// This is somewhat inefficient, as it makes the last command synchronous.
// An optimization would be requesting the continue immediately when the
// event loop is entered, and let individual commands have a flag to suppress
// that behavior.
if
(
m_cookieForToken
.
isEmpty
()
&&
m_autoContinue
)
{
m_autoContinue
=
false
;
continueInferior
();
q
->
showStatusMessage
(
tr
(
"Continuing after temporary stop."
));
}
}
void
GdbEngine
::
executeDebuggerCommand
(
const
QString
&
command
)
...
...
@@ -942,12 +952,6 @@ void GdbEngine::handleAqcuiredInferior()
attemptBreakpointSynchronization
();
}
void
GdbEngine
::
handleAutoContinue
(
const
GdbResultRecord
&
,
const
QVariant
&
)
{
continueInferior
();
q
->
showStatusMessage
(
tr
(
"Continuing after temporary stop."
));
}
void
GdbEngine
::
handleAsyncOutput
(
const
GdbMi
&
data
)
{
const
QByteArray
&
reason
=
data
.
findChild
(
"reason"
).
data
();
...
...
@@ -980,8 +984,8 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
// This is handled now above.
qq
->
notifyInferiorStopped
();
m_waitingForBreakpointSynchronizationToContinue
=
true
;
handleAqcuiredInferior
();
m_autoContinue
=
true
;
return
;
}
...
...
@@ -996,8 +1000,8 @@ void GdbEngine::handleAsyncOutput(const GdbMi &data)
.
arg
(
cmd
.
command
).
arg
(
_
(
cmd
.
callbackName
)));
flushCommand
(
cmd
);
}
postCommand
(
_
(
"p temporaryStop"
),
CB
(
handleAutoContinue
));
q
->
showStatusMessage
(
tr
(
"Handling queued commands."
))
;
q
->
showStatusMessage
(
tr
(
"Processing queued commands."
));
m_autoContinue
=
true
;
return
;
}
...
...
@@ -1638,8 +1642,8 @@ void GdbEngine::handleTargetRemote(const GdbResultRecord &record, const QVariant
{
if
(
record
.
resultClass
==
GdbResultDone
)
{
//postCommand(_("-exec-continue"), CB(handleExecRun));
m_waitingForBreakpointSynchronizationToContinue
=
true
;
handleAqcuiredInferior
();
m_autoContinue
=
true
;
}
else
if
(
record
.
resultClass
==
GdbResultError
)
{
// 16^error,msg="hd:5555: Connection timed out."
QString
msg
=
__
(
record
.
data
.
findChild
(
"msg"
).
data
());
...
...
@@ -2218,12 +2222,6 @@ void GdbEngine::attemptBreakpointSynchronization()
}
}
if
(
!
updateNeeded
&&
m_waitingForBreakpointSynchronizationToContinue
)
{
m_waitingForBreakpointSynchronizationToContinue
=
false
;
// we continue the execution
continueInferior
();
}
inBreakpointSychronization
=
false
;
}
...
...
src/plugins/debugger/gdbengine.h
View file @
5d8bd5e0
...
...
@@ -205,7 +205,6 @@ private:
void
handleAsyncOutput2
(
const
GdbMi
&
data
);
void
handleAsyncOutput
(
const
GdbMi
&
data
);
void
handleResultRecord
(
const
GdbResultRecord
&
response
);
void
handleAutoContinue
(
const
GdbResultRecord
&
,
const
QVariant
&
);
void
handleFileExecAndSymbols
(
const
GdbResultRecord
&
response
,
const
QVariant
&
);
void
handleExecRun
(
const
GdbResultRecord
&
response
,
const
QVariant
&
);
void
handleExecJumpToLine
(
const
GdbResultRecord
&
response
,
const
QVariant
&
);
...
...
@@ -371,7 +370,7 @@ private:
QString
m_currentFrame
;
QMap
<
QString
,
QString
>
m_varToType
;
bool
m_
waitingForBreakpointSynchronizationT
oContinue
;
bool
m_
aut
oContinue
;
bool
m_waitingForFirstBreakpointToBeHit
;
bool
m_modulesListOutdated
;
...
...
Write
Preview
Supports
Markdown
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