Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 361942 - C/C++ Remote Application and multiprocess debugging
Summary: C/C++ Remote Application and multiprocess debugging
Status: CLOSED NOT_ECLIPSE
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: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Marc Khouzam CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-25 11:26 EDT by Mark CLA
Modified: 2011-11-03 21:09 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark CLA 2011-10-25 11:26:45 EDT
Build Identifier: 20110916-0149

I use Eclipse Indigo Service Release 1 with gdb version 7.3.1. Gdb is running on a x86_64 linux system and the gdbserver on a mips processor with kernel 2.6.32.

I try to debug the following simple program, which uses the fork command to create a child process:

#include <unistd.h>
#include <stdio.h>

int main()
{
  pid_t  pid;

  pid = fork();
  if (pid == 0)
    {
      while(1)
      {
    	  sleep(5);
    	  printf("Child process is running!\n");
      }
    }
  else
    {
       while(1)
       {
	  sleep(5);
	  printf("Parent process is running!\n");
       }
    }
  return 0;
}

The debugger options "automatically debug forked process" and "Non-stop mode" are set. However, the debugger only lunches the parent process. So I suppose it is a bug. 

Mark

Reproducible: Always
Comment 1 Marc Khouzam CLA 2011-11-03 21:09:43 EDT
The C/C++ Remote Application launch does not support multi-process.  We probably should not have the "automatically debug forked process" option in that case.

You should use the C/C++ Attach to Application launch instead and use the 'gdbserver' debugger in the Debugger tab.  The difference is that with this launch, you will connect to a running process on your target, instead of starting a new one.

This limitation is due to the fact that gdbserver only supports multi-process in the extended-remote mode which is used in C/C++ Attach to Application but not the C/C++ Remote Application Launch.