From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10859 invoked by alias); 14 Feb 2007 15:42:36 -0000 Received: (qmail 10828 invoked by uid 22791); 14 Feb 2007 15:42:36 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Wed, 14 Feb 2007 15:42:25 +0000 Received: from dsl093-172-095.pit1.dsl.speakeasy.net ([66.93.172.95] helo=caradoc.them.org) by nevyn.them.org with esmtp (Exim 4.63) (envelope-from ) id 1HHMH1-0002W6-2r; Wed, 14 Feb 2007 10:42:23 -0500 Received: from drow by caradoc.them.org with local (Exim 4.63) (envelope-from ) id 1HHMH0-0001jK-Dn; Wed, 14 Feb 2007 10:42:22 -0500 Date: Wed, 14 Feb 2007 15:51:00 -0000 From: Daniel Jacobowitz To: Christoph Bartoschek Cc: gdb@sourceware.org Subject: Re: Array of short values Message-ID: <20070214154222.GA6588@caradoc.them.org> Mail-Followup-To: Christoph Bartoschek , gdb@sourceware.org References: <200702141632.08219.bartoschek@or.uni-bonn.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200702141632.08219.bartoschek@or.uni-bonn.de> User-Agent: Mutt/1.5.13 (2006-08-11) 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-02/txt/msg00125.txt.bz2 On Wed, Feb 14, 2007 at 04:32:08PM +0100, Christoph Bartoschek wrote: > Hi, > > is it possible to easily set an array of short as a convenience variable? > > set $arr = (short *) {1, 2, 3} > > Currently I have to use: > > set $arr = (short *) {0x00020001, 0x00000003} I don't think so. { (short) 1, (short) 2 } should work, though. Maybe someone will add C99 support to the C parser some day, and improve this along the way. Just so you know: this is probably not doing what you expect. Try "print $arr". In fact it's probably calling malloc() in the program, allocating memory, and stuffing your shorts there. I did some experimenting with this but got too confused by the parser - I'll be back to it, since it's related to my recent Python project. -- Daniel Jacobowitz CodeSourcery