From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1455 invoked by alias); 29 Dec 2006 03:24:31 -0000 Received: (qmail 1447 invoked by uid 22791); 29 Dec 2006 03:24:30 -0000 X-Spam-Check-By: sourceware.org Received: from Unknown (HELO mswbj01.sunnorth.com.cn) (124.42.0.200) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 29 Dec 2006 03:24:26 +0000 Received: from maillog.sunnorth.com.cn (unverified [172.20.10.250]) by mswbj01.sunnorth.com.cn (Clearswift SMTPRS 5.2.5) with ESMTP id for ; Fri, 29 Dec 2006 11:24:14 +0800 Received: from ntns1cn.sunnorth.com.cn (ntns1cn.sunnorth.com.cn [172.20.10.252]) by maillog.sunnorth.com.cn (8.12.10/8.12.10) with ESMTP id kBT4ue9F021817 for ; Fri, 29 Dec 2006 12:56:40 +0800 To: gdb@sourceware.org Subject: A question about program entry point MIME-Version: 1.0 X-Mailer: Lotus Notes Release 6.5 September 26, 2003 Message-ID: From: qinwei@sunnorth.com.cn Date: Fri, 29 Dec 2006 03:24:00 -0000 Content-Type: text/plain; charset="US-ASCII" 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/msg00216.txt.bz2 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. common: if (i < len) { char *demangled_name; fprintf_filtered (stream, "&"); fputs_filtered (kind, stream); demangled_name = cplus_demangle (TYPE_FN_FIELD_PHYSNAME (f, j), DMGL_ANSI | DMGL_PARAMS); if (demangled_name == NULL) fprintf_filtered (stream, "", TYPE_FN_FIELD_PHYSNAME (f, j)); else { fputs_filtered (demangled_name, stream); xfree (demangled_name); } } else { fprintf_filtered (stream, "("); type_print (type, "", stream, -1); fprintf_filtered (stream, ") %d", (int) addr >> 3); } I see some macros defined in "cp-support.h". Does that mean gdb support printing class method only if the program entry point is less than 0x80000000? Thanks! /* 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)) Best regards, Qinwei Mail qinwei@sunnorth.com.cn Phone +86-010-62981668-2708 Fax +86-010-62985972