Fix an error message glitch in network-stream.el.
[bpt/emacs.git] / src / .gdbinit
index 0f51a00..b60c14f 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1992-1998, 2000-2011  Free Software Foundation, Inc.
+# Copyright (C) 1992-1998, 2000-2012  Free Software Foundation, Inc.
 #
 # This file is part of GNU Emacs.
 #
@@ -311,9 +311,8 @@ define prowx
   printf "y=%d x=%d pwid=%d", $row->y, $row->x, $row->pixel_width
   printf " a+d=%d+%d=%d", $row->ascent, $row->height-$row->ascent, $row->height
   printf " phys=%d+%d=%d", $row->phys_ascent, $row->phys_height-$row->phys_ascent, $row->phys_height
-  printf " vis=%d", $row->visible_height
-  printf "  L=%d T=%d R=%d", $row->used[0], $row->used[1], $row->used[2]
-  printf "\n"
+  printf " vis=%d\n", $row->visible_height
+  printf "used=(LMargin=%d,Text=%d,RMargin=%d) Hash=%d\n", $row->used[0], $row->used[1], $row->used[2], $row->hash
   printf "start=%d end=%d", $row->start.pos.charpos, $row->end.pos.charpos
   if ($row->enabled_p)
     printf " ENA"
@@ -483,83 +482,83 @@ end
 define pgx
   set $g = $arg0
   # CHAR_GLYPH
-  if ($g->type == 0)
-    if ($g->u.ch >= ' ' && $g->u.ch < 127)
-      printf "CHAR[%c]", $g->u.ch
+  if ($g.type == 0)
+    if ($g.u.ch >= ' ' && $g.u.ch < 127)
+      printf "CHAR[%c]", $g.u.ch
     else
-      printf "CHAR[0x%x]", $g->u.ch
+      printf "CHAR[0x%x]", $g.u.ch
     end
   end
   # COMPOSITE_GLYPH
-  if ($g->type == 1)
-    printf "COMP[%d (%d..%d)]", $g->u.cmp.id, $g->slice.cmp.from, $g->slice.cmp.to
+  if ($g.type == 1)
+    printf "COMP[%d (%d..%d)]", $g.u.cmp.id, $g.slice.cmp.from, $g.slice.cmp.to
   end
   # GLYPHLESS_GLYPH
-  if ($g->type == 2)
+  if ($g.type == 2)
     printf "GLYPHLESS["
-    if ($g->u.glyphless.method == 0)
+    if ($g.u.glyphless.method == 0)
       printf "THIN]"
     end
-    if ($g->u.glyphless.method == 1)
+    if ($g.u.glyphless.method == 1)
       printf "EMPTY]"
     end
-    if ($g->u.glyphless.method == 2)
+    if ($g.u.glyphless.method == 2)
       printf "ACRO]"
     end
-    if ($g->u.glyphless.method == 3)
+    if ($g.u.glyphless.method == 3)
       printf "HEX]"
     end
   end
   # IMAGE_GLYPH
-  if ($g->type == 3)
-    printf "IMAGE[%d]", $g->u.img_id
+  if ($g.type == 3)
+    printf "IMAGE[%d]", $g.u.img_id
   end
   # STRETCH_GLYPH
-  if ($g->type == 4)
-    printf "STRETCH[%d+%d]", $g->u.stretch.height, $g->u.stretch.ascent
+  if ($g.type == 4)
+    printf "STRETCH[%d+%d]", $g.u.stretch.height, $g.u.stretch.ascent
   end
-  xgettype ($g->object)
+  xgettype ($g.object)
   if ($type == Lisp_String)
-    printf " str=%x[%d]", $g->object, $g->charpos
+    printf " str=%x[%d]", $g.object, $g.charpos
   else
-    printf " pos=%d", $g->charpos
+    printf " pos=%d", $g.charpos
   end
   # For characters, print their resolved level and bidi type
-  if ($g->type == 0)
-    printf " blev=%d,btyp=", $g->resolved_level
-    pbiditype $g->bidi_type
+  if ($g.type == 0)
+    printf " blev=%d,btyp=", $g.resolved_level
+    pbiditype $g.bidi_type
   end
-  printf " w=%d a+d=%d+%d", $g->pixel_width, $g->ascent, $g->descent
+  printf " w=%d a+d=%d+%d", $g.pixel_width, $g.ascent, $g.descent
   # If not DEFAULT_FACE_ID
-  if ($g->face_id != 0)
-    printf " face=%d", $g->face_id
+  if ($g.face_id != 0)
+    printf " face=%d", $g.face_id
   end
-  if ($g->voffset)
-    printf " vof=%d", $g->voffset
+  if ($g.voffset)
+    printf " vof=%d", $g.voffset
   end
-  if ($g->multibyte_p)
+  if ($g.multibyte_p)
     printf " MB"
   end
-  if ($g->padding_p)
+  if ($g.padding_p)
     printf " PAD"
   end
-  if ($g->glyph_not_available_p)
+  if ($g.glyph_not_available_p)
     printf " N/A"
   end
-  if ($g->overlaps_vertically_p)
+  if ($g.overlaps_vertically_p)
     printf " OVL"
   end
-  if ($g->avoid_cursor_p)
+  if ($g.avoid_cursor_p)
     printf " AVOID"
   end
-  if ($g->left_box_line_p)
+  if ($g.left_box_line_p)
     printf " ["
   end
-  if ($g->right_box_line_p)
+  if ($g.right_box_line_p)
     printf " ]"
   end
-  if ($g->slice.img.x || $g->slice.img.y || $g->slice.img.width || $g->slice.img.height)
-    printf " slice=%d,%d,%d,%d" ,$g->slice.img.x, $g->slice.img.y, $g->slice.img.width, $g->slice.img.height
+  if ($g.slice.img.x || $g.slice.img.y || $g.slice.img.width || $g.slice.img.height)
+    printf " slice=%d,%d,%d,%d" ,$g.slice.img.x, $g.slice.img.y, $g.slice.img.width, $g.slice.img.height
   end
   printf "\n"
 end
@@ -1245,20 +1244,36 @@ document xbacktrace
   an error was signaled.
 end
 
-define which
-  set debug_print (which_symbols ($arg0))
+define xprintbytestr
+  set $data = (char *) $arg0->data
+  printf "Bytecode: "
+  output/u ($arg0->size > 1000) ? 0 : ($data[0])@($arg0->size_byte < 0 ? $arg0->size & ~gdb_array_mark_flag : $arg0->size_byte)
+end
+document xprintbytestr
+  Print a string of byte code.
 end
-document which
+
+define xwhichsymbols
+  set $output_debug = print_output_debug_flag
+  set print_output_debug_flag = 0
+  set safe_debug_print (which_symbols ($arg0, $arg1))
+  set print_output_debug_flag = $output_debug
+end
+document xwhichsymbols
   Print symbols which references a given lisp object
   either as its symbol value or symbol function.
+  Call with two arguments: the lisp object and the
+  maximum number of symbols referencing it to produce.
 end
 
 define xbytecode
   set $bt = byte_stack_list
   while $bt
-    xgettype ($bt->byte_string)
-    printf "0x%x => ", $bt->byte_string
-    which $bt->byte_string
+    xgetptr $bt->byte_string
+    set $ptr = (struct Lisp_String *) $ptr
+    xprintbytestr $ptr
+    printf "\n0x%x => ", $bt->byte_string
+    xwhichsymbols $bt->byte_string 5
     set $bt = $bt->next
   end
 end