Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » How to debug forked processes
How to debug forked processes [message #854739] Tue, 24 April 2012 03:47 Go to next message
Eclipse UserFriend
Hi,

I have a setup where a server calls fork() and then from the child process it will launch a program using execv();

My issue is once it has done this the forked process is not debuggable. I have tried enabling debug forked processes in the CDT settting (I am on indigo) but it doesn't work.

Is there some setting in the gdbinit or something to get this running?

Thanks
Re: How to debug forked processes [message #854747 is a reply to message #854739] Tue, 24 April 2012 03:57 Go to previous messageGo to next message
Eclipse UserFriend
Here are the requirements for multi-process debugging.
http://wiki.eclipse.org/CDT/User/FAQ#How_do_I_use_multi-process_debugging.3F
Re: How to debug forked processes [message #854763 is a reply to message #854747] Tue, 24 April 2012 04:13 Go to previous messageGo to next message
Eclipse UserFriend
hmm I have definitely tried the 2nd option of ticking the debug forked processes and it never hit any of the breakpoints in any of the forked processes.

I will try the disconnect and reconnect approach again tomorrrow, I am pretty sure I tried that as well.

thanks
Re: How to debug forked processes [message #854779 is a reply to message #854763] Tue, 24 April 2012 04:27 Go to previous messageGo to next message
Eclipse UserFriend
If it does not work you can have a look a the gdb output
http://wiki.eclipse.org/CDT/User/FAQ#I.27ve_been_asked_for_.27gdb_traces.27.2C_where_can_I_find_them.3F
Re: How to debug forked processes [message #855070 is a reply to message #854779] Tue, 24 April 2012 09:50 Go to previous message
Eclipse UserFriend
We may not be handling the execv() call.
Try the GDB option (in your .gdbinit, or typing it in the gdb console:
set follow-exec-mode <?>
http://sourceware.org/gdb/onlinedocs/gdb/Forks.html

If that works and you'd like to have that in Eclipse, please open a bug.
http://bugs.eclipse.org/bugs

Thanks

Marc
Previous Topic:make: *** [scd_cmd_1] Error for no reason
Next Topic:Terminate running process
Goto Forum:
  


Current Time: Thu Jun 19 00:28:53 EDT 2025

Powered by FUDForum. Page generated in 0.04919 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top