Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Markus.Grunwald@pruftechnik.com
Cc: gdb@sourceware.org
Subject: Re: faster printing of QStrings
Date: Fri, 23 Mar 2007 13:10:00 -0000	[thread overview]
Message-ID: <uvegs3y2h.fsf@gnu.org> (raw)
In-Reply-To: <OFF8FB08FC.7E6D07C5-ONC12572A6.004381A6-C12572A6.00448247@pruftechnik.com> 	(Markus.Grunwald@pruftechnik.com)

> 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?


  parent reply	other threads:[~2007-03-23 13:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-22 12:30 Markus.Grunwald
2007-03-22 12:42 ` Daniel Jacobowitz
2007-03-23 13:08   ` Eli Zaretskii
2007-03-22 13:50 ` Ramana Radhakrishnan
2007-03-22 15:03   ` Markus.Grunwald
2007-03-23 13:10 ` Eli Zaretskii [this message]
2007-03-23 14:00   ` Markus.Grunwald
2007-03-22 15:19 Markus.Grunwald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=uvegs3y2h.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=Markus.Grunwald@pruftechnik.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox