Operating System - HP-UX
1823114 Members
3331 Online
109646 Solutions
New Discussion юеВ

Re: Return address of a function in a frame

 

Return address of a function in a frame

Hi,
I am working on HP Itanium Stack unwinding functions. I need to find out the return address of a function in each frame of a stack. Is there any API which gives me this value?

Thanks,
Suchitra
4 REPLIES 4
Dennis Handly
Acclaimed Contributor

Re: Return address of a function in a frame

Re: Return address of a function in a frame

Hi,
I am using uwx_step API to step through each frame in a Stack. The issue i have is to find out the return address of the function which corresponds to a particular frame. I have the function implemented in HP PARISC where it takes the value at current frame's curr_pcoffset to get the return address. What is the corresponding value in HP Itanium?

Dennis Handly
Acclaimed Contributor

Re: Return address of a function in a frame

>I am using uwx_step API to step through each frame in a Stack.

The current context contains the PC. If you want the PC of the caller, you need to call uwx_step.

>I have the function implemented in PA-RISC

You throw that broken design away.

Re: Return address of a function in a frame

try uwx_get_reg(3X) with the regid being UWX_REG_RP. does it work for you? see manpage for more details.