[Info-vax] hung program location

VAXman- at SendSpamHere.ORG VAXman- at SendSpamHere.ORG
Mon Feb 18 13:35:37 EST 2013


In article <f0482c25-2864-43f1-9590-96dba35d314f at ia3g2000vbb.googlegroups.com>, Tom Adams <w.tom.adams at gmail.com> writes:
>I can see the PC and SP where a program is hung using SHOW PROC/CONT.
>
>How can I relate that to a link map to figure out where the process is
>hung in the program that it is running?
>
>The process is running an installed shared image
>
>This is VMS 7.3-2 on an alpha

IF you have LINKER .MAPs AND compiler /MACHINE .LIStings AND the hang is
in process space AND in your code, you're in luck.

First find the program section in the .MAP where your PC is located.

For example, the PC is %x00031814.  In this example, it would be in this:

CODE                            00030560 00032703 000021A4 (       8612.) 2 **  5 NOPIC,CON,REL,LCL,NOSHR,  EXE,NOWRT,NOVEC,  MOD 
                MAIN_PROGRAM    00030560 00032703 000021A4 (       8612.) 2 **  5
                SUBROUTINE      00032720 00032EA7 00000788 (       1928.) 2 **  5


How, subtract the base (%x00030560) from your PC (%x00031840) to get
the program instruction address (%x000012E0).  Now, edit the .LISting
for MAIN_PROGRAM and search for 12E0.  This assumes you compiled with
/MACHINE.  When you find this, look in the far right and search back-
ward for a number.  This will be the corresponding source line number.


47FE041E     12CC               MOV     SP, SP
A60DFCB8     12D0               LDQ     R16, -840(R13)                                                                      ; 006878
47C1F01C     12D4               AND     SP, 15, R28 --------------------------(corresponding source line number)--------------^^^^^^
47C1F11E     12D8               BIC     SP, 15, SP
23DEFFF0     12DC               LDA     SP, -16(SP)
239C0010     12E0               LDA     R28, 16(R28)
-------------^^^^ (relative instruction address)


IF the address is in system space, use SDA.

$ ANALYZE/SYSTEM
SDA> READ/EXECUTIVE
SDA> MAP 8xxxxxxx
SDA> EXAM/INSTRUCTION 8xxxxxxx


-- 
VAXman- A Bored Certified VMS Kernel Mode Hacker    VAXman(at)TMESIS(dot)ORG

Well I speak to machines with the voice of humanity.



More information about the Info-vax mailing list