From a1ffc4a19f466ba08fbccc741b5b264351e75ca5 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 28 Jul 2011 14:47:49 +0200 Subject: [PATCH] Debugger: Fix crash in stack frame layout display. The option is also enabled when the index is invalid. Task-number: QTCREATORBUG-5650 Change-Id: If1efb900d29724e5c43db1589c797197fae67bd2 Reviewed-on: http://codereview.qt.nokia.com/2342 Reviewed-by: Qt Sanity Bot Reviewed-by: Christian Stenger --- src/plugins/debugger/watchwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/debugger/watchwindow.cpp b/src/plugins/debugger/watchwindow.cpp index 9bad66fcf90..51eabe54ba8 100644 --- a/src/plugins/debugger/watchwindow.cpp +++ b/src/plugins/debugger/watchwindow.cpp @@ -416,6 +416,7 @@ static inline void addStackLayoutMemoryView(DebuggerEngine *engine, QWidget *parent) { typedef QPair RegisterValueNamePair; + QTC_ASSERT(engine && m, return ;) // Determine suitable address range from locals quint64 start = Q_UINT64_C(0xFFFFFFFFFFFFFFFF); @@ -895,7 +896,7 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev) } else if (act == actOpenMemoryViewAtPointerValue) { addVariableMemoryView(currentEngine(), true, mi0, true, ev->globalPos(), this); } else if (act == actOpenMemoryEditorStackLayout) { - addStackLayoutMemoryView(currentEngine(), false, mi0.model(), ev->globalPos(), this); + addStackLayoutMemoryView(currentEngine(), false, model(), ev->globalPos(), this); } else if (act == actSetWatchpointAtVariableAddress) { setWatchpointAtAddress(address, size); } else if (act == actSetWatchpointAtPointerValue) {