Operating System - HP-UX
1753312 Members
6903 Online
108792 Solutions
New Discussion юеВ

Debugging format support for stabs- aCC

 
Adarsh Thampan
Advisor

Debugging format support for stabs- aCC

I am trying to port a code that runs on Solaris and Linux to HP-Itanium . Basically the code fetches debug information like source , file and line numbers from the shared library files.

The code works on the ELF format ( which is the format supported for Itanium binaries) , but the code expects a stab section in the binaries. Although the "stab" format is pretty outdated, the SUN's C compiler and gcc still support them.

In gcc , one can use the -stab option and for Sun's compiler one can use the option -xdebugformat=stabs .

Does aCC compiler (HP C/aC++ B3910B A.06.15 ) also allow creation of debug information to be stored in the stab format. If yes , please explain how to achieve this.
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: Debugging format support for stabs- aCC

aC++ and other HP compilers only produce Dwarf for HP-UX.
Dennis Handly
Acclaimed Contributor

Re: Debugging format support for stabs- aCC

>the code fetches debug information like source, file and line numbers from the shared library files.

You may want to look at these threads:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1369744
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1397569
Adarsh Thampan
Advisor

Re: Debugging format support for stabs- aCC

These threads explain how to print line and file information from the source code . I do not have access to the code of the shared libraries.

My program criteria is that my input is a set of shared libraries (built with debug information)and my program needs to extract debug information from the shared libraries.

This would be similar to what a debugger does to extract source information from the binaries.

Is there any API's or sample source code already available to extract debug information from HP IA binaries built using the aCC compiler ( DWARF 2 format) that I could use ?
Dennis Handly
Acclaimed Contributor

Re: Debugging format support for stabs- aCC

>These threads explain how to print line and file information from the source code. I do not have access to the code of the shared libraries.

You don't need access to the source code of the shlib, you need access to source code somewhere in the application.

>My program criteria is that my input is a set of shared libraries (built with debug information) and my program needs to extract debug information from the shared libraries.
>This would be similar to what a debugger does

This program is called "gdb". :-)
You can create an input script for gdb, do the hard stuff there, then process the output.

>Are there any APIs or sample source code already available to extract debug information from HP IA binaries built using the aCC compiler that I could use?

Only if you can dynamically load those shlibs and then look at them.