From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8104 invoked by alias); 29 Dec 2006 03:30:15 -0000 Received: (qmail 8095 invoked by uid 22791); 29 Dec 2006 03:30:14 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Fri, 29 Dec 2006 03:30:08 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1H08RY-0007mi-JF; Thu, 28 Dec 2006 22:30:04 -0500 Date: Fri, 29 Dec 2006 03:30:00 -0000 From: Daniel Jacobowitz To: qinwei@sunnorth.com.cn Cc: gdb@sourceware.org Subject: Re: A question about program entry point Message-ID: <20061229033004.GA29846@nevyn.them.org> Mail-Followup-To: qinwei@sunnorth.com.cn, gdb@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes 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: 2006-12/txt/msg00217.txt.bz2 On Fri, Dec 29, 2006 at 11:26:33AM +0800, qinwei@sunnorth.com.cn wrote: > Dears, > > When printing a c++ class method using function "cp_print_class_method", > and the program entry point is > set over 0x80000000(for example 0xa0001000), gdb will treat the "addr" as > virtual address and finally > goes into the "else" branch at the following, so gdb will not print out > the correct class method. Take a look at the patch I just posted to gdb-patches. I deleted the check that's causing you trouble. > /* Pointer to member function. Depends on compiler implementation. */ > > #define METHOD_PTR_IS_VIRTUAL(ADDR) ((ADDR) & 0x80000000) > #define METHOD_PTR_FROM_VOFFSET(OFFSET) (0x80000000 + (OFFSET)) > #define METHOD_PTR_TO_VOFFSET(ADDR) (~0x80000000 & (ADDR)) Note to myself. I meant to delete these macros with my patch but forgot to do so. I deleted all the uses. -- Daniel Jacobowitz CodeSourcery