From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18701 invoked by alias); 2 Dec 2003 20:55:48 -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 18679 invoked from network); 2 Dec 2003 20:55:45 -0000 Received: from unknown (HELO BODKIN.NUIGALWAY.IE) (140.203.7.16) by sources.redhat.com with SMTP; 2 Dec 2003 20:55:45 -0000 Received: from CONVERSION-DAEMON.bodkin.nuigalway.ie by bodkin.nuigalway.ie (PMDF V6.2-X17 #30588) id <01L3QFPFJ4680000ZV@bodkin.nuigalway.ie> for gdb@sources.redhat.com; Tue, 02 Dec 2003 20:54:19 +0000 (GMT) Received: from bodkin.nuigalway.ie (emu1.nuigalway.ie [140.203.7.53]) by bodkin.nuigalway.ie (PMDF V6.2-X17 #30588) with ESMTP id <01L3QFPFCNJW0003QW@bodkin.nuigalway.ie> for gdb@sources.redhat.com; Tue, 02 Dec 2003 20:54:19 +0000 (GMT) Date: Tue, 02 Dec 2003 20:55:00 -0000 From: Mihai Basa Subject: Array-of-structures slices To: gdb@sources.redhat.com Message-id: <3FCC10B6@bodkin.nuigalway.ie> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: 7bit X-WebMail-UserID: 02148200 X-EXP32-SerialNo: 00003610 X-SW-Source: 2003-12/txt/msg00026.txt.bz2 Hello, GDB can "display" values from a slice of an array (using the @ operator) - IF that array is made up of base datatypes. It cannot plot slices if the array is made of structures, and I believe it would be really useful if it could... As an example, assume we have an array A[100] made up of structures like this: typedef struct { int x; int y; }; I think it would be good if GDB could print/display the string of 100 A.x 'es. The syntax describing this might be something like: display (A[0]@100).x which currently just displays A[0].x. This means reading an array of 100 elements, starting from A[0] with a stride equal to sizeof(A[0]). Currently GDB can only read with a stride of sizeof(x), if we were to say (A[0].x)@100, which reads alternating x'es and y'es. If this were possible quick visual comparison of a string of related variables stored in structures could be made. Another reason why I see this as useful is because if this were possible one could use the DDD front-end to plot in-program results, even from structures. Regards, Mihai Basa