Prevent the update of some widgets while debug task is in progress to avoid freezing

This commit is contained in:
yossizap 2019-12-20 12:20:27 +00:00 committed by Florian Märkl
parent 2fb59b26ad
commit 96baaeada6
6 changed files with 18 additions and 11 deletions

View File

@ -38,9 +38,10 @@ BacktraceWidget::~BacktraceWidget() {}
void BacktraceWidget::updateContents() void BacktraceWidget::updateContents()
{ {
if (!refreshDeferrer->attemptRefresh(nullptr)) { if (!refreshDeferrer->attemptRefresh(nullptr) || Core()->isDebugTaskInProgress()) {
return; return;
} }
setBacktraceGrid(); setBacktraceGrid();
} }

View File

@ -72,16 +72,16 @@ void ProcessesWidget::updateContents()
return; return;
} }
if (Core()->currentlyDebugging) { if (!Core()->currentlyDebugging) {
setProcessesGrid();
} else {
// Remove rows from the previous debugging session // Remove rows from the previous debugging session
modelProcesses->removeRows(0, modelProcesses->rowCount()); modelProcesses->removeRows(0, modelProcesses->rowCount());
return;
} }
if (Core()->isDebugTaskInProgress() || !Core()->currentlyDebugging) { if (Core()->isDebugTaskInProgress()) {
ui->viewProcesses->setDisabled(true); ui->viewProcesses->setDisabled(true);
} else { } else {
setProcessesGrid();
ui->viewProcesses->setDisabled(false); ui->viewProcesses->setDisabled(false);
} }
} }

View File

@ -237,7 +237,7 @@ void SectionsWidget::initConnects()
void SectionsWidget::refreshSections() void SectionsWidget::refreshSections()
{ {
if (!sectionsRefreshDeferrer->attemptRefresh(nullptr)) { if (!sectionsRefreshDeferrer->attemptRefresh(nullptr) || Core()->isDebugTaskInProgress()) {
return; return;
} }
sectionsModel->beginResetModel(); sectionsModel->beginResetModel();

View File

@ -58,7 +58,7 @@ StackWidget::~StackWidget() = default;
void StackWidget::updateContents() void StackWidget::updateContents()
{ {
if (!refreshDeferrer->attemptRefresh(nullptr)) { if (!refreshDeferrer->attemptRefresh(nullptr) || Core()->isDebugTaskInProgress()) {
return; return;
} }

View File

@ -71,16 +71,16 @@ void ThreadsWidget::updateContents()
return; return;
} }
if (Core()->currentlyDebugging) { if (!Core()->currentlyDebugging) {
setThreadsGrid();
} else {
// Remove rows from the previous debugging session // Remove rows from the previous debugging session
modelThreads->removeRows(0, modelThreads->rowCount()); modelThreads->removeRows(0, modelThreads->rowCount());
return;
} }
if (Core()->isDebugTaskInProgress() || !Core()->currentlyDebugging) { if (Core()->isDebugTaskInProgress()) {
ui->viewThreads->setDisabled(true); ui->viewThreads->setDisabled(true);
} else { } else {
setThreadsGrid();
ui->viewThreads->setDisabled(false); ui->viewThreads->setDisabled(false);
} }
} }

View File

@ -291,6 +291,12 @@ QList<QString> VisualNavbar::sectionsForAddress(RVA address)
QString VisualNavbar::toolTipForAddress(RVA address) QString VisualNavbar::toolTipForAddress(RVA address)
{ {
QString ret = "Address: " + RAddressString(address); QString ret = "Address: " + RAddressString(address);
// Don't append sections when a debug task is in progress to avoid freezing the interface
if (Core()->isDebugTaskInProgress()) {
return ret;
}
auto sections = sectionsForAddress(address); auto sections = sectionsForAddress(address);
if (sections.count()) { if (sections.count()) {
ret += "\nSections: \n"; ret += "\nSections: \n";