From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11737 invoked by alias); 14 Apr 2006 14:16:45 -0000 Received: (qmail 11728 invoked by uid 22791); 14 Apr 2006 14:16:43 -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; Fri, 14 Apr 2006 14:16:42 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1FUP6G-0003sb-Je for gdb@sourceware.org; Fri, 14 Apr 2006 10:16:40 -0400 Date: Fri, 14 Apr 2006 14:29:00 -0000 From: Daniel Jacobowitz To: gdb@sourceware.org Subject: Re: printing wchar_t* Message-ID: <20060414141640.GA14789@nevyn.them.org> Mail-Followup-To: gdb@sourceware.org References: <200604141257.41690.ghost@cs.msu.su> <20060414130527.GA12955@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00190.txt.bz2 On Fri, Apr 14, 2006 at 05:08:17PM +0300, Eli Zaretskii wrote: > > Date: Fri, 14 Apr 2006 09:05:27 -0400 > > From: Daniel Jacobowitz > > Cc: Eli Zaretskii , gdb@sources.redhat.com > > > > Going away from GDB support for wide characters for a moment, and back to > > this; we have a "print N elements" notation; should we extend it to a > > "print all non-zero elements" notation? > > How about "print elements until you find X", where X is any 8-bit > code, including zero? That would useful in situations, I think. Well, I suppose. But in the general case, there's always user-defined functions, and hopefully better scripting languages in the future; is this something that will be frequently useful direct from the command line? It'll involve another extension to the language expression parsers, you see. We ought to minimize such extensions; e.g. the set of operators available is fairly limited. I was thinking "print *ptr@@", by analogy to "print *ptr@5". Or we could use the existing @ N syntax. Right now we issue errors for anything less than one; so how about "print *ptr@0" for "print *ptr until you encounter a zero"? > We will probably need some user-settable limit for the max number of > elements, to avoid running amok in case there's no X. We can just use the "set print elements" limit for that. Although, it's always bugged me that we use the same setting for "number of members of an array" and "number of characters in a string"; I usually want only a few elements of an array, but much more of a string. Maybe someday we should separate them. > I think we cannot assume Unicode is the only character set, but we can > make Unicode the default and let the user say otherwise if not. Seems reasonable to me. -- Daniel Jacobowitz CodeSourcery