From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3770 invoked by alias); 13 Dec 2002 16:46:30 -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 3759 invoked from network); 13 Dec 2002 16:46:26 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 13 Dec 2002 16:46:26 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 18Mupf-0003Bw-00; Fri, 13 Dec 2002 12:46:43 -0600 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 18Msy1-0005G6-00; Fri, 13 Dec 2002 11:47:13 -0500 Date: Fri, 13 Dec 2002 08:46:00 -0000 From: Daniel Jacobowitz To: Daniel Berlin Cc: Jacques Le Normand , gdb@sources.redhat.com Subject: Re: *****SPAM***** casting in gdb Message-ID: <20021213164713.GA20018@nevyn.them.org> Mail-Followup-To: Daniel Berlin , Jacques Le Normand , gdb@sources.redhat.com References: <002301c2a270$e82f3540$c11ffea9@ehville> <2ADB5EBD-0EB0-11D7-8880-000393575BCC@dberlin.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2ADB5EBD-0EB0-11D7-8880-000393575BCC@dberlin.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-12/txt/msg00200.txt.bz2 On Fri, Dec 13, 2002 at 10:33:02AM -0500, Daniel Berlin wrote: > > On Friday, December 13, 2002, at 01:28 AM, Jacques Le Normand wrote: > > >how do you get gdb to cast to size_t? > >I realize that size_t is a typedef to unsigned long long or somesuch. > >A little background: > >when I'm debugging my vector v, gdb won't let me type v[0], > >instead = > >it says this: "One of the arguments you tried to pass to operator[] = > >could not be converted to what the funtion wants." > >I then looked up what operator[] took in the sgi docs and it said a = > >size_t. Anyone have any ideas? > >(I realize I can do p *(v._M_start+n) , but having a method for > >casting = > >would help me later on) > >--Jacques > > > While this doesn't help *you*, it should help the current C++ people > for GDB: > I've seen this with STABS debugging info when some of the operator > functions were left out of the debugging info, but others weren't (GCC > + STABS will omit unused functions from debug info), and we ommitted > the operator we really need to use, and in some cases when we parsed > the types of the arguments out of the demangled function name and come > up with some weird type. Yeah, something like that's my guess; I've been getting this better but it's taking time... Jacques, could you do me a favor? Try to create a small test case for the error message using vector. The problem is almost certainly that the argument 'this' to the operator is of the wrong type, not that the integer is of the wrong type. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer