From 14a8902aad57782a0f781405a561efe839b5c7f3 Mon Sep 17 00:00:00 2001 From: "Richard M. Stallman" Date: Sun, 10 May 1998 01:13:11 +0000 Subject: [PATCH] (xstring): Handle unibyte strings. (xchartable, xboolvector): New commands. --- src/.gdbinit | 108 +++++++++++++++++++++++++++++++-------------------- 1 file changed, 65 insertions(+), 43 deletions(-) diff --git a/src/.gdbinit b/src/.gdbinit index 9bfc9ddf2e7..406e02def59 100644 --- a/src/.gdbinit +++ b/src/.gdbinit @@ -69,15 +69,6 @@ document xptr Print the pointer portion of $, assuming it is an Emacs Lisp value. end -define xwindow -print (struct window *) (($ & $valmask) | gdb_data_seg_bits) -printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top -end -document xwindow -Print $ as a window pointer, assuming it is an Emacs Lisp window value. -Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". -end - define xmarker print (struct Lisp_Marker *) (($ & $valmask) | gdb_data_seg_bits) end @@ -141,16 +132,6 @@ document xbuflocal Print $ as a buffer-local-value pointer, assuming it is an Emacs Lisp Misc value. end -define xbuffer -print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits) -output &((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data -echo \n -end -document xbuffer -Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. -Print the name of the buffer. -end - define xsymbol print (struct Lisp_Symbol *) ((((int) $) & $valmask) | gdb_data_seg_bits) output (char*)&$->name->data @@ -163,7 +144,7 @@ end define xstring print (struct Lisp_String *) (($ & $valmask) | gdb_data_seg_bits) -output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte) +output ($->size > 1000) ? 0 : ($->data[0])@($->size_byte < 0 ? $->size : $->size_byte) echo \n end document xstring @@ -181,6 +162,15 @@ Print the contents and address of the vector $. This command assumes that $ is an Emacs Lisp vector value. end +define xprocess +print (struct Lisp_Process *) (($ & $valmask) | gdb_data_seg_bits) +output *$ +echo \n +end +document xprocess +Print the address of the struct Lisp_process which the Lisp_Object $ points to. +end + define xframe print (struct frame *) (($ & $valmask) | gdb_data_seg_bits) end @@ -188,6 +178,23 @@ document xframe Print $ as a frame pointer, assuming it is an Emacs Lisp frame value. end +define xcompiled +print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits) +output ($->contents[0])@($->size & 0xff) +end +document xcompiled +Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value. +end + +define xwindow +print (struct window *) (($ & $valmask) | gdb_data_seg_bits) +printf "%dx%d+%d+%d\n", $->width, $->height, $->left, $->top +end +document xwindow +Print $ as a window pointer, assuming it is an Emacs Lisp window value. +Print the window's position as "WIDTHxHEIGHT+LEFT+TOP". +end + define xwinconfig print (struct save_window_data *) (($ & $valmask) | gdb_data_seg_bits) end @@ -195,12 +202,45 @@ document xwinconfig Print $ as a window configuration pointer, assuming it is an Emacs Lisp window configuration value. end -define xcompiled -print (struct Lisp_Vector *) (($ & $valmask) | gdb_data_seg_bits) -output ($->contents[0])@($->size & 0xff) +define xsubr +print (struct Lisp_Subr *) (($ & $valmask) | gdb_data_seg_bits) +output *$ +echo \n end -document xcompiled -Print $ as a compiled function pointer, assuming it is an Emacs Lisp compiled value. +document xsubr +Print the address of the subr which the Lisp_Object $ points to. +end + +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 +echo \n +end +document xchartable +Print the address of the char-table $, and its purpose. +This command assumes that $ is an Emacs Lisp 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) +echo \n +end +document xboolvector +Print the contents and address of the bool-vector $. +This command assumes that $ is an Emacs Lisp bool-vector value. +end + +define xbuffer +print (struct buffer *) (($ & $valmask) | gdb_data_seg_bits) +output &((struct Lisp_String *) ((($->name) & $valmask) | gdb_data_seg_bits))->data +echo \n +end +document xbuffer +Set $ as a buffer pointer, assuming it is an Emacs Lisp buffer value. +Print the name of the buffer. end define xcons @@ -235,24 +275,6 @@ document xcdr Print the cdr of $, assuming it is an Emacs Lisp pair. end -define xsubr -print (struct Lisp_Subr *) (($ & $valmask) | gdb_data_seg_bits) -output *$ -echo \n -end -document xsubr -Print the address of the subr which the Lisp_Object $ points to. -end - -define xprocess -print (struct Lisp_Process *) (($ & $valmask) | gdb_data_seg_bits) -output *$ -echo \n -end -document xprocess -Print the address of the struct Lisp_process which the Lisp_Object $ points to. -end - define xfloat print ((struct Lisp_Float *) (($ & $valmask) | gdb_data_seg_bits))->data end -- 2.39.2