From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26049 invoked by alias); 27 Jun 2007 10:36:08 -0000 Received: (qmail 26041 invoked by uid 22791); 27 Jun 2007 10:36:08 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 27 Jun 2007 10:36:05 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 2B4309829C; Wed, 27 Jun 2007 10:36:04 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 09A469829B; Wed, 27 Jun 2007 10:36:04 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1I3Us1-0002zg-C6; Wed, 27 Jun 2007 06:35:33 -0400 Date: Wed, 27 Jun 2007 10:36:00 -0000 From: Daniel Jacobowitz To: Bram Kuijper Cc: gdb@sourceware.org Subject: Re: evaluate more complex expressions using gdb Message-ID: <20070627103533.GA11494@caradoc.them.org> Mail-Followup-To: Bram Kuijper , gdb@sourceware.org References: <468239D9.1090001@rug.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <468239D9.1090001@rug.nl> User-Agent: Mutt/1.5.15 (2007-04-09) 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: 2007-06/txt/msg00338.txt.bz2 On Wed, Jun 27, 2007 at 12:20:09PM +0200, Bram Kuijper wrote: > Hi all, > > again a newbie question: can I also evaluate the result of subtractions, > additions using the display command? Like some pointer arithmetics: > > display pointer1 - start_pointer > > If I do this, gdb gives me the following error: > > Disabling display 6 to avoid infinite recursion. > 6: pointer1 - start_pointer = One of the arguments you tried to pass to > operator- could not be converted to what the function wants. > > Is there any way to to this using gdb? You probably need some casts. The error message means GDB found a relevant overloaded operator- in your program for one of those types. -- Daniel Jacobowitz CodeSourcery