Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [cdt-dev] [DSF-GDB] The "Terminate" button in debugviewnotsending a "kill"

So if you select the launch in the debug view and then press
Terminate, it works, right?

When you have other contexts of the debug view selected,
pressing terminate will call  DsfTerminateCommand, which 
eventually call IGDBControl.terminate().  You can look
there to see what is missing for your case (or all cases).

Whenever you want to see what an action calls, you can
look at GdbAdapterFactory which sets all the actions
for DSF-GDB contexts

Marc


> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Andy Jin
> Sent: Tuesday, July 20, 2010 4:30 PM
> To: CDT General developers list.
> Subject: RE: [cdt-dev] [DSF-GDB] The "Terminate" button in 
> debugviewnotsending a "kill"
> 
> Thanks for the detailed analysis. Actually I had tried adding the
> inferior to the launch but it didn't help. Technically I am not an
> "attach" session type but rather a "remote" session type.
> 
> The strange symptom I see is the "Terminate" button does not call the
> debug core Launch.terminate() method at all. It behaves like the
> button's action is overridden so now it does not invoke the
> "org.eclipse.debug.internal.core.commands.TerminateCommand" as it does
> in CDI launch.
> 
> -----Original Message-----
> From: cdt-dev-bounces@xxxxxxxxxxx [mailto:cdt-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Marc Khouzam
> Sent: July 20, 2010 3:54 PM
> To: 'CDT General developers list.'
> Subject: RE: [cdt-dev] [DSF-GDB] The "Terminate" button in
> debugviewnotsending a "kill"
> 
> Ok, I think I rembember now.
> 
> I think this method is called by the platform when the launch
> is terminated.  Probably  Launch#terminate() calling
> RuntimeProcess#terminate(), which calls process.destroy().
> 
> The problem is that for an 'attach' session and a 'core'
> session, we don't include in the inferior in the launch,
> so launch#terminate() probably never destroys it.
> 
> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=271795
> for the post-mortem (core) type.
> 
> The reason we don't add the inferior process to the launch
> for an 'attach' session is for Multi-Process debugging.
> In that case, there are many inferiors, and they can change.
> See https://bugs.eclipse.org/bugs/show_bug.cgi?id=237308
> 
> I guess we will have to figure out what behavior you want
> in your case, which seems to be the old single-process
> approach of having a single inferior that is killed when
> detaching.  We can add a protected method to GdbLaunchDelegate
> to allow you to override if we add the inferior to the launch
> or not.  Please see GdbLaunchDelegate that calls
> GdbLaunch#addInferiorProcess()
> 
> Go ahead and open a bug about it.
> 
> Marc
> 
> 
> > -----Original Message-----
> > From: cdt-dev-bounces@xxxxxxxxxxx 
> > [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Andy Jin
> > Sent: Tuesday, July 20, 2010 3:39 PM
> > To: CDT General developers list.
> > Subject: RE: [cdt-dev] [DSF-GDB] The "Terminate" button in 
> > debug viewnotsending a "kill"
> > 
> > Who is calling the GDBIneriorProcess.destroy() and when is it 
> > called. I
> > put a breakpoint there but I don't see that method being 
> called at any
> > "shutdown" steps. 
> > 
> > I see GDBControl is only class managing the 
> GDBInferiorProcess but it
> > only calls its dispose() method in the shutdown steps.
> > 
> > -----Original Message-----
> > From: cdt-dev-bounces@xxxxxxxxxxx 
> [mailto:cdt-dev-bounces@xxxxxxxxxxx]
> > On Behalf Of Marc Khouzam
> > Sent: July 20, 2010 1:18 PM
> > To: 'CDT General developers list.'
> > Subject: RE: [cdt-dev] [DSF-GDB] The "Terminate" button in debug
> > viewnotsending a "kill"
> > 
> > 
> > In MIInferiorProcess#doDestroy() we send a 'kill' (CLIExecAbort).
> > This is called from GDBInferiorProcess.
> > Can you see why this is not triggered in your case?
> >  
> > 
> > > -----Original Message-----
> > > From: cdt-dev-bounces@xxxxxxxxxxx 
> > > [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Andy Jin
> > > Sent: Tuesday, July 20, 2010 12:41 PM
> > > To: CDT General developers list.
> > > Subject: RE: [cdt-dev] [DSF-GDB] The "Terminate" button in 
> > > debug view notsending a "kill"
> > > 
> > > Hi, Marc,
> > > 
> > > It's similar but not quite the same. That bug is focusing on 
> > > GDBServer and change the GDBServer protocol from 
> > > "extended-remote" to "remote". The patch attached to that bug 
> > > works for GDBServer.
> > > 
> > > The problem is that not everyone uses GDBServer in target 
> > > side. For us we don't but use a proprietary target agent to 
> > > transfer the process to the target and launch it in "stop" 
> > > mode. The host side GDB attaches to the process to start 
> > > debugging. Without sending the GDB "kill" command no one will 
> > > kill the inferior when the session terminates.
> > > 
> > > I guess we need the flexibility to be able to explicitly 
> > > sending the "kill" command.
> > > 
> > > Thanks,
> > > Andy
> > > 
> > > -----Original Message-----
> > > From: cdt-dev-bounces@xxxxxxxxxxx on behalf of Marc Khouzam
> > > Sent: Tue 20/07/2010 12:00 PM
> > > To: 'CDT General developers list.'
> > > Subject: RE: [cdt-dev] [DSF--GDB] The "Terminate" button in 
> > > debug view notsending a "kill"
> > >  
> > >  
> > > 
> > > > -----Original Message-----
> > > > From: cdt-dev-bounces@xxxxxxxxxxx 
> > > > [mailto:cdt-dev-bounces@xxxxxxxxxxx] On Behalf Of Andy Jin
> > > > Sent: Tuesday, July 20, 2010 11:44 AM
> > > > To: cdt-dev@xxxxxxxxxxx
> > > > Subject: [cdt-dev] [DSF--GDB] The "Terminate" button in debug 
> > > > view not sending a "kill"
> > > > 
> > > > In my remote process launch using CDI, the "Terminate" 
> > button in the
> > > > debug view invokes the Eclipse debug core
> > > > "org.eclipse.debug.internal.core.commands.TerminateCommand". The
> > > > "TerminateCommand" class invokes the CDI debug target 
> > "terminate()"
> > > > method and eventually invokes the
> > > > "org.eclipse.cdt.debug.mi.core.MIInferior.terminate()" 
> > method which
> > > > sends a GDB "kill" CLI command to the inferior to kill it before
> > > > proceeding to stop the debug session.
> > > > 
> > > > In DSF/GDB, the "Terminate" button does not go through the 
> > > debug core
> > > > "TerminateCommand" and DSF does not send a "kill" to 
> inferior. The
> > > > result is when the session is stopped, GDB detaches from 
> > > the inferior
> > > > thus the process continues to run. This is not the intended 
> > > > behavior of
> > > > the "Terminiate" button.
> > > > 
> > > > I understand in DSF/GDB remote launch using GDBServer 
> > extend-remote
> > > > mode, GDBServer will kill the inferior because GDBServer 
> > > > starts it. But
> > > > in our environment we don't use GDBServer. The inferior is 
> > > > started by a
> > > > target agent which does not get involved after the debug 
> > session is
> > > > established. Without the "kill" command the interior will 
> > > just run to
> > > > finish.
> > > 
> > > Could this be like
> > > https://bugs.eclipse.org/bugs/show_bug.cgi?id=252283
> > > 
> > > We use the extended-remote when we attach to an already running
> > > remote process.  In that case we don't want to automatically kill 
> > > the remote process when we stop debugging.
> > > 
> > > Using 'remote' instead will kill the inferior, and we use this
> > > when we do remote debugging to an process that was started
> > > specifically to be debugged.
> > > 
> > > 
> > > > 
> > > > Does DSF/GDB override the "Terminate" button action and not 
> > > using the
> > > > debug core "TerminateCommand" anymore? If yes, where can 
> > I insert a
> > > > "kill" CLI command e.g. instantiate a CLIExecAbort command?
> > > > 
> > > > Thanks,
> > > > Andy
> > > > _______________________________________________
> > > > cdt-dev mailing list
> > > > cdt-dev@xxxxxxxxxxx
> > > > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> > > > _______________________________________________
> > > cdt-dev mailing list
> > > cdt-dev@xxxxxxxxxxx
> > > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> > > 
> > > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> > _______________________________________________
> > cdt-dev mailing list
> > cdt-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/cdt-dev
> > _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> _______________________________________________
> cdt-dev mailing list
> cdt-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/cdt-dev
> 

Back to the top