newbie question: debug a multiple processes server program
Daniel Jacobowitz
drow@false.org
Fri Feb 9 22:27:00 GMT 2007
On Fri, Feb 09, 2007 at 02:17:52PM -0800, PoWah Wong wrote:
> This is what I am think, please comment:
> - cd src
> - Start testd by ../linux/testd
> - Start gdb
> - Load debugging info
> symbol-file ../linux/testd
Always use "file".
> - Attach to the parent process (i.e. pid 31629)
> - set breakpoint in the foo() of the util.c
> b foo
> - Resume testd execution
> run
"continue"
> - Execute the client program
> - Wait for breakpoint to occur
Yes, this is usually the best way. If you know which process the bug
will occur in, you can also get to it by running the program under
GDB and using "catch fork" and "set follow-fork-mode".
--
Daniel Jacobowitz
CodeSourcery
More information about the Gdb
mailing list