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
1aef962e
Commit
1aef962e
authored
Jan 14, 2011
by
hjk
Browse files
debugger: first shot at combined cpp/qml stepping
parent
349ff0f1
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/debugger/debuggerengine.h
View file @
1aef962e
...
...
@@ -244,6 +244,9 @@ public:
bool
isMasterEngine
()
const
;
DebuggerEngine
*
masterEngine
()
const
;
virtual
bool
prepareForQmlBreak
()
{
return
false
;
}
virtual
void
handlePrepareForQmlBreak
()
{}
signals:
void
stateChanged
(
const
DebuggerState
&
state
);
void
updateViewsRequested
();
...
...
src/plugins/debugger/gdb/gdbengine.cpp
View file @
1aef962e
...
...
@@ -4502,6 +4502,24 @@ void GdbEngine::handleRemoteSetupFailed(const QString &message)
m_gdbAdapter
->
handleRemoteSetupFailed
(
message
);
}
bool
GdbEngine
::
prepareForQmlBreak
()
{
QTC_ASSERT
(
isSlaveEngine
(),
return
false
);
postCommand
(
"-break-insert -t qscriptfunction.cpp:82"
,
NeedsStop
,
CB
(
handleQmlBreakpoint
));
return
true
;
}
void
GdbEngine
::
handleQmlBreakpoint
(
const
GdbResponse
&
response
)
{
if
(
response
.
resultClass
==
GdbResultDone
)
{
qDebug
()
<<
"RESPONSE: "
<<
response
.
toString
();
}
QTC_ASSERT
(
masterEngine
(),
return
);
masterEngine
()
->
handlePrepareForQmlBreak
();
}
//
// Factory
//
...
...
src/plugins/debugger/gdb/gdbengine.h
View file @
1aef962e
...
...
@@ -517,6 +517,9 @@ private: ////////// View & Data Stuff //////////
void
setLocals
(
const
QList
<
GdbMi
>
&
locals
);
void
handleStackListArgumentsClassic
(
const
GdbResponse
&
response
);
bool
prepareForQmlBreak
();
void
handleQmlBreakpoint
(
const
GdbResponse
&
response
);
QSet
<
QByteArray
>
m_processedNames
;
//
...
...
src/plugins/debugger/qml/qmlcppengine.cpp
View file @
1aef962e
#include "qmlcppengine.h"
#include "debuggerstartparameters.h"
#include "qmlengine.h"
#include "debuggermainwindow.h"
#include "debuggercore.h"
#include
<qmljseditor/qmljseditorconstants
.h
>
#include
"qmlcppengine
.h
"
#include
<coreplugin/editormanager/editormanager
.h
>
#include
<coreplugin/editormanager/ieditor
.h
>
#include
"debuggercore
.h
"
#include
"debuggerstartparameters
.h
"
#include <utils/qtcassert.h>
#include <QtCore/QTimer>
namespace
Debugger
{
namespace
Internal
{
...
...
@@ -63,7 +57,7 @@ QmlCppEngine::QmlCppEngine(const DebuggerStartParameters &sp)
d
->
m_cppEngine
=
createGdbEngine
(
sp
,
this
);
}
else
{
QString
errorMessage
;
d
->
m_cppEngine
=
Debugger
::
Internal
::
createCdbEngine
(
sp
,
this
,
&
errorMessage
);
d
->
m_cppEngine
=
createCdbEngine
(
sp
,
this
,
&
errorMessage
);
if
(
!
d
->
m_cppEngine
)
{
qWarning
(
"%s"
,
qPrintable
(
errorMessage
));
return
;
...
...
@@ -219,6 +213,18 @@ void QmlCppEngine::detachDebugger()
}
void
QmlCppEngine
::
executeStep
()
{
if
(
d
->
m_activeEngine
==
d
->
m_qmlEngine
)
{
QTC_ASSERT
(
d
->
m_cppEngine
->
state
()
==
InferiorRunOk
,
/**/
);
if
(
d
->
m_cppEngine
->
prepareForQmlBreak
())
return
;
// Wait for call back.
}
notifyInferiorRunRequested
();
d
->
m_activeEngine
->
executeStep
();
}
void
QmlCppEngine
::
handlePrepareForQmlBreak
()
{
notifyInferiorRunRequested
();
d
->
m_activeEngine
->
executeStep
();
...
...
src/plugins/debugger/qml/qmlcppengine.h
View file @
1aef962e
...
...
@@ -94,6 +94,8 @@ private:
void
setState
(
DebuggerState
newState
,
bool
forced
=
false
);
void
slaveEngineStateChanged
(
DebuggerEngine
*
slaveEngine
,
DebuggerState
state
);
virtual
void
handlePrepareForQmlBreak
();
private:
QScopedPointer
<
QmlCppEnginePrivate
>
d
;
};
...
...
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