summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhjk <hjk@theqtcompany.com>2015-09-16 10:37:47 +0200
committerhjk <hjk@theqtcompany.com>2015-09-18 07:04:43 +0000
commit14f607e04db1d3ad3d553964c2c42059b3442287 (patch)
treebd30f3735440ff3e5d8616135933c5d553d4b592 /src
parentd85979f269c08e80264c7da3ed94612067f4db05 (diff)
downloadqt-creator-14f607e04db1d3ad3d553964c2c42059b3442287.tar.gz
Debugger: Use DebuggerEngine::checkState also in core adapter
... instead of plain asserts. Less clutter on the user code side, more information if it triggers. Change-Id: I621e8adc168ceea64df6e39e0c95df4218f58d34 Reviewed-by: Niels Weber <niels.weber@theqtcompany.com>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/debugger/gdb/coregdbadapter.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/debugger/gdb/coregdbadapter.cpp b/src/plugins/debugger/gdb/coregdbadapter.cpp
index 8b71bcb707..1408a2f6d6 100644
--- a/src/plugins/debugger/gdb/coregdbadapter.cpp
+++ b/src/plugins/debugger/gdb/coregdbadapter.cpp
@@ -49,6 +49,7 @@ namespace Debugger {
namespace Internal {
#define CB(callback) [this](const DebuggerResponse &r) { callback(r); }
+#define CHECK_STATE(s) do { checkState(s, __FILE__, __LINE__); } while (0)
///////////////////////////////////////////////////////////////////////
//
@@ -207,7 +208,7 @@ void GdbCoreEngine::writeCoreChunk()
void GdbCoreEngine::setupInferior()
{
- QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
+ CHECK_STATE(InferiorSetupRequested);
// Do that first, otherwise no symbols are loaded.
QFileInfo fi(m_executable);
QByteArray path = fi.absoluteFilePath().toLocal8Bit();
@@ -217,7 +218,7 @@ void GdbCoreEngine::setupInferior()
void GdbCoreEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
{
- QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
+ CHECK_STATE(InferiorSetupRequested);
QString core = coreFileName();
if (response.resultClass == ResultDone) {
showMessage(tr("Symbols found."), StatusBar);
@@ -234,13 +235,13 @@ void GdbCoreEngine::handleFileExecAndSymbols(const DebuggerResponse &response)
void GdbCoreEngine::runEngine()
{
- QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
+ CHECK_STATE(EngineRunRequested);
postCommand("target core " + coreFileName().toLocal8Bit(), NoFlags, CB(handleTargetCore));
}
void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response)
{
- QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
+ CHECK_STATE(EngineRunRequested);
notifyEngineRunOkAndInferiorUnrunnable();
if (response.resultClass == ResultDone) {
showMessage(tr("Attached to core."), StatusBar);
@@ -258,6 +259,7 @@ void GdbCoreEngine::handleTargetCore(const DebuggerResponse &response)
void GdbCoreEngine::handleRoundTrip(const DebuggerResponse &response)
{
+ CHECK_STATE(InferiorUnrunnable);
Q_UNUSED(response);
loadSymbolsForStack();
handleStop2();