File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -338,7 +338,8 @@ bool GdbMiAdapter::Connect(const std::string& server, uint32_t port) {
338338 m_mi->SendCommand (" -interpreter-exec console \" add-symbol-file " +symbolFile+" \" " );
339339
340340 m_mi->SendCommand (" -file-exec-file " + inputFile);
341- std::string connectCmd = " -target-select extended-remote " + ipAddress + " :" + std::to_string (serverPort);
341+ // TODO: we should offer an option on whether or not to connect in extended mode
342+ std::string connectCmd = " -target-select remote " + ipAddress + " :" + std::to_string (serverPort);
342343
343344 auto result = m_mi->SendCommand (connectCmd, 1000 );
344345 m_connected = (result.command == " connected" );
@@ -548,13 +549,16 @@ void GdbMiAdapter::Stop()
548549
549550bool GdbMiAdapter::Quit ()
550551{
551- Detach ();
552- Stop ();
552+ if (m_mi && m_connected) InvokeBackendCommand (" kill" );
553553 m_connected = false ;
554554 m_targetRunningAtomic.store (false );
555555
556- LogInfo (" GDB MI adapter quit completed successfully" );
557- return true ;
556+ DebuggerEvent dbgevt;
557+ dbgevt.type = TargetExitedEventType;
558+ PostDebuggerEvent (dbgevt);
559+
560+ Stop ();
561+ return true ;
558562}
559563
560564bool GdbMiAdapter::Detach () {
@@ -566,6 +570,7 @@ bool GdbMiAdapter::Detach() {
566570 dbgevt.type = DetachedEventType;
567571 PostDebuggerEvent (dbgevt);
568572
573+ Stop ();
569574 return true ;
570575}
571576
You can’t perform that action at this time.
0 commit comments