Re: generate a core file from a running process

From: AG (DONOTREPLY_at_ATcomcastDOTnet)
Date: 09/26/03


Date: Thu, 25 Sep 2003 21:27:28 -0400


"Patrick McGleenon" <patrick.mcgleenon@openwave.com> wrote in message
news:e3ea0830.0309241451.34b35bbd@posting.google.com...
> Anyone know if there's a program out there to generate a core file
> from a running process - without stopping it - on AIX (5.1)?
>
> I'm looking for something like gcore on Solaris, gdb 5.3 supports
> generate-core-file/gcore only on Solaris + linux.
> dbx doesn't appear to support it at all
>
> Thanks
>
> Patrick

How about something like this:

   pid_t ChildPid;
   int Status;
   void (*PrevSIGABT)(int);

   PrevSIGIOT = signal(SIGABT, SIG_DFL);

   ChildPid = fork();
   if (ChildPid == NULL)
      abort();
   else
      waitpid(ChildPid, &Status, NULL);

   signal(SIGABT, PrevSIGABT);