# HG changeset patch # User Eli Zaretskii # Date 988388795 0 # Node ID ed5dca63a0ed38b9e533b9a1de4d65cefbc1316c # Parent e2849d417d6dc1cc5a3bf60b1d6e92df866ae87b Document some of the facilities for debugging display code, including -DGLYPH_DEBUG build and functions that dump glyph matrices. diff -r e2849d417d6d -r ed5dca63a0ed etc/DEBUG --- a/etc/DEBUG Fri Apr 27 15:58:09 2001 +0000 +++ b/etc/DEBUG Fri Apr 27 16:26:35 2001 +0000 @@ -350,6 +350,38 @@ will cause too much redrawing. This doesn't refresh the screen, so only newly drawn text is in inverse video. +The Emacs display code includes special debugging code, but it is +normally disabled. You can enable it by building Emacs with the +pre-processing symbol GLYPH_DEBUG defined. Here's one easy way, +suitable for Unix and GNU systems, to build such a debugging version: + + MYCPPFLAGS='-DGLYPH_DEBUG=1' make + +Building Emacs like that activates many assertions which scrutinize +display code operation more than Emacs does normally. (To see the +code which tests these assertions, look for calls to the `xassert' +macros.) Any assertion that is reported to fail should be +investigated. + +Building with GLYPH_DEBUG defined also defines several helper +functions which can help debugging display code. One such function is +`dump_glyph_matrix'. If you run Emacs under GDB, you can print the +contents of any glyph matrix by just calling that function with the +matrix as its argument. For example, the following command will print +the contents of the current matrix of the window whose pointer is in +`w': + + (gdb) p dump_glyph_matrix (w->current_matrix, 2) + +(The second argument 2 tells dump_glyph_matrix to print the glyphs in +a long form.) You can dump the selected window's current glyph matrix +interactively with "M-x dump-glyph-matrix RET"; see the documentation +of this function for more details. + +Several more functions for debugging display code are available in +Emacs compiled with GLYPH_DEBUG defined; type "C-h f dump- RET" and +"C-h f trace- RET" to see the full list. + ** Debugging LessTif