# This file defines handy gdb macros
# To use it, add this line to your ~/.gdbinit :
# source /path/to/kde/sources/kdesdk/scripts/kde-devel-gdb

# Disable printing of static members. Qt has too many, it clutters the output
set print static-members off

# Prints the contents of a QString
define printqstring
       set $i=0
       while $i < ($arg0).d->len
         p ($arg0).d->unicode[$i++].cl
       end
end

# Prints the contents of a QCString
define printqcstring
      p $arg0.shd.data
      p $arg0.shd.len
end

# Prints the contents of a QFont
define printqfont
       print *($arg0).d
       printqstring ($arg0).d->req.family
end

# Prints the contents of a QColor
define printqcolor
  printf "(%d,%d,%d)\n", ($arg0).red(), ($arg0).green(), ($arg0).blue()
end
document printqcolor
  Prints a QColor as (R,G,B).
  Usage: 'qcolor <QColor col>
end

