]> code.delx.au - gnu-emacs/blobdiff - src/.gdbinit
Add comment for 2014-03-10T10:31:13Z!rudalics@gmx.at and 2014-03-10T18:53:39Z!rudalic...
[gnu-emacs] / src / .gdbinit
index 275a1d8db887dc476406c9ec5d3ef0e4f0a300c9..715744bc18eabc5ef227134aed340b8b6b9a795c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-1998, 2000-2013 Free Software Foundation, Inc.
+# Copyright (C) 1992-1998, 2000-2014 Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
@@ -1072,7 +1072,13 @@ end
 
 define xprintstr
   set $data = (char *) $arg0->data
-  output ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~ARRAY_MARK_FLAG : $arg0->size_byte)
+  set $strsize = ($arg0->size_byte < 0) ? ($arg0->size & ~ARRAY_MARK_FLAG) : $arg0->size_byte
+  # GDB doesn't like zero repetition counts
+  if $strsize == 0
+    output ""
+  else
+    output ($arg0->size > 1000) ? 0 : ($data[0])@($strsize)
+  end
 end
 
 define xprintsym
@@ -1184,8 +1190,13 @@ end
 
 define xprintbytestr
   set $data = (char *) $arg0->data
+  set $bstrsize = ($arg0->size_byte < 0) ? ($arg0->size & ~ARRAY_MARK_FLAG) : $arg0->size_byte
   printf "Bytecode: "
-  output/u ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~ARRAY_MARK_FLAG : $arg0->size_byte)
+  if $bstrsize > 0
+    output/u ($arg0->size > 1000) ? 0 : ($data[0])@($bvsize)
+  else
+    printf ""
+  end
 end
 document xprintbytestr
   Print a string of byte code.