From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9474 invoked by alias); 20 May 2009 22:58:56 -0000 Received: (qmail 9456 invoked by uid 48); 20 May 2009 22:58:56 -0000 Date: Wed, 20 May 2009 22:58:00 -0000 Message-ID: <20090520225856.9455.qmail@sourceware.org> From: "tromey at redhat dot com" To: gdb-prs@sourceware.org In-Reply-To: <20080818193801.9607.cmayer@xp8.de> References: <20080818193801.9607.cmayer@xp8.de> Reply-To: sourceware-bugzilla@sourceware.org Subject: [Bug c++/9607] print displays wrong value of char-pointer in a class, delivered as function parameter X-Bugzilla-Reason: CC Mailing-List: contact gdb-prs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-prs-owner@sourceware.org X-SW-Source: 2009-q2/txt/msg00126.txt.bz2 ------- Additional Comments From tromey at redhat dot com 2009-05-20 22:58 ------- I can use a trick to see the string: (gdb) p ((char **) ¶m)[1] $2 = 0x8048936 "TestValue" gdb appears to be printing the "zeroth slot" of the object rather than the first. This in turns appears to be a debug info problem, afaict: <1><33f4>: Abbrev Number: 79 (DW_TAG_class_type) <33f5> DW_AT_name : (indirect string, offset: 0x19b8): myclass <33f9> DW_AT_byte_size : 4 <33fa> DW_AT_decl_file : 29 <33fb> DW_AT_decl_line : 9 <33fc> DW_AT_sibling : <0x343e> <2><3400>: Abbrev Number: 80 (DW_TAG_member) <3401> DW_AT_name : str <3405> DW_AT_decl_file : 29 <3406> DW_AT_decl_line : 11 <3407> DW_AT_type : <0xaef> <340b> DW_AT_data_member_location: 2 byte block: 23 0 (DW_OP_plus_uconst: 0) It seems to me that the data member location should not be 0. However, I am not certain; I'll have to do more reading. -- What |Removed |Added ---------------------------------------------------------------------------- CC| |tromey at redhat dot com http://sourceware.org/bugzilla/show_bug.cgi?id=9607 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.