Bug 160339

Summary: GDB fails to correctly report frame information
Product: Red Hat Enterprise Linux 4 Reporter: H.J. Lu <hongjiu.lu>
Component: gdbAssignee: Jeff Johnston <jjohnstn>
Status: CLOSED ERRATA QA Contact: Jay Turner <jturner>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: cagney, inaky.perez-gonzalez, jjohnstn, srevivo
Target Milestone: ---   
Target Release: ---   
Hardware: ia64   
OS: Linux   
Whiteboard:
Fixed In Version: RHSA-2005-709 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2005-10-05 12:42:18 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 145411, 156322, 164315    
Attachments:
Description Flags
A testcase
none
Simple patch with a tentative fix for the 'info frame' issue none

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