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()
{
if (!refreshDeferrer->attemptRefresh(nullptr)) {
if (!refreshDeferrer->attemptRefresh(nullptr) || Core()->isDebugTaskInProgress()) {
return;
}
setBacktraceGrid();
}

View File

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

View File

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

View File

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

View File

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

View File

@ -291,6 +291,12 @@ QList<QString> VisualNavbar::sectionsForAddress(RVA address)
QString VisualNavbar::toolTipForAddress(RVA 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);
if (sections.count()) {
ret += "\nSections: \n";