diff --git a/src/Cutter.cpp b/src/Cutter.cpp index 1205f11b..9b4a2b16 100644 --- a/src/Cutter.cpp +++ b/src/Cutter.cpp @@ -759,6 +759,7 @@ void CutterCore::setRegister(QString regName, QString regValue) void CutterCore::startDebug() { + offsetPriorDebugging = getOffset(); cmd("ood"); emit registersChanged(); emit changeDebugView(); @@ -769,7 +770,7 @@ void CutterCore::stopDebug() // @TODO should first obtain correct signal to send. // Also, we do a ds since otherwise the process does not die. cmd("dk 9; ds; e cfg.debug = false; oo"); - seek(tr("main")); + seek(offsetPriorDebugging); emit changeDefinedView(); } diff --git a/src/Cutter.h b/src/Cutter.h index c72865de..91ae422a 100644 --- a/src/Cutter.h +++ b/src/Cutter.h @@ -590,9 +590,9 @@ private: MemoryWidgetType memoryWidgetPriority; QString notes; - RCore *core_; AsyncTaskManager *asyncTaskManager; + RVA offsetPriorDebugging = RVA_INVALID; QList plugins; }; diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index e853ae87..27b38ca3 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -545,7 +545,8 @@ void MainWindow::restoreDocks() addExtraWidget(stackDock); splitDockWidget(stackDock, registersDock, Qt::Vertical); splitDockWidget(stackDock, backtraceDock, Qt::Vertical); - splitDockWidget(stackDock, memoryMapDock, Qt::Vertical); + // MemoryMap widget goes in the center tabs + tabifyDockWidget(dashboardDock, memoryMapDock); #ifdef CUTTER_ENABLE_JUPYTER tabifyDockWidget(dashboardDock, jupyterDock); #endif @@ -627,7 +628,8 @@ void MainWindow::showDebugDocks() searchDock, stackDock, registersDock, - backtraceDock + backtraceDock, + memoryMapDock }; for (auto w : dockWidgets) { if (debugDocks.contains(w)) { @@ -682,13 +684,15 @@ void MainWindow::resetToDebugLayout() showDebugDocks(); disassemblyDock->raise(); - // ugly workaround to set the default widths of functions + // ugly workaround to set the default widths of functions/stack // if anyone finds a way to do this cleaner that also works, feel free to change it! - auto restoreFunctionDock = qhelpers::forceWidth(functionsDock->widget(), 200); + auto restoreFunctionDock = qhelpers::forceWidth(functionsDock->widget(), 150); + auto restoreStackDock = qhelpers::forceWidth(stackDock->widget(), 350); qApp->processEvents(); restoreFunctionDock.restoreWidth(functionsDock->widget()); + restoreStackDock.restoreWidth(stackDock->widget()); Core()->setMemoryWidgetPriority(CutterCore::MemoryWidgetType::Disassembly); } @@ -913,6 +917,7 @@ void MainWindow::changeDefinedView() readSettings(); setCorner(Qt::TopLeftCorner, Qt::LeftDockWidgetArea); setCorner(Qt::BottomLeftCorner, Qt::LeftDockWidgetArea); + setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); } void MainWindow::mousePressEvent(QMouseEvent *event)