Operating System - OpenVMS
1748185 Members
4335 Online
108759 Solutions
New Discussion юеВ

Creating a dump file from a C program

 
omarf
New Member

Creating a dump file from a C program

Hi
How do we create a .DMP file from a C program. My program is basically a kill program and I want to add the functionality to create a dump file. Could you please give an example how to do that...
Thanks...
4 REPLIES 4
Volker Halle
Honored Contributor

Re: Creating a dump file from a C program

Omarf,

if you want your C program to create a process dump of itself, use LIB$STOP(SS$_IMGDMP);

To force a process dump of another process, you might have to spawn the DCL command:

$ STOP/ID=xxx/DUMP=NOW

Note that this command creates a process dump, but does not terminate the process. So if you then want to 'kill' the process, you would have to call $FORCEX or $DELPRC, after allowing enough time for the process dump to be written.

Volker.
omarf
New Member

Re: Creating a dump file from a C program

Thanks Guys
I did it using sys$sigprc with a ss$_imgdmp and then did a lib$signal. All works
Cheers
Ian Miller.
Honored Contributor

Re: Creating a dump file from a C program

See also
http://h71000.www7.hp.com/wizard/wiz_2889.html
____________________
Purely Personal Opinion
Volker Halle
Honored Contributor

Re: Creating a dump file from a C program

Sorry.

I have been made aware, that I have given a wrong command to be used to force a process dump.

The correct command is:

$ SET PROC/DUMP=NOW/ID=

The /DUMP=NOW qualifier has been added in OpenVMS Alpha V7.3.

Volker.