Re: Authentication for MoreSCF
Re: Authentication for MoreSCF
- Subject: Re: Authentication for MoreSCF
- From: Paul Lalonde <email@hidden>
- Date: Thu, 23 May 2002 10:30:05 -0400
on 22/05/02 14:36, Morgan Redman at email@hidden wrote:
>
gdb. Im using project builder, and I cant figure out how to get the
>
debugger to stop in the tool code ( or if you even can )?
>
>
Im also concerned, because the section of code that sets up the pipes
>
and launches the tool, I dont really understand how it works, and worse
>
is that if I try and step in or around the switch(pid = fork()) part,
>
project builder unexpectedly quits!
In order to debug this reliably, you have to use gdb from Terminal. PB gets
hopelessly confused.
What I do is this:
- I've modified the sample code so that after fork(), I printf the child's
pid. I also set a breakpoint after that printf. The tool has also been
modified so that it calls sleep() right after entering main().
- From one terminal window, I debug the app under gdb. Eventually, the fork
occurs and the parent process printfs the child's pid to the terminal
window.
- I then start a second copy of gdb from a second terminal window. I tell
gdb to attach itself to the child (tool) process. One gotcha is that if the
tool is setuid-root, you'll need to run this instance of gdb as root as
well.
- At this point I'm debugging both the app and the tool.
I'd suggest going through the gdb documentation. Apple has a tech note
(tn2032 ) that summarises its features.
--
Paul Lalonde
work: email@hidden | "Il n'y a que les banques qui
home: email@hidden | sont libres" -- Jean-Luc Godard
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.