This is the mail archive of the gdb@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: newbie question: debug a multiple processes server program


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]