From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11230 invoked by alias); 18 May 2010 20:06:07 -0000 Received: (qmail 11220 invoked by uid 22791); 18 May 2010 20:06:06 -0000 X-SWARE-Spam-Status: No, hits=-0.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 18 May 2010 20:06:02 +0000 Received: by vws12 with SMTP id 12so1124893vws.0 for ; Tue, 18 May 2010 13:06:00 -0700 (PDT) Received: by 10.220.125.25 with SMTP id w25mr3771088vcr.92.1274213160000; Tue, 18 May 2010 13:06:00 -0700 (PDT) Received: from zooty (c-76-109-153-227.hsd1.fl.comcast.net [76.109.153.227]) by mx.google.com with ESMTPS id v12sm31533398vch.9.2010.05.18.13.05.59 (version=SSLv3 cipher=RC4-MD5); Tue, 18 May 2010 13:05:59 -0700 (PDT) Received: from tomh.ccur.com (flusers.ccur.com [12.192.68.2]) (Authenticated sender: tom) by zooty.my.lan (Postfix) with ESMTPSA id 716E239A3FD for ; Tue, 18 May 2010 16:05:57 -0400 (EDT) Date: Tue, 18 May 2010 20:06:00 -0000 From: Tom Horsley To: gdb@sourceware.org Subject: How does gdb deal with bizarre frame descriptions? Message-ID: <20100518160554.32fa67fc@tomh.ccur.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-05/txt/msg00054.txt.bz2 I've been looking at the frame info for a main program compiled on ubuntu with g++ (4.4.3), and the frame description info, both for the eh_frame CFA and the DW_AT_frame_base attribute is totally bizarre. The frame pointer is described as being at *(ebp - 16) (for a certain range of addresses). If I debug this program with gdb, it seems to get the frame info correct, and apparently believes the frame pointer is the ebp register (which seems to make sense if I disassemble the code). If I look in *(ebp - 16) I see trash. What the devil is gdb doing to get this right? Is it utterly ignoring the trash generated by the compiler and deducing the frame description by disassembling the prologue code or something? gdb version: GNU gdb (GDB) 7.1-ubuntu g++ version: gcc version 4.4.3 (Ubuntu 4.4.3-4ubuntu5) architecture: i686