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
b2051be9
Commit
b2051be9
authored
Jul 21, 2009
by
hjk
Browse files
debugger: handle execRun() error result
parent
f7ecff56
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/gdbengine.cpp
View file @
b2051be9
...
...
@@ -1310,7 +1310,23 @@ void GdbEngine::handleExecRun(const GdbResultRecord &response, const QVariant &)
{
if
(
response
.
resultClass
==
GdbResultRunning
)
{
qq
->
notifyInferiorRunning
();
}
else
if
(
response
.
resultClass
==
GdbResultError
)
{
}
else
{
QTC_ASSERT
(
response
.
resultClass
==
GdbResultError
,
/**/
);
const
QByteArray
&
msg
=
response
.
data
.
findChild
(
"msg"
).
data
();
QMessageBox
::
critical
(
q
->
mainWindow
(),
tr
(
"Error"
),
tr
(
"Starting executable failed:
\n
"
)
+
QString
::
fromLocal8Bit
(
msg
));
QTC_ASSERT
(
q
->
status
()
==
DebuggerInferiorRunning
,
/**/
);
//interruptInferior();
qq
->
notifyInferiorExited
();
}
}
void
GdbEngine
::
handleExecContinue
(
const
GdbResultRecord
&
response
,
const
QVariant
&
)
{
if
(
response
.
resultClass
==
GdbResultRunning
)
{
qq
->
notifyInferiorRunning
();
}
else
{
QTC_ASSERT
(
response
.
resultClass
==
GdbResultError
,
/**/
);
const
QByteArray
&
msg
=
response
.
data
.
findChild
(
"msg"
).
data
();
if
(
msg
==
"Cannot find bounds of current function"
)
{
qq
->
notifyInferiorStopped
();
...
...
@@ -1623,7 +1639,7 @@ bool GdbEngine::startDebugger(const QSharedPointer<DebuggerStartParameters> &sp)
postCommand
(
_
(
"tbreak main"
));
m_waitingForFirstBreakpointToBeHit
=
true
;
qq
->
notifyInferiorRunningRequested
();
postCommand
(
_
(
"-exec-run"
));
postCommand
(
_
(
"-exec-run"
)
,
CB
(
handleExecRun
)
);
#endif
qq
->
breakHandler
()
->
setAllPending
();
}
...
...
@@ -1636,7 +1652,7 @@ void GdbEngine::continueInferior()
q
->
resetLocation
();
setTokenBarrier
();
qq
->
notifyInferiorRunningRequested
();
postCommand
(
_
(
"-exec-continue"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"-exec-continue"
),
CB
(
handleExec
Continue
));
}
void
GdbEngine
::
handleStart
(
const
GdbResultRecord
&
response
,
const
QVariant
&
)
...
...
@@ -1655,7 +1671,7 @@ void GdbEngine::handleStart(const GdbResultRecord &response, const QVariant &)
postCommand
(
_
(
"tbreak *"
)
+
needle
.
cap
(
1
));
m_waitingForFirstBreakpointToBeHit
=
true
;
qq
->
notifyInferiorRunningRequested
();
postCommand
(
_
(
"-exec-run"
));
postCommand
(
_
(
"-exec-run"
)
,
CB
(
handleExecRun
)
);
}
else
{
debugMessage
(
_
(
"PARSING START ADDRESS FAILED: "
)
+
msg
);
}
...
...
@@ -1717,7 +1733,7 @@ void GdbEngine::handleSetTargetAsync(const GdbResultRecord &record, const QVaria
void
GdbEngine
::
handleTargetRemote
(
const
GdbResultRecord
&
record
,
const
QVariant
&
)
{
if
(
record
.
resultClass
==
GdbResultDone
)
{
//postCommand(_("-exec-continue"), CB(handleExec
Run
));
//postCommand(_("-exec-continue"), CB(handleExec
Continue
));
handleAqcuiredInferior
();
m_autoContinue
=
true
;
}
else
if
(
record
.
resultClass
==
GdbResultError
)
{
...
...
@@ -1740,9 +1756,9 @@ void GdbEngine::stepExec()
setTokenBarrier
();
qq
->
notifyInferiorRunningRequested
();
if
(
qq
->
isReverseDebugging
())
postCommand
(
_
(
"reverse-step"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"reverse-step"
),
CB
(
handleExec
Continue
));
else
postCommand
(
_
(
"-exec-step"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"-exec-step"
),
CB
(
handleExec
Continue
));
}
void
GdbEngine
::
stepIExec
()
...
...
@@ -1750,16 +1766,16 @@ void GdbEngine::stepIExec()
setTokenBarrier
();
qq
->
notifyInferiorRunningRequested
();
if
(
qq
->
isReverseDebugging
())
postCommand
(
_
(
"reverse-stepi"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"reverse-stepi"
),
CB
(
handleExec
Continue
));
else
postCommand
(
_
(
"-exec-step-instruction"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"-exec-step-instruction"
),
CB
(
handleExec
Continue
));
}
void
GdbEngine
::
stepOutExec
()
{
setTokenBarrier
();
qq
->
notifyInferiorRunningRequested
();
postCommand
(
_
(
"-exec-finish"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"-exec-finish"
),
CB
(
handleExec
Continue
));
}
void
GdbEngine
::
nextExec
()
...
...
@@ -1767,9 +1783,9 @@ void GdbEngine::nextExec()
setTokenBarrier
();
qq
->
notifyInferiorRunningRequested
();
if
(
qq
->
isReverseDebugging
())
postCommand
(
_
(
"reverse-next"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"reverse-next"
),
CB
(
handleExec
Continue
));
else
postCommand
(
_
(
"-exec-next"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"-exec-next"
),
CB
(
handleExec
Continue
));
}
void
GdbEngine
::
nextIExec
()
...
...
@@ -1777,9 +1793,9 @@ void GdbEngine::nextIExec()
setTokenBarrier
();
qq
->
notifyInferiorRunningRequested
();
if
(
qq
->
isReverseDebugging
())
postCommand
(
_
(
"reverse-nexti"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"reverse-nexti"
),
CB
(
handleExec
Continue
));
else
postCommand
(
_
(
"exec-next-instruction"
),
CB
(
handleExec
Run
));
postCommand
(
_
(
"exec-next-instruction"
),
CB
(
handleExec
Continue
));
}
void
GdbEngine
::
runToLineExec
(
const
QString
&
fileName
,
int
lineNumber
)
...
...
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