Debugging format support for stabs- aCC (166 Views)
Reply
Advisor
Adarsh Thampan
Posts: 23
Registered: ‎02-04-2010
Message 1 of 5 (166 Views)

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.
Acclaimed Contributor
Dennis Handly
Posts: 25,274
Registered: ‎03-06-2006
Message 2 of 5 (166 Views)

Re: Debugging format support for stabs- aCC

aC++ and other HP compilers only produce Dwarf for HP-UX.
Acclaimed Contributor
Dennis Handly
Posts: 25,274
Registered: ‎03-06-2006
Message 3 of 5 (166 Views)

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
Advisor
Adarsh Thampan
Posts: 23
Registered: ‎02-04-2010
Message 4 of 5 (166 Views)

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 ?
Acclaimed Contributor
Dennis Handly
Posts: 25,274
Registered: ‎03-06-2006
Message 5 of 5 (166 Views)

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.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.