Operating System - OpenVMS
1757311 Members
4010 Online
108860 Solutions
New Discussion

Re: How do I get C program tracebacks to print SOURCE line numbers instead of LISTING line numbers?

 
Hoff
Honored Contributor

Re: How do I get C program tracebacks to print SOURCE line numbers instead of LISTING line numbers?

About these developer tools for VMS, I hear that computers and these "software-program-thingies" are good at this sort of stuff.  The sort of stuff that developers find, well, tedious or gnarly.  Tracebacks.  Crashes.  Bug reporting and source control.

 

Ph Vouters
Valued Contributor

Re: How do I get C program tracebacks to print SOURCE line numbers instead of LISTING line numbers?

With the relative Program Counters displayed in the traceback information, use binutils/addr2line to get the source files and their line number. Of course you will have to compile/link your code with /DEBUG[/NOOPTIMIZE]. 

And for your VMS image, you may perform either one of the following:

$ run/nodebug myprog

or

$ set image/flags=(nocall_debug) myprog.exe

$ run myprog

 

For more information about binutils/addr2line on OpenVMS Alpha or IA64 systems, refer to:

http://vouters.dyndns.org/tima/OpenVMS-binutils-Unix_utilities-nm-strings-size-addr2line-objdump-as_on_OpenVMS.html

 

In the hope this can satisfy your expectations.

Philippe