Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 345018

Summary: Terminating GDB can be called multiple times and try to kill GDB more than once
Product: [Tools] CDT Reporter: Marc Khouzam <marc.khouzam>
Component: cdt-debug-dsf-gdbAssignee: Marc Khouzam <marc.khouzam>
Status: RESOLVED FIXED QA Contact: Marc Khouzam <marc.khouzam>
Severity: normal    
Priority: P3 CC: cdtdoug, pawel.1.piech
Version: 8.0   
Target Milestone: 8.0   
Hardware: PC   
OS: Linux   
Whiteboard:
Attachments:
Description Flags
Fix marc.khouzam: iplog-

Description Marc Khouzam CLA 2011-05-06 15:26:43 EDT
While debugging some JUnit tests, I saw that the IGDBControl.terminate method can be called multiple times when we shutdown.  That method tries to send an -gdb-exit command to GDB and starts a Future to monitor GDB's death.  We should only do this once.

I saw three different calls to IGDBControl.terminate, that happened for the same shutdown:
  GDBBackendCLIProcess.destroy()
  GDBProcesses.terminate()
  GDBProcesses.eventDispatched(IExitedDMEvent e)
Same thing for the corresponding _7_0 classes.

If IGDBControl.terminate() has already been called, any new calls should simply return.  Actually, we could buffer the new RMs and only complete them once the terminate is finished, but there was no value in doing that right now, so I didn't bother, as it was more error-prone.

The attached patch simply completes the RM and returns.
Comment 1 Marc Khouzam CLA 2011-05-06 15:27:10 EDT
Created attachment 194980 [details]
Fix

Committed to HEAD.
Comment 2 Marc Khouzam CLA 2011-05-06 15:28:06 EDT
Fixed