4   Debugging Errors? From PC Address to Source Code?   The Question is:    + Compiler Versions:  BASIC V1.1 through V1.5 ) OpenVMS  Versions:  Alpha V6 through V7.3    J When a program run ends with an unexpected run time error, the line numberO  listed as the source of the error almost never matches the correct line number   of the offending code.    N In over 20 years that I have used different versions of DEC/Compaq/HP Basic, IK  never had this problem under VAX VMS, but this problem always occurs under   Alpha OpenVMS.    M As a result, de-bugging programs for run-time errors takes much more time now 3  under Alpha OpenVMS than previously under VAX VMS.       O Is this a known problem, and is there a workaround? Or, is there something I am   over-looking?    Thanks,     Balu        The Answer is :   D   The OpenVMS Wizard will assume you are refering to the applicationE   image's program counter line numbers; to OpenVMS virtual addresses, /   and not to the BASIC compiler's line numbers.    =   To locate the failing instruction given the program counter ?   (virtual) address, you will need  both the application source ?   code listings from the compiler(s) involved (with the machine ;   code listings enabled), and you will need the linker map.    @   When provided with a failing program counter, first locate the=   failing address within the ranges listed in the linker map. B   From the linker map, you will have the source module and programA   section that contributed the failing code, and the base virtual @   address for the code.   Using the base virtual address and theD   machine code from the compiler listings, you can locate the offsetE   within the routine, which will lead you to the failing instruction.    C   You will want to look at use of the OpenVMS debugger, as this and C   similar tools can be used to debug the application, to locate the @   failing instructions, and even to automatically issue debugger!   commands upon program failures.    ?   This technique is used on both OpenVMS VAX and OpenVMS Alpha.    D   For additional programming information and pointers to informationB   on debugging applications, please see topics (1661) and related.   /  Answer written or last revised on  3-MAY-2004  