Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a dump file from a C program

omarf
Occasional Visitor

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
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
Occasional Visitor

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.