changeset 55681:91c18484e1a2

(xprintstr): New fun. (xstring, xprintsym): Use it.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 19 May 2004 01:22:06 +0000
parents 197b3ee77f2c
children 1374d9297422
files src/.gdbinit
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/.gdbinit	Wed May 19 01:09:14 2004 +0000
+++ b/src/.gdbinit	Wed May 19 01:22:06 2004 +0000
@@ -199,7 +199,7 @@
 define xstring
   xgetptr $
   print (struct Lisp_String *) $ptr
-  output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size & ~gdb_array_mark_flag : $->size_byte)
+  xprintstr $
   echo \n
 end
 document xstring
@@ -372,12 +372,17 @@
 Print $ as a scrollbar pointer.
 end
 
+define xprintstr
+  set $data = $arg0->data
+  output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte)
+end
+
 define xprintsym
   xgetptr $arg0
   set $sym = (struct Lisp_Symbol *) $ptr
   xgetptr $sym->xname
   set $sym_name = (struct Lisp_String *) $ptr
-  output ($sym_name->data[0])@($sym_name->size_byte < 0 ? $sym_name->size & ~gdb_array_mark_flag : $sym_name->size_byte)
+  xprintstr $sym_name
 end
 document xprintsym
   Print argument as a symbol.