Skip to content
GitLab
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
88a25204
Commit
88a25204
authored
Sep 29, 2009
by
hjk
Browse files
debugger: fix attaching to running process
parent
d5f76338
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/gdb/attachgdbadapter.cpp
View file @
88a25204
...
...
@@ -112,6 +112,13 @@ void AttachGdbAdapter::prepareInferior()
{
QTC_ASSERT
(
state
()
==
AdapterStarted
,
qDebug
()
<<
state
());
setState
(
InferiorPreparing
);
setState
(
InferiorPrepared
);
emit
inferiorPrepared
();
}
void
AttachGdbAdapter
::
startInferior
()
{
QTC_ASSERT
(
state
()
==
InferiorStarting
,
qDebug
()
<<
state
());
const
qint64
pid
=
startParameters
().
attachPID
;
m_engine
->
postCommand
(
_
(
"attach %1"
).
arg
(
pid
),
CB
(
handleAttach
));
// Task 254674 does not want to remove them
...
...
@@ -120,31 +127,19 @@ void AttachGdbAdapter::prepareInferior()
void
AttachGdbAdapter
::
handleAttach
(
const
GdbResponse
&
response
)
{
QTC_ASSERT
(
state
()
==
Inferior
Prep
aring
,
qDebug
()
<<
state
());
QTC_ASSERT
(
state
()
==
Inferior
St
ar
t
ing
,
qDebug
()
<<
state
());
if
(
response
.
resultClass
==
GdbResultDone
)
{
setState
(
InferiorPrepared
);
emit
inferiorPrepared
();
setState
(
InferiorStopped
);
debugMessage
(
_
(
"INFERIOR STARTED"
));
showStatusMessage
(
tr
(
"Attached to stopped inferior."
));
m_engine
->
updateAll
();
}
else
if
(
response
.
resultClass
==
GdbResultError
)
{
QString
msg
=
__
(
response
.
data
.
findChild
(
"msg"
).
data
());
setState
(
InferiorPreparationFailed
);
emit
inferior
Preparation
Failed
(
msg
);
emit
inferior
Start
Failed
(
msg
);
}
}
void
AttachGdbAdapter
::
startInferior
()
{
QTC_ASSERT
(
state
()
==
InferiorStarting
,
qDebug
()
<<
state
());
#if 1
setState
(
InferiorStopped
);
debugMessage
(
_
(
"INFERIOR STARTED"
));
showStatusMessage
(
tr
(
"Attached to stopped inferior."
));
#else
// continue on attach
setState
(
InferiorRunningRequested
);
m_engine
->
postCommand
(
_
(
"-exec-continue"
),
CB
(
handleContinue
));
#endif
}
void
AttachGdbAdapter
::
handleContinue
(
const
GdbResponse
&
response
)
{
QTC_ASSERT
(
state
()
==
InferiorStarting
,
qDebug
()
<<
state
());
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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