diff src/.gdbinit @ 88349:e5d55ed9b335

(xchartable): Adjusted for the change of char table structure. (xsubchartable, xcoding, xcharset, xcurbuf): New commands.
author Kenichi Handa <handa@m17n.org>
date Fri, 01 Mar 2002 00:59:36 +0000
parents 1865230232b7
children 2f877ed80fa6
line wrap: on
line diff
--- a/src/.gdbinit	Wed Feb 27 05:29:00 2002 +0000
+++ b/src/.gdbinit	Fri Mar 01 00:59:36 2002 +0000
@@ -239,8 +239,8 @@
 define xchartable
 print (struct Lisp_Char_Table *) (($ & $valmask) | gdb_data_seg_bits)
 printf "Purpose: "
-output (char*)&((struct Lisp_Symbol *) ((((int) $->purpose) & $valmask) | gdb_data_seg_bits))->name->data
-printf "  %d extra slots", ($->size & 0x1ff) - 388
+output (char*)((struct Lisp_Symbol *) ((((int) $->purpose) & $valmask) | gdb_data_seg_bits))->name->data
+printf "  %d extra slots", ($->size & 0x1ff) - 68
 echo \n
 end
 document xchartable
@@ -248,6 +248,14 @@
 This command assumes that $ is an Emacs Lisp char-table value.
 end
 
+define xsubchartable
+print (struct Lisp_Sub_Char_Table *) (($ & $valmask) | gdb_data_seg_bits)
+end
+document xsubchartable
+Print the address of the sub-char-table $.
+This command assumes that $ is an Emacs Lisp sub-char-table value.
+end
+
 define xboolvector
 print (struct Lisp_Bool_Vector *) (($ & $valmask) | gdb_data_seg_bits)
 output ($->size > 256) ? 0 : ($->data[0])@(($->size + 7)/ 8)
@@ -332,6 +340,48 @@
   Print argument as a symbol.
 end
 
+define xcoding
+  set $tmp = (struct Lisp_Hash_Table *) ((Vcoding_system_hash_table & $valmask) | gdb_data_seg_bits)
+  set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & $valmask) | gdb_data_seg_bits)
+  set $name = $tmp->contents[$arg0 * 2]
+  print $name
+  pr
+  print $tmp->contents[$arg0 * 2 + 1]
+  pr
+end
+document xcoding
+  Print a coding system whose id is the argument.
+end
+
+define xcharset
+  set $tmp = (struct Lisp_Hash_Table *) ((Vcharset_hash_table & $valmask) | gdb_data_seg_bits)
+  set $tmp = (struct Lisp_Vector *) (($tmp->key_and_value & $valmask) | gdb_data_seg_bits)
+  p $tmp->contents[$arg0->hash_index * 2]
+  pr
+end
+document xcharset
+  Print a charset name whose id is the argument.
+end
+
+define xcurbuf
+  echo GAPSIZE:
+  output current_buffer->text->gap_size
+  echo \nGPT:
+  output current_buffer->text->gpt
+  echo /
+  output current_buffer->text->gpt_byte
+  echo \nZ:
+  output current_buffer->text->z
+  echo /
+  output current_buffer->text->z_byte
+  echo \nTEXT:
+  if current_buffer->text->gpt > 1
+    print current_buffer->text->beg[0]@80
+  else
+    print current_buffer->text->beg[current_buffer->text->gpt_byte-1]@80
+  end
+end
+
 define xbacktrace
   set $bt = backtrace_list
   while $bt