Bug 589467

Summary: gdb issues with DW_OP_*piece
Product: [Fedora] Fedora Reporter: Jakub Jelinek <jakub>
Component: gdbAssignee: Jan Kratochvil <jan.kratochvil>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: jan.kratochvil, pmuldoon, tromey
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: gdb-7.1-23.fc13 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 597848 (view as bug list) Environment:
Last Closed: 2010-05-31 18:26:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 597848    
Attachments:
Description Flags
sra-1.c
none
sra-1.s none

Description Jakub Jelinek 2010-05-06 08:54:16 UTC
Created attachment 411878 [details]
sra-1.c

On the attached testcase:

(gdb) b 20
(gdb) b 31
(gdb) b 42
(gdb) r

(gdb) p a
$1 = {i = 4, j = 14}
(gdb) p a.i
$2 = 4
(gdb) p a.j
$3 = 4
(gdb) c

$3 is wrong, should have been 14.  The debug info looks correct and, after all,
p a printed it correctly too.

(gdb) p a
$4 = {4, 14}
(gdb) p a[0]
Can't take address of "a" which isn't an lvalue.
(gdb) p a[1]
Can't take address of "a" which isn't an lvalue.
(gdb) c

When p a is able to print it, so should IMHO p a[0] or p a[1].
(gdb) p a
Unhandled dwarf expression opcode 0x9d
(gdb) p a.i
Unhandled dwarf expression opcode 0x9d
(gdb) p a.j
Unhandled dwarf expression opcode 0x9d

And here DW_OP_bit_piece is unsupported.

Comment 1 Jakub Jelinek 2010-05-06 08:55:33 UTC
This is with http://gcc.gnu.org/PR43983 #c5 patch.

Comment 2 Jakub Jelinek 2010-05-06 08:56:23 UTC
Created attachment 411881 [details]
sra-1.s

gcc -g -O2 -dA generated x86-64 assembly.

Comment 3 Jakub Jelinek 2010-05-06 08:59:26 UTC
Created attachment 411883 [details]
sra-1.s

gcc -g -O2 -dA generated x86-64 assembly.

Comment 4 Tom Tromey 2010-05-21 21:19:33 UTC
I've checked in 4 patches to upstream gdb that should fix these problems.
The unavailable piece patch is not really complete (it warns and fills in
zeroes), but it is better than not getting any results at all.

Comment 6 Fedora Update System 2010-05-30 18:32:13 UTC
gdb-7.1-23.fc13 has been submitted as an update for Fedora 13.
http://admin.fedoraproject.org/updates/gdb-7.1-23.fc13

Comment 7 Fedora Update System 2010-05-31 18:26:04 UTC
gdb-7.1-23.fc13 has been pushed to the Fedora 13 stable repository.  If problems still persist, please make note of it in this bug report.