From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16380 invoked by alias); 15 Oct 2004 13:42:17 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 16355 invoked from network); 15 Oct 2004 13:42:15 -0000 Received: from unknown (HELO localhost.localdomain) (80.6.110.86) by sourceware.org with SMTP; 15 Oct 2004 13:42:15 -0000 Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.11/8.12.11) with ESMTP id i9FDnKgN027229 for ; Fri, 15 Oct 2004 14:49:20 +0100 Subject: i386 prologue From: David Lecomber To: gdb@sources.redhat.com Content-Type: text/plain Message-Id: <1097848160.1773.91.camel@localhost.localdomain> Mime-Version: 1.0 Date: Fri, 15 Oct 2004 15:25:00 -0000 Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg00325.txt.bz2 My knowledge of this area is very limited, but I regularly come across bad stack traces in GDB, and I think the problem is in i386-tdep.c i386_analyze_frame_setup The code there seems very specific to GNU compilers, expecting either an "enter" - or a pushl %ebp. Well, here's what you get from Intel version 7.1 fortran compiler: Dump of assembler code for function test: 0x0804afd0 : push %ebx 0x0804afd1 : mov %esp,%ebx 0x0804afd3 : and $0xfffffff0,%esp 0x0804afd6 : push %edi 0x0804afd7 : push %esi 0x0804afd8 : push %ebp 0x0804afd9 : sub $0x74,%esp 0x0804afdc : movl $0x81d34ac,0x81ad07c 0x0804afe6 : movl $0x81d34a0,0x81ad088 0x0804aff0 : push $0x81ad06c 0x0804aff5 : push $0x4 0x0804aff7 : call 0x816ca94 0x0804affc : push $0x81ad098 0x0804b001 : push $0x0 0x0804b003 : call 0x81698b0 0x0804b008 : add $0x10,%esp 0x0804b00b : test %eax,%eax and even: 0x080b71c8 : push %ebp 0x080b71c9 : push %ebx 0x080b71ca : sub $0x34,%esp 0x080b71cd : mov 0x40(%esp),%ebx 0x080b71d1 : mov (%ebx),%edx 0x080b71d3 : movl $0xffffffff,0x81e4588 0x080b71dd : test %edx,%edx 0x080b71df : jle 0x80b7d51 0x080b71e5 : mov 0x84711b0,%eax 0x080b71ea : movl $0xd52,0x81e458c 0x080b71f4 : movl $0xffffffff,0x81e4590 0x080b71fe : mov 0xfffffffc(%eax,%edx,4),%eax 0x080b7202 : cmp $0xfffffffe,%eax 0x080b7205 : je 0x80b7d2f This seriously upsets things.. the stack becomes absolutely useless!! Is there some alternative -- does libunwind offer a solution? Or is the prologue stuff the Right Thing To Do [TM]? Anyone have any ideas? d.