[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
RE: [cdt-dev] Cygwin gdb refuses to be killed
|
Hello Norbert
This scenario seems quite interesting and relevant for our
plug-in (HP C/C++ Remote developer plugin). Our plugin provides a way of doing
remote debugging on HP-UX box. For this gdb needs to be installed on the remote
system. The code for this plugin has also been submitted to CDT (https://bugs.eclipse.org/bugs/show_bug.cgi?id=168048).
We are able to successfully kill remote debug processes.
Can you give some test cases to reproduce the problem mentioned in your
mail. I would like to try those on our plugin.
Regards
Virender.
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?
Greetings,
Norbert
Ploett