My working envrionment is RHEL6-64bit EclipseJuno+CDT gdb7.5, and I want to debug the child process spawned via fork/exec without any additional work for the child process.
My step is as below:
1. attach to or start a parent process from eclipse
2. use the gdb console in eclipse to ensure symbol file loaded via
symbol
3. add catch point to capture exec event
catch exec
4. Run program when the it hits to the exec point
5. add break point via gdb console in eclipse
Note:never add break point via eclipse, otherwise the gdb will crash
Then you will hit the break point in the child process! Seemingly, this is a bug
for gdb7.5!