summaryrefslogtreecommitdiffstats
path: root/tools/scripts/koffice-devel-gdb
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-01-20 01:29:50 +0000
commit8362bf63dea22bbf6736609b0f49c152f975eb63 (patch)
tree0eea3928e39e50fae91d4e68b21b1e6cbae25604 /tools/scripts/koffice-devel-gdb
downloadkoffice-8362bf63dea22bbf6736609b0f49c152f975eb63.tar.gz
koffice-8362bf63dea22bbf6736609b0f49c152f975eb63.zip
Added old abandoned KDE3 version of koffice
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1077364 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'tools/scripts/koffice-devel-gdb')
-rw-r--r--tools/scripts/koffice-devel-gdb27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/scripts/koffice-devel-gdb b/tools/scripts/koffice-devel-gdb
new file mode 100644
index 00000000..55adea72
--- /dev/null
+++ b/tools/scripts/koffice-devel-gdb
@@ -0,0 +1,27 @@
+# TODO write a print_kotextdocument that calls a print_kotextstring
+# that uses something like printqstring does (to show the string on a single line)
+
+# Print the contents of a KoTextString (use when debugging a core file)
+# To reassemble the output of this function into a string, use gdb_output_to_text.pl
+define print_kotextstring_noprocess
+ set $s = sizeof(KoTextStringChar)
+ set $str = $arg0
+ set $length = $str->data->shd->len / $s
+ set $arr = ((KoTextStringChar*)($str->data->shd->data))
+ set $i = 0
+ while $i < $length-1
+ print (char)($arr[$i++].c.ucs & 0xff)
+ end
+end
+
+# Print the contents of a KoTextDocument (use when debugging a core file)
+define print_kotextdocument_noprocess
+ set $textdoc = $arg0
+ set $p = $textdoc->fParag
+ while $p != $textdoc->lParag
+ print_kotextstring_noprocess $p->str
+ print -1
+ set $p = $p->n
+ end
+end
+