Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Debug process does not terminate when invoked from eclipse

Hi folks,

here is something strange I encountered when trying to set up a gdb -->
gdbserver session all from within eclipse.

Scenario 1)
First I do the session from the command line, like so 

Command shell 1> gdbserver localhost:8799 myProgram

Command shell 2> gdb myProgram
(gdb) target remote localhost:8799
(gdb) c

This makes my program run. When the program terminates command shell 1
(with the gdbserver process) returns to the command prompt, i.e. the
gdbserver terminates also.
Similarly, when I have a breakpoint in my program and give the kill
command then the gdbserver kills the inferior and terminates.

Scenario 2)
For eclipse we are writing a new debugger which extends GDBCDIDebugger
and which starts both the gdbserver process and then the gdb session.
The commands to start the gdbserver process are essentially:

================snip=================
Process			procDebugServer	=
ProcessFactory.getFactory().exec(astrArg);
ILaunch			launchDebugger	= super.getLauch();
IProcess		procDebugger	=
DebugPlugin.newProcess(launchDebugger,
	
procDebugServer,
	
"Debug Server Process"); 
================snap=================

When I run the debug session from eclipse then my program runs and
terminates in exactly the same way but the gdbserver remains alive,
apparently doing nothing.
Similarly, when I have a breakpoint in my program and klick on
"Terminate" the underlying gdb gets a kill and -gdb-exit command and
terminates, but the gdbserver does not.
In both cases I have to manually kill the gdbserver.


Scenario 3)
Start the gdbserver manually and configure a C/C++ Local Application
Launch. The behavior in this case is the same as in Scenario 1), i.e.
the gdbserver terminates when the inferior exits.

So it seems I am doing something wrong that the standard C/C++ Local
launch is doing right.
But what is it? Can anybody give any hints?


Thanks,


Norbert Ploett



Back to the top