Operating System - HP-UX
1748214 Members
3337 Online
108759 Solutions
New Discussion

Re: HP-UX PA-RISC - Turning a PC value to <source:line> pair string

 
Ph Vouters
Valued Contributor

HP-UX PA-RISC - Turning a PC value to <source:line> pair string

Dear all,

 

I wish to add HP-UX PA-RISC support to my LeakTracer code described at

http://vouters.dyndns.org/tima/Linux-OpenVMS-HP-UX-IA64-Displaying_memory_leaks.html

 

I have already been extremely lucky to complete the PA-RISC backtrace code for both +DD32 and +DD64 compile-time options thanks to difficult to Google find two documents (http://ftp.parisc-linux.org/docs/arch/rad_11_0_32.pdf [+DD32] and http://ftp.parisc-linux.org/docs/arch/unwind.pdf [+DD64])

 

As binutils/addr2line does not seem to be working on HP-UX with +DD32 (+DD64 ???), I need to write the PA-RISC equivalent of the HP-UX IA64 trace routine. This purpose of this trace routine is to convert a binary PC value into a <source:line> pair string. This is where the problem arises. The HP-UX PA-RISC system I have access to has strictly no man available on the callable U_xxxxx routines in /usr/lib/libcl.sl or /usr/lib/pa_20/libcl.sl

 

Someone from HP mentionned a required HP license. Would someone of you have information upon this license ? Would it bring all the much needed mans ?

 

As for +DD32 I am really oriented onto calling U_find_line. As anyone the C function prototype of it with its arguments explanations ? For +DD64, I have strictly no idea upon which U_xxxx routines would match my need. Could someone orient me ?

 

Note that I do NOT want the U_STACK_TRACE() function as it does not match my need.

 

Without me completing this HP-UX PA-RISC work, this means every HP-UX PA-RISC developer will have to use a commercial solution such as Insure++. Of cource a commercial solution is always for fees and closed code. This is totally the contrary of what I propose.

 

Thank you for attention.

Regards,

Philippe

3 REPLIES 3
Dennis Handly
Acclaimed Contributor

Re: HP-UX PA-RISC - Turning a PC value to <source:line> pair string

>This purpose of this trace routine is to convert a binary PC value into a <source:line> pair string.

 

This doesn't exist.  Nothing to see here, move along.  :-)

The best you can do is load module, function + offset.  And that's not easy.

 

The purpose of the Unwind lib on PA is just to support Pascal's try/recover and C++'s exception handling, Ada and U_STACK_TRACE and nothing else.

 

>no man available on the callable U_xxxxx routines in libcl.sl

 

They are in the PA-RISC Runtime Architecture documents.  Try a google search:

http://h21007.www2.hp.com/portal/StaticDownload?attachment_ciid=35ae0c53071b7110VgnVCM100000275d6e10RCRD&ciid=a0f9483d2d2b7110VgnVCM100000275d6e10RCRD

http://h21007.www2.hp.com/portal/site/dspp/menuitem.1b39e60a9475acc915b49c108973a801/?chid=6dc55e210a66a010VgnVCM100000275d6e10RCRD#topic_pa_risc_architecture

http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=5b2d57a02b2b7110VgnVCM100000275d6e10RCRD

http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=2ddfaa5e702b7110VgnVCM100000275d6e10RCRD

 

>Someone from HP mentioned a required HP license.

 

Who/where?  It doesn't exist, so I'm not sure what license?  GPL for gdb?

 

>As for +DD32 I am really oriented onto calling U_find_line.

 

This won't do what you want.  It's only for Ada.

 

>Without me completing this HP-UX PA-RISC work, this means every HP-UX PA-RISC developer will have to use a commercial solution

 

There is always wdb/gdb which already has heap corruption and leak detection.

And you can always download the gdb sources so you can see how to get your <source:line> tuple.

Or look at the above Runtime Architecture docs to see how the debug info works.

 

Support on Integrity is done through the Minimal Line Table, even without -g.  But for some applications, this will double the size of the program file.

Ph Vouters
Valued Contributor

Re: HP-UX PA-RISC - Turning a PC value to <source:line> pair string

Dear Dennis,

 

I could download HP-UX WBD full source code only because I am an AllianceONE member. As all my Web site is source code opened, I do not want to face any possible lawsuit with HP. I made tests with the latest GNU gdb. It happens GNU gdb is unable to correctly parse the symbol table if the executable has been built with the HP-UX CC/aCC compiler..

 

One question I asked one of the Opensource maintainer whose code is included into GNU gdb has been the following:

"

My concern expressed otherwise : " What did prevent the GNU binutils and GNU gdb communities to incorporate HP-UX chages into their respective source stram ????"

"

His answer has been:

"

Proper submission from HP (with a copyrigh assignment).

AFAIK, but I am no lawyer.

"

So I can't currently carry on with my desire to also offer HP-UX PA-RISC support to my LeakTracer code. And I can't get rid from the trace routine on HP-UX IA64 because of lack of support by binutils/addr2line.

 

Deeply sorry for all these HP's HP-UX PA-RISC customers who thought this could be a good alternative to commercial products.

 

Philippe

Dennis Handly
Acclaimed Contributor

Re: HP-UX PA-RISC - Turning a PC value to <source:line> pair string

>I could download HP-UX WDB full source code only because I am an AllianceONE member.

 

Anyone can register.

 

>As all my Web site is source code opened, I do not want to face any possible lawsuit with HP.

 

HP doesn't own the gdb sources, HP donated that code and is required to make that code available under GPL.

 

>GNU gdb is unable to correctly parse the symbol table if the executable has been built with the HP-UX CC/aCC compiler.

 

Most likely.

 

>Proper submission from HP (with a copyright assignment).

 

The problem was it was made too hard to submit the large number of changes.

 

>So I can't currently carry on with my desire to also offer HP-UX PA-RISC support to my LeakTracer code.

 

You would have to extract that code from WDB.

 

>And I can't get rid from the trace routine on HP-UX IA64 because of lack of support by binutils/addr2line.

 

You could get this code from WDB too.

 

>Deeply sorry for all these HP's HP-UX PA-RISC customers who thought this could be a good alternative to commercial products.

 

The are probably already happy using the free WDB leak detection? :-)

So I can't currently carry on with my desire to also offer HP-UX PA-RISC support to my LeakTracer code. And I can't get rid from the trace routine on HP-UX IA64 because of lack of support by binutils/addr2line.

 

Deeply sorry for all these HP's HP-UX PA-RISC customers who thought this could be a good alternative to commercial products.