Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 345018 - Terminating GDB can be called multiple times and try to kill GDB more than once
Summary: Terminating GDB can be called multiple times and try to kill GDB more than once
Status: RESOLVED FIXED
Alias: None
Product: CDT
Classification: Tools
Component: cdt-debug-dsf-gdb (show other bugs)
Version: 8.0   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 8.0   Edit
Assignee: Marc Khouzam CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-06 15:26 EDT by Marc Khouzam CLA
Modified: 2011-05-06 16:23 EDT (History)
2 users (show)

See Also:


Attachments
Fix (2.18 KB, patch)
2011-05-06 15:27 EDT, Marc Khouzam CLA
marc.khouzam: iplog-
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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