2

As the question indicating, i'm now facing a problem that one server process will fork a subprocess and i want to debug the child process. Anyone knows how to do this from eclipse CDT using gdb?

BTW: This child process may be spawned from an executable/shell script.

1

1 Answer 1

1

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!

Sign up to request clarification or add additional context in comments.

1 Comment

The procedure is analogous for raw GDB: stackoverflow.com/a/43099366/895245 (unfortunately)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.