HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Finding the function that contains the return ...
Operating System - HP-UX
1827788
Members
2606
Online
109969
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Topic Options
- 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
03-03-2010 03:06 AM
03-03-2010 03:06 AM
Finding the function that contains the return address.
Hi,
We are working on an Exception tracking and stack unwinding application where we store the return address of all the frames in the stack. From the return address we need to find the function block . We have the code in HPPARISC which does this and we are trying to port it to HPItanium. We check whether the return address is in the range of Dll map base data's start address and end address and convert the address to an offset relative to Image start address then add 0x1000 to account for subspace offset. We have similar code in Linux and Aix also but here it doesn't add 0x1000 for the subspace offset. So for HPItanium should we add this offset ? Please have a look at the HPPARISC code snippet
/*--------------------------------------------------------------------*
* Is Address in the Image of the DllMap? *
*--------------------------------------------------------------------*/
if ( lRetn >= pTre->SAddr && lRetn <= pTre->EAddr)
{
/*--------------------------------------------------------------------*
* Convert the Address to an Offset relative to Image Start Address *
* Note: We must add 0x1000 to the result to account for sub-space *
* offset. *
*--------------------------------------------------------------------*/
prTre = pTre; /* Set as DllMap to return */
lOffs = PTROPR(PST_DODWORD,lRetn,-,pTre->SAddr);
lOffs += 4096; /* Account for subspace offset */
pEfr->Offs = lOffs; /* Set Offset in Stak Ele */
Thanks
We are working on an Exception tracking and stack unwinding application where we store the return address of all the frames in the stack. From the return address we need to find the function block . We have the code in HPPARISC which does this and we are trying to port it to HPItanium. We check whether the return address is in the range of Dll map base data's start address and end address and convert the address to an offset relative to Image start address then add 0x1000 to account for subspace offset. We have similar code in Linux and Aix also but here it doesn't add 0x1000 for the subspace offset. So for HPItanium should we add this offset ? Please have a look at the HPPARISC code snippet
/*--------------------------------------------------------------------*
* Is Address in the Image of the DllMap? *
*--------------------------------------------------------------------*/
if ( lRetn >= pTre->SAddr && lRetn <= pTre->EAddr)
{
/*--------------------------------------------------------------------*
* Convert the Address to an Offset relative to Image Start Address *
* Note: We must add 0x1000 to the result to account for sub-space *
* offset. *
*--------------------------------------------------------------------*/
prTre = pTre; /* Set as DllMap to return */
lOffs = PTROPR(PST_DODWORD,lRetn,-,pTre->SAddr);
lOffs += 4096; /* Account for subspace offset */
pEfr->Offs = lOffs; /* Set Offset in Stak Ele */
Thanks
- Tags:
- libunwind
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-03-2010 03:17 AM
03-03-2010 03:17 AM
Re: Finding the function that contains the return address.
>From the return address we need to find the function block.
The function name? Or are you trying to write a debugger?
There is no reason for this PA code. unwind(5) provides functions that do this.
(You don't have this subspace offset.)
The function name? Or are you trying to write a debugger?
There is no reason for this PA code. unwind(5) provides functions that do this.
(You don't have this subspace offset.)
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP