From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1042 invoked by alias); 22 Dec 2012 03:50:12 -0000 Received: (qmail 909 invoked by uid 48); 22 Dec 2012 03:49:56 -0000 From: "chihin.ko at oracle dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/55785] New: gcc4.5.2 incorrect line # of caller for destructor Date: Sat, 22 Dec 2012 03:50:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: chihin.ko at oracle dot com 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: 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: 2012-12/txt/msg02188.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55785 Bug #: 55785 Summary: gcc4.5.2 incorrect line # of caller for destructor Classification: Unclassified Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned@gcc.gnu.org ReportedBy: chihin.ko@oracle.com Created attachment 29024 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=29024 c++ test case platform Solaris intel build command /net/gozo/sqe/tools/gcc/4.5.2/intel-S2/bin/g++ 002.cc -g (dbx) stop in stack::~stack (dbx) run Running: a.out (process id 13901) stopped in stack::~stack at line 73 in file "002.cc" 73 delete bottom; stack::~stack(this = 0x8044c90) called from function reverse_name (dbx) where =>[1] stack::~stack(this = 0x8044c90), line 73 in "002.cc" [2] reverse_name(name = 0x80511dc "Honey"), line 77 in "002.cc" <== should be line 87 [3] main(), line 96 in "002.cc" gcc4.7 does not have this problem. This is due to gcc4.5.2 compiler generate extra line 77 in line table: a.out dwarfdump: 0x080510c8 [ 84, 0] NS 0x080510e3 [ 86, 0] NS 0x080510f4 [ 87, 0] NS 0x080510f7 [ 77, 0] NS <== extra line 77 0x08051104 [ 88, 0] NS 0x0805110c [ 77, 0] NS <== extra 0x08051121 [ 91, 0] NS compare the address 0x080510fd of "call ~stack" down below, the extra line 77 in line table, mess up the address/line mapping when doing command "where". 87 return reverse; 0x080510f4: reverse_name+0x00b4: movl 0xfffffff0(%ebp),%ebx 0x080510f7: reverse_name+0x00b7: leal 0xffffffe8(%ebp),%eax 0x080510fa: reverse_name+0x00ba: movl %eax,(%esp) 0x080510fd: reverse_name+0x00bd: call ~stack [ 0x805102a, .-0xd3 ] 0x08051102: reverse_name+0x00c2: movl %ebx,%eax 88 } 0x08051104: reverse_name+0x00c4: addl $0x00000024,%esp 0x08051107: reverse_name+0x00c7: popl %ebx 0x08051108: reverse_name+0x00c8: popl %ebp 0x08051109: reverse_name+0x00c9: ret 0x0805110a: reverse_name+0x00ca: movl %eax,%ebx 0x0805110c: reverse_name+0x00cc: leal 0xffffffe8(%ebp),%eax 0x0805110f: reverse_name+0x00cf: movl %eax,(%esp) 0x08051112: reverse_name+0x00d2: call ~stack [ 0x805102a, .-0xe8 ] 0x08051117: reverse_name+0x00d7: movl %ebx,%eax 0x08051119: reverse_name+0x00d9: movl %eax,(%esp) 0x0805111c: reverse_name+0x00dc: call _Unwind_Resume [PLT] [ 0x8050d64, .-0x3b8 ] 89