From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29960 invoked by alias); 24 Jan 2013 20:25:20 -0000 Received: (qmail 29376 invoked by uid 48); 24 Jan 2013 20:24:25 -0000 From: "tromey at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug debug/53927] wrong value for DW_AT_static_link Date: Thu, 24 Jan 2013 20:25:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: debug X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2013-01/txt/msg02332.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53927 --- Comment #1 from Tom Tromey 2013-01-24 20:24:18 UTC --- It seems that I read the wrong frame info in my original report. However, the bug still exists. Here is a new and hopefully more correct example showing the bug. I used a relatively recent git master gcc for this. I just followed the directions in the original report. The static link info for 'nested': DW_AT_static_link : 1 byte block: 50 (DW_OP_reg0 (rax)) In the 'nested' frame this is: (gdb) p/x $rax $1 = 0x7fffffffe370 In the outer 'nestee' frame: (gdb) p $pc $2 = (void (*)()) 0x4004e9 The frame info as shown by readelf --debug-dump=frames-interp: 00000060 00000024 00000064 FDE cie=00000000 pc=00400486..004004fe LOC CFA rbx rbp ra 0000000000400486 rsp+8 u u c-8 0000000000400487 rsp+16 u c-16 c-8 000000000040048a rbp+16 u c-16 c-8 000000000040048f rbp+16 c-24 c-16 c-8 <--- this row 00000000004004fd rsp+8 c-24 c-16 c-8 So the CFA we want is $rbp + 16 in the outermost 'nestee' frame: (gdb) p/x $rbp + 16 $3 = 0x7fffffffe3b0 ... but this is different from $1.