C/C++ Remote Application and multiprocess debugging [message #749925] |
Tue, 25 October 2011 14:18 |
Mark Messages: 8 Registered: October 2011 |
Junior Member |
|
|
Hello,
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 option "automatically debug forked process" is set. However, the debugger only lunches the parent process.
I also added several options in the .gdbinit file like "set detach-on-fork off" or
"set follow-fork-mode child", but without success. In the program list only the parent process is registered.
Then I have read, that the gdbserver only enters the multiprocess mode with the command "target extended-remote". Is it possible to change the connection mode in "C/C++ Remote Application".
If I use gdb from the command line and establish the connection with "target extended-remote" and "run" - both processes are running...
Why is it not possible to debug both processes with the Eclipse debug environment?
Mark
[Updated on: Tue, 25 October 2011 14:28] Report message to a moderator
|
|
|
|
|
|
|
|
Re: C/C++ Remote Application and multiprocess debugging [message #752216 is a reply to message #749986] |
Wed, 26 October 2011 10:08 |
Mark Messages: 8 Registered: October 2011 |
Junior Member |
|
|
Is it possible that the gdbserver started with "gdbserver --multi :<port>" stops all processes or a specific process automatically in the main function, without any adaption in the source code?
I have compiled my application with the compiler option "-g -g3 -ggdb -ggdb3 -O0". However, it seems that the compiler optimize the binary and therefore I cannot set breakpoints in some lines or step through the code: "Error accessing memory address 0x0: Input/output error."
Any hints?
Mark
[Updated on: Wed, 26 October 2011 13:28] Report message to a moderator
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04598 seconds