From 5b127dd088b93f1ec8fc88966e015aaf40f6a4b4 Mon Sep 17 00:00:00 2001 From: David Schulz Date: Tue, 8 Oct 2019 06:38:27 +0200 Subject: [PATCH 1/2] Debugger: Fix out of memory crash when receiving regular output Change-Id: Icda28ec56c191e62812a4e5219a1df902c5e60a1 Fixes: QTCREATORBUG-22733 Reviewed-by: Christian Stenger --- src/plugins/debugger/logwindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/logwindow.cpp b/src/plugins/debugger/logwindow.cpp index e6717091615..1c5d9fd487a 100644 --- a/src/plugins/debugger/logwindow.cpp +++ b/src/plugins/debugger/logwindow.cpp @@ -552,8 +552,14 @@ void LogWindow::showOutput(int channel, const QString &output) out.append(nchar); m_queuedOutput.append(out); - m_outputTimer.setSingleShot(true); - m_outputTimer.start(80); + // flush the output if it exceeds 16k to prevent out of memory exceptions on regular output + if (m_queuedOutput.size() > 16 * 1024) { + m_outputTimer.stop(); + doOutput(); + } else { + m_outputTimer.setSingleShot(true); + m_outputTimer.start(80); + } } void LogWindow::doOutput() From f0bd0a8baf5a3579a8b06fe6a8ea3cb41c9e59be Mon Sep 17 00:00:00 2001 From: Antonio Di Monaco Date: Mon, 7 Oct 2019 11:19:40 +0200 Subject: [PATCH 2/2] Debugger: Fix missing watch highlight when the value changes This patch fixes a regression introduced by e95fd876aa62614fa991ab42c343adbb81acec73 Change-Id: I8cb277858ef6c63cd26c03417f9dfeb99d96cb45 Reviewed-by: Christian Stenger --- src/plugins/debugger/watchhandler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/plugins/debugger/watchhandler.cpp b/src/plugins/debugger/watchhandler.cpp index 66d73e84bf9..07c43daafaa 100644 --- a/src/plugins/debugger/watchhandler.cpp +++ b/src/plugins/debugger/watchhandler.cpp @@ -907,9 +907,9 @@ static QColor valueColor(const WatchItem *item, int column) color = Theme::Debugger_WatchItem_ValueInvalid; else if (!model->m_contentsValid && !item->isInspect()) color = Theme::Debugger_WatchItem_ValueInvalid; - else if (column == 1 && item->value.isEmpty()) // This might still show 0x... + else if (item->value.isEmpty()) // This might still show 0x... color = Theme::Debugger_WatchItem_ValueInvalid; - else if (column == 1 && item->value != model->m_valueCache.value(item->iname)) + else if (item->value != model->m_valueCache.value(item->iname)) color = Theme::Debugger_WatchItem_ValueChanged; } }