Bug 160339 - GDB fails to correctly report frame information
Summary: GDB fails to correctly report frame information
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: gdb
Version: 4.0
Hardware: ia64
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Jeff Johnston
QA Contact: Jay Turner
URL:
Whiteboard:
Depends On:
Blocks: 145411 156322 164315
TreeView+ depends on / blocked
 
Reported: 2005-06-14 15:26 UTC by H.J. Lu
Modified: 2015-01-08 00:10 UTC (History)
4 users (show)

Fixed In Version: RHSA-2005-709
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-10-05 12:42:18 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
A testcase (82.81 KB, application/octet-stream)
2005-06-14 15:31 UTC, H.J. Lu
no flags Details
Simple patch with a tentative fix for the 'info frame' issue (5.44 KB, patch)
2005-06-14 23:30 UTC, Inaky Perez-Gonzalez
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2005:709 0 qe-ready SHIPPED_LIVE Low: gdb security update 2005-10-05 04:00:00 UTC

Description H.J. Lu 2005-06-14 15:26:46 UTC
It is the same as IT 74002. I opened this so that all parties could share the
information here.

From inaky.perez-gonzalez:

Problem is ia64_sigtramp_frame_prev_register() has no clue on how to deal with
all the virtual registers. GDB considers the following virtual registers:

- NAT0-127, the NaT bits for GR0-127, because they don't fit the raw register
model. NAT32-NAT127 have to do the rotation thingie.
- P0-P63, predicate registers (I guess virtual because they are one bit and you
extract'em out of PR). P16 to P63 have to do the rotation thingie.
- V32 to V127 are the general purpose registers, but with the rotation stuff
applied.
- BOF, calculated from the BSP and CFM registers

Now, if you read ia64_pseudo_registers_read(), it deals properly with all the
pseudo registers--it follows we just have to plug the same code into
ia64_sigtramp..etc...() to make it be able to get the addresses of virtual
registers.

So at the end the problem is simply that GDB wasn't reporting the location of  
the pseudo registers properly.   
 
The fix is to specify those locations, and it was done in the following way:  
 
- NAT0-NAT31: located at UNAT, so the location of those bits is UNAT's.  
- NAT32-NAT127: located at the frame's RNAT [I was unable to test this, but it  
should work]  
- BOF: computed out of BSP and CFM, thus it has no real location--locatrion  
declared to be 0.  
- VP0-VP63: these bits are all located in the PR register; thus their location  
is PR's. Didn't have a chance to test as gcc code doesn't save them in user  
space.  
 
Please give the patch a try and a check. I have mostly made up everything  
according to the code I've seen in other areas of ia64-tdep.c  
(ia64_pseudo_register_read(), for example),

Comment 1 H.J. Lu 2005-06-14 15:31:18 UTC
Created attachment 115414 [details]
A testcase

A testcase.

Comment 2 Inaky Perez-Gonzalez 2005-06-14 23:30:34 UTC
Created attachment 115447 [details]
Simple patch with a tentative fix for the 'info frame' issue

This is not complete nor verified to be correct; 
I need some GDB expert to certify it correct or not.

Applies to gdb 6.3

Comment 6 Jeff Johnston 2005-07-27 14:42:15 UTC
Customer patch applied as of gdb-6.3.0.0-1.51  A proper fix for sigaltstack has
also been added.

Comment 10 Red Hat Bugzilla 2005-10-05 12:42:18 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2005-709.html



Note You need to log in before you can comment on or make changes to this bug.