Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Cygwin gdb refuses to be killed

Well, nobody likes to be killed, after all.
 
Here is the scenario:
 
- I am setting up a remote debug session. I use org.eclipse.cdt.debug.mi.core.MIPlugin.createCSession(String, String, File, int, String[], File, String, IProgressMonitor) to create the MISession. In cases where the connection to the debug target fails the MITargetSelect.getMIInfo() method throws a MIException which is caught like this:
 
  } catch (MIException e) {
   pgdb.destroy();
   throw e;
  }
pgdb.destroy() ultimately causes the Spawner to send some signals to the gdb process, but gdb does not like those. The gdb process remains in memory and causes 100% system load. I have to kill it off manually with the task manager.
 
Here is a quick hacky workaround:
 
  } catch (MIException e) {
   pgdb.getOutputStream().write("quit\n".getBytes());
   try {
    pgdb.waitFor();
   } catch (InterruptedException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
   }
   throw e;
  }
So if I ask gdb nicely to quit it works fine.
A clean solution needs some polishing and can't just call waitFor() without any precautions, but I'd like to put up two questions:
 
1) Anybody experience similar problems?
 
2) Wouldn't it be good to implement the create*Session() methods in a way so that we first ask gdb to quit nicely before trying to kill it?
 
3) Other suggestions how this can be fixed?
 
 
Thanks for reading this far. I have created https://bugs.eclipse.org/bugs/show_bug.cgi?id=168646 for the discussion.
 
 
Greetings,
 
 
 
Norbert Ploett
 
 
 

Back to the top