From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26265 invoked by alias); 23 Mar 2007 13:10:42 -0000 Received: (qmail 26251 invoked by uid 22791); 23 Mar 2007 13:10:40 -0000 X-Spam-Check-By: sourceware.org Received: from heller.inter.net.il (HELO heller.inter.net.il) (213.8.233.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 23 Mar 2007 13:10:35 +0000 Received: from HOME-C4E4A596F7 ([81.5.34.178]) by heller.inter.net.il (MOS 3.7.3a-GA) with ESMTP id CEN05589 (AUTH halo1); Fri, 23 Mar 2007 15:10:24 +0200 (IST) Date: Fri, 23 Mar 2007 13:10:00 -0000 Message-Id: From: Eli Zaretskii To: Markus.Grunwald@pruftechnik.com CC: gdb@sourceware.org In-reply-to: (Markus.Grunwald@pruftechnik.com) Subject: Re: faster printing of QStrings Reply-to: Eli Zaretskii References: 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-03/txt/msg00294.txt.bz2 > From: Markus.Grunwald@pruftechnik.com > Date: Thu, 22 Mar 2007 13:28:18 +0100 > > we are developing Qt applications. kdevelops debugger offers a watch where > it can display QStrings. I am more the commandline user and have found a > nice function that prints QStrings with gdb: > > define pqs > set $i=0 > set $unicode=$arg0.d->unicode > > printf "Getting QString...\n" > while $i < $arg0.d->len > set $c=$unicode[$i++].ucs > if $c < 32 > printf "\\0%o", $c > else > if $c <= 127 > printf "%c", $c > else > printf "\\0%o", $c > end > end > end > echo \n > end Thanks for posting this, but it only prints the ASCII characters, the rest is displayed as octal escapes. Wouldn't it be better to send UTF-8 encoding to the terminal? Then the non-ASCII characters will also be displayed in a human-readable form. > Works fine - except that it takes ages (25s) ! For Qstring's of what length?