- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Calculate HP Itanium Stack frame size
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2010 10:30 PM
02-10-2010 10:30 PM
We need to calculate the frame size of a given stack frame in HP Itanium.
We have an API in HP PARISC
"int U_get_previous_frame_x(cframe_info *curr_frame,pframe_info prev_frame,int size);"
From the above API using the pframe_info structure and cframe_info structure ,we can get the frame size by using the "curr_frame_size" and "prev_frame_size" member values.
We need to calculate similarly the frame size for current and previous stack frames in HP Itanium.
We are using the "uwx" API's in HP Itanium for stack traversing/stepping, but we are unable to find any API on how to calculate the frame size for current and previous frames.
Thanks,
Adarsh.
Solved! Go to Solution.
- Tags:
- stackframe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2010 02:20 AM - edited 08-21-2011 07:50 PM
02-11-2010 02:20 AM - edited 08-21-2011 07:50 PM
Re: Calculate HP Integrity Stack frame size
>We have an API in HP PA-RISC
(Do not even think about those or model on those for Integrity.)
>We need to calculate similarly the frame size for current and previous stack frames in HP Integrity?
Why? The unwind(5) routines have been completely rewritten so you don't need to compute silly stuff like that. It just works.
If you want to compute the framesize, you can just subtract the r12, SP register values.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2010 02:25 AM
02-11-2010 02:25 AM
Re: Calculate HP Itanium Stack frame size
Can you explain in details "subtract the r12, SP register values " .Also mention how do I get the r12 and SP register values ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2010 03:06 AM - edited 08-21-2011 07:51 PM
02-11-2010 03:06 AM - edited 08-21-2011 07:51 PM
Re: Calculate HP Integrity Stack frame size
>The code is legacy and it to be supported on Integrity. Hence we would need this information.
If you are unwinding the stack, you must throw this code away and port to the uwx APIs, unwind(5).
>Can you explain in details "subtract the r12, SP register values". Also mention how do I get the r12 and SP register values?
You need to explain why you need the framesize. If you think you need it to unwind, you don't. If you think you need to format your output the same as before, you may want to rethink that.
To get registers: _UNW_getGR(3X)
Subtract the r12 (the real name for SP), register values from the adjoining frames.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2010 03:13 AM
02-11-2010 03:13 AM
Re: Calculate HP Itanium Stack frame size
I agree that we could use unwind and uwx functions completely and eradicate the whole old stuff but in doing that I will have to rewrite a lot of code and maybe re-design as well .
Can you gimme some artefact that neatly explains the Itanium registers and their contents and also the the frame structure( if any) that holds all these values ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2010 03:58 AM
02-11-2010 03:58 AM
Re: Calculate HP Itanium Stack frame size
You can just call U_STACK_TRACE or its variants.
>hence the design of the modules are such that it requires the register values and framesize.
None of these values are useful in calling unwind(5). Unless you just like to print out hex numbers. :-)
There are 128 GRs and FRs. There are 64 PRs. And 8 BRs. And 128 ARs. And 82 CRs.
>I agree that we could use unwind and uwx functions completely
You have no choice but to use uwx. (But perhaps not completely?)
>Can you gimme some artifact that neatly explains the Itanium registers and their contents and also the the frame structure (if any) that holds all these values?
You need to look for Itanium runtime conventions. Note there are two stacks, the user stack and the RSE stack. Start here:
http://h21007.www2.hp.com/portal/site/dspp/menuitem.863c3e4cbcdc3f3515b49c108973a801?ciid=821ffd06ab1b7110VgnVCM100000275d6e10RCRD
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2010 11:03 PM - edited 08-21-2011 07:52 PM
02-11-2010 11:03 PM - edited 08-21-2011 07:52 PM
Re: Calculate HP Integrity Stack frame size
It might be helpful to attach an example stack trace output format.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2010 03:50 AM
02-24-2010 03:50 AM
Re: Calculate HP Itanium Stack frame size
I have attached the list of registers that are being displayed as a part of the exception trace for HP PARISC application.
Now we need to display similar set of register values , since we are porting this on HP Itanium .
Please help us in identifying the set of registers ,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-24-2010 11:18 PM - edited 08-21-2011 07:52 PM
02-24-2010 11:18 PM - edited 08-21-2011 07:52 PM
Re: Calculate HP Integrity Stack frame size
>I have attached the list of registers that are being displayed as a part of the exception trace for PA-RISC application.
I don't think any of these registers are in Integrity. Also, while these are defined in , this file doesn't exist on Integrity.
ucontext_t contains mcontext_t, which is an opaque struct.
You must use the functions in uc_access(3) to get register values.
>we need to display similar set of register values
About the best you can do is dump all that uc_access(3) provides.
If you use gdb's "info all-reg", you can see a list of all registers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2010 04:53 AM
02-25-2010 04:53 AM
Re: Calculate HP Itanium Stack frame size
The registers that I had attached are PARISC registers whose contents were displayed as a prt of the exception tracing.
Now we are porting thsi application to HPItanium , hence we need to know the corressponding registers in Itanium that case be used for exception tracing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2010 09:15 AM - edited 08-21-2011 07:55 PM
02-25-2010 09:15 AM - edited 08-21-2011 07:55 PM
Re: Calculate HP Integrity Stack frame size
>hence we need to know the corresponding registers
Do you still have a question here that's not explained by uc_access(3)?
>be used for exception tracing.
Note: On HP-UX, these are called signals, not to be confused with C++ exceptions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-26-2010 08:57 PM - edited 08-21-2011 08:04 PM
02-26-2010 08:57 PM - edited 08-21-2011 08:04 PM
SolutionFrom a recent thread:
http://h30499.www3.hp.com/t5/Languages-and-Scripting/Return-address-of-a-function-in-a-frame/m-p/4591378
You can get the UWX_REG_PSP pseudo register and then subtract to get the framesize.