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
Tobias Hunger
qt-creator
Commits
5a75276f
Commit
5a75276f
authored
Apr 28, 2011
by
Friedemann Kleint
Browse files
Debugger: Use base class PID mechanism in CDB.
Fix base engine to raise app only in applicable modes.
parent
422da36d
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/cdb/cdbengine.cpp
View file @
5a75276f
...
...
@@ -425,7 +425,6 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp,
m_tokenPrefix
(
"<token>"
),
m_options
(
options
),
m_effectiveStartMode
(
NoStartMode
),
m_inferiorPid
(
0
),
m_accessible
(
false
),
m_specialStopMode
(
NoSpecialStop
),
m_nextCommandToken
(
0
),
...
...
@@ -453,7 +452,7 @@ CdbEngine::CdbEngine(const DebuggerStartParameters &sp,
void
CdbEngine
::
init
()
{
m_effectiveStartMode
=
NoStartMode
;
m_i
nferiorPid
=
0
;
notifyI
nferiorPid
(
0
)
;
m_accessible
=
false
;
m_specialStopMode
=
NoSpecialStop
;
m_nextCommandToken
=
0
;
...
...
@@ -1117,7 +1116,7 @@ void CdbEngine::doContinueInferior()
bool
CdbEngine
::
canInterruptInferior
()
const
{
return
m_effectiveStartMode
!=
AttachToRemote
&&
m_
inferiorPid
;
return
m_effectiveStartMode
!=
AttachToRemote
&&
inferiorPid
()
;
}
void
CdbEngine
::
interruptInferior
()
...
...
@@ -1150,10 +1149,10 @@ void CdbEngine::doInterruptInferior(SpecialStopMode sm)
const
SpecialStopMode
oldSpecialMode
=
m_specialStopMode
;
m_specialStopMode
=
sm
;
QString
errorMessage
;
showMessage
(
QString
::
fromLatin1
(
"Interrupting process %1..."
).
arg
(
m_
inferiorPid
),
LogMisc
);
if
(
!
winDebugBreakProcess
(
m_
inferiorPid
,
&
errorMessage
))
{
showMessage
(
QString
::
fromLatin1
(
"Interrupting process %1..."
).
arg
(
inferiorPid
()
),
LogMisc
);
if
(
!
winDebugBreakProcess
(
inferiorPid
()
,
&
errorMessage
))
{
m_specialStopMode
=
oldSpecialMode
;
showMessage
(
QString
::
fromLatin1
(
"Cannot interrupt process %1: %2"
).
arg
(
m_
inferiorPid
).
arg
(
errorMessage
),
LogError
);
showMessage
(
QString
::
fromLatin1
(
"Cannot interrupt process %1: %2"
).
arg
(
inferiorPid
()
).
arg
(
errorMessage
),
LogError
);
}
#else
Q_UNUSED
(
sm
)
...
...
@@ -1594,8 +1593,7 @@ void CdbEngine::reloadFullStack()
void
CdbEngine
::
handlePid
(
const
CdbExtensionCommandPtr
&
reply
)
{
if
(
reply
->
success
)
{
m_inferiorPid
=
reply
->
reply
.
toUInt
();
showMessage
(
QString
::
fromLatin1
(
"Inferior pid: %1."
).
arg
(
m_inferiorPid
),
LogMisc
);
notifyInferiorPid
(
reply
->
reply
.
toULongLong
());
STATE_DEBUG
(
state
(),
Q_FUNC_INFO
,
__LINE__
,
"notifyInferiorSetupOk"
)
notifyInferiorSetupOk
();
}
else
{
...
...
src/plugins/debugger/cdb/cdbengine.h
View file @
5a75276f
...
...
@@ -249,7 +249,6 @@ private:
QScopedPointer
<
Utils
::
ConsoleProcess
>
m_consoleStub
;
DebuggerStartMode
m_effectiveStartMode
;
QByteArray
m_outputBuffer
;
unsigned
long
m_inferiorPid
;
//! Debugger accessible (expecting commands)
bool
m_accessible
;
SpecialStopMode
m_specialStopMode
;
...
...
src/plugins/debugger/debuggerengine.cpp
View file @
5a75276f
...
...
@@ -291,6 +291,7 @@ DebuggerEngine::DebuggerEngine(const DebuggerStartParameters &startParameters,
DebuggerEngine
*
parentEngine
)
:
d
(
new
DebuggerEnginePrivate
(
this
,
parentEngine
,
startParameters
))
{
d
->
m_inferiorPid
=
0
;
}
DebuggerEngine
::~
DebuggerEngine
()
...
...
@@ -1167,11 +1168,16 @@ bool DebuggerEngine::debuggerActionsEnabled(DebuggerState state)
void
DebuggerEngine
::
notifyInferiorPid
(
qint64
pid
)
{
showMessage
(
tr
(
"Taking notice of pid %1"
).
arg
(
pid
));
if
(
d
->
m_inferiorPid
==
pid
)
return
;
d
->
m_inferiorPid
=
pid
;
QTimer
::
singleShot
(
0
,
d
,
SLOT
(
raiseApplication
()));
if
(
pid
)
{
showMessage
(
tr
(
"Taking notice of pid %1"
).
arg
(
pid
));
if
(
d
->
m_startParameters
.
startMode
==
StartInternal
||
d
->
m_startParameters
.
startMode
==
StartExternal
||
d
->
m_startParameters
.
startMode
==
AttachExternal
)
QTimer
::
singleShot
(
0
,
d
,
SLOT
(
raiseApplication
()));
}
}
qint64
DebuggerEngine
::
inferiorPid
()
const
...
...
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