From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1061 invoked by alias); 18 Jul 2007 18:33:35 -0000 Received: (qmail 1050 invoked by uid 22791); 18 Jul 2007 18:33:32 -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, 18 Jul 2007 18:33:29 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 0B5BA982C4; Wed, 18 Jul 2007 18:33:29 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id DAC10982A3; Wed, 18 Jul 2007 18:33:28 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IBEL1-0006dI-06; Wed, 18 Jul 2007 14:33:27 -0400 Date: Wed, 18 Jul 2007 19:32:00 -0000 From: Daniel Jacobowitz To: Peter Toft Cc: gdb@sourceware.org Subject: Re: gdb printing of dynamically allocated matrix Message-ID: <20070718183326.GA25345@caradoc.them.org> Mail-Followup-To: Peter Toft , 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.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-07/txt/msg00144.txt.bz2 On Wed, Jul 18, 2007 at 01:22:33PM +0200, Peter Toft wrote: > * However how can I use GDB to see the contents of "b" > similar to the contents of "c" and "a"? > The best I can do is > (gdb) print *b[0] @3 > (gdb) print *b[1] @3 > Obviously I would like to do the display in one command rather > than several, especially if I changed the b-matrix to be b[7][8] I don't believe this is possible without writing a user-defined command for it - see the manual. > How come that the next vector contains wrong values? It's printing six consecutive elements from memory. -- Daniel Jacobowitz CodeSourcery