debugging.html revision 848b8605
1848b8605Smrg<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2848b8605Smrg<html lang="en">
3848b8605Smrg<head>
4848b8605Smrg  <meta http-equiv="content-type" content="text/html; charset=utf-8">
5848b8605Smrg  <title>Debugging Tips</title>
6848b8605Smrg  <link rel="stylesheet" type="text/css" href="mesa.css">
7848b8605Smrg</head>
8848b8605Smrg<body>
9848b8605Smrg
10848b8605Smrg<div class="header">
11848b8605Smrg  <h1>The Mesa 3D Graphics Library</h1>
12848b8605Smrg</div>
13848b8605Smrg
14848b8605Smrg<iframe src="contents.html"></iframe>
15848b8605Smrg<div class="content">
16848b8605Smrg
17848b8605Smrg<h1>Debugging Tips</h1>
18848b8605Smrg
19848b8605Smrg<p>
20848b8605Smrg   Normally Mesa (and OpenGL) records but does not notify the user of
21848b8605Smrg   errors.  It is up to the application to call
22848b8605Smrg   <code>glGetError</code> to check for errors.  Mesa supports an
23848b8605Smrg   environment variable, MESA_DEBUG, to help with debugging.  If
24848b8605Smrg   MESA_DEBUG is defined, a message will be printed to stdout whenever
25848b8605Smrg   an error occurs.
26848b8605Smrg</p>
27848b8605Smrg
28848b8605Smrg<p>
29848b8605Smrg   More extensive error checking is done when Mesa is compiled with the
30848b8605Smrg   DEBUG symbol defined.  You'll have to edit the Make-config file and
31848b8605Smrg   add -DDEBUG to the CFLAGS line for your system configuration.  You may
32848b8605Smrg   also want to replace any optimization flags with the -g flag so you can
33848b8605Smrg   use your debugger.  After you've edited Make-config type 'make clean'
34848b8605Smrg   before recompiling.
35848b8605Smrg</p>
36848b8605Smrg<p>
37848b8605Smrg   In your debugger you can set a breakpoint in _mesa_error() to trap Mesa
38848b8605Smrg   errors.
39848b8605Smrg</p>
40848b8605Smrg<p>
41848b8605Smrg   There is a display list printing/debugging facility.  See the end of
42848b8605Smrg   src/dlist.c for details.
43848b8605Smrg</p>
44848b8605Smrg
45848b8605Smrg</div>
46848b8605Smrg</body>
47848b8605Smrg</html>
48