Skip to content

Commit fc9ce27

Browse files
LiHua000deepin-mozart
authored andcommitted
fix: [python] issues of debug python program
1.close project can`t quit debugging state 2.Pausing the Python debugging process may cause some exceptions Log: as title
1 parent 8e61351 commit fc9ce27

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/plugins/debugger/dap/dapdebugger.cpp

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,7 @@ void DAPDebugger::registerDapHandlers()
635635
|| event.reason == "function-finished"
636636
|| event.reason == "end-stepping-range"
637637
|| event.reason == "goto"
638+
|| event.reason == "pause" // python send it when pauseing
638639
|| signalStopped
639640
|| (event.reason == "unknown" && attaching)) {
640641
//when attaching to running program . it won`t receive initialized event and event`s reason is "unknwon"
@@ -650,7 +651,6 @@ void DAPDebugger::registerDapHandlers()
650651
updateThreadList(curThreadID, threads);
651652
switchCurrentThread(static_cast<int>(d->threadId));
652653
}
653-
QApplication::setActiveWindow(d->variablesPane);
654654
updateRunState(DAPDebugger::RunState::kStopped);
655655
} else if (event.reason == "exception") {
656656
QString name;
@@ -854,8 +854,8 @@ void DAPDebugger::handleEvents(const dpf::Event &event)
854854
} else if (event.data() == project.deletedProject.name) {
855855
auto prjInfo = event.property("projectInfo").value<dpfservice::ProjectInfo>();
856856
if (d->projectInfo.isSame(prjInfo)) {
857-
d->activeProjectKitName.clear();
858857
abortDebug();
858+
d->activeProjectKitName.clear();
859859
}
860860
} else if (event.data() == editor.switchedFile.name) {
861861
QString filePath = event.property(editor.switchedFile.pKeys[0]).toString();
@@ -1293,13 +1293,15 @@ void DAPDebugger::exitDebug()
12931293
{
12941294
// Change UI.
12951295
editor.removeDebugLine();
1296-
d->variablesPane->hide();
1296+
d->watchsModel.clear();
1297+
d->localsModel.clear();
12971298

12981299
d->localsModel.clear();
12991300
d->stackModel.removeAll();
13001301

13011302
d->threadId = 0;
13021303

1304+
d->threads.clear();
13031305
d->threadSelector->clear();
13041306
}
13051307

@@ -1316,7 +1318,6 @@ void DAPDebugger::updateRunState(DAPDebugger::RunState state)
13161318
case kRunning:
13171319
case kCustomRunning:
13181320
d->pausing = false;
1319-
QMetaObject::invokeMethod(d->variablesPane, "show");
13201321
break;
13211322
case kStopped:
13221323
break;
@@ -1345,9 +1346,6 @@ QString DAPDebugger::requestBuild()
13451346

13461347
void DAPDebugger::start()
13471348
{
1348-
if(!d->variablesPane->isVisible())
1349-
d->variablesPane->show();
1350-
13511349
auto &ctx = dpfInstance.serviceContext();
13521350
LanguageService *service = ctx.service<LanguageService>(LanguageService::name());
13531351
if (service) {

0 commit comments

Comments
 (0)