stopping and attaching gdb

Marty Leisner (leisner@sdsp.mc.xerox.com)
Fri, 26 Apr 1996 13:00:57 PDT


On sunOS, when I want to stop a forked child and attach the debugger,
I normally just do
pause();
and attaching will knock me out...

On linux I have to do somethig like

static void stop_and_print(void)
{
printf("Process %d stopped\n", getpid());
while(1)
;

}

and then return in gdb...(pause would be friendlier, they both work...
I suppose I could sleep...)

marty leisner@sdsp.mc.xerox.com
Member of the League for Programming Freedom (http://www.lpf.org)
Any sufficiently advanced technology is indistinguishable from magic
Arthur C. Clarke, The Lost Worlds of 2001