[net.unix-wizards] gcore and adb

mckenna@HOPKINS-EECS-BRAVO.ARPA (Michael McKenna) (03/06/85)

I have a problem with gcore and adb.  Maybe you can help me.
I first create a file called test.c having these contents:

main()
{
  int	i;

  for (i = 0 ;;) {
    sleep(2);
    printf("%d\n", i++);
  }
}

Then I compile it by typing in

"cc -O -o test test.c".

Then I type 

"test &".

So the numbers 0,1,2,... show up on my terminal.
Then I "kill -STOP pid" and "gcore pid".
Now if I "adb test core.pid", I should be able to continue
the process within adb with ":c19".  However, I get the response
"no process".  What am I doing wrong?  Also, can I put the job
back into the background?

I want to figure this out because
I want an easy way to store the state of a long-running background
job when the system is brought down for any reason.

mckenna@HOPKINS-EECS-BRAVO.ARPA (Michael McKenna) (03/06/85)

Sorry. Me again.

If you want to reach me, I'm mckenna@hopkins .
Thanks for your time.
				Mike McKenna

ron@BRL-TGR.ARPA (Ron Natalie) (03/06/85)

ADB said "no process" it wasn't tracing one. You can't use ":c" on
processes that aren't being traced by adb using the ":r" comamnd.
Only the parent can trace a process on most versions of UNIX and the
child has to initiate the trace.

-Ron

ed@mtxinu.UUCP (Ed Gould) (03/22/85)

> Then I "kill -STOP pid" and "gcore pid".
> Now if I "adb test core.pid", I should be able to continue
> the process within adb with ":c19".  However, I get the response
> "no process".  What am I doing wrong?

You can't continue the process because there is no process
running to continue.  You're doing essentially post-mortem
debugging, although you generated the core image in a different
way.  It's possible, but not easy, to continue *many* processes
from core images - it's not possible in general because of
considerations like open files.  There have been postings in
the past of programs to restart such images.

-- 
Ed Gould		    mt Xinu, 739 Allston Way, Berkeley, CA  94710  USA
{ucbvax,decvax}!mtxinu!ed   +1 415 644 0146