Debugging i3: How To
====================
Michael Stapelberg <michael+i3@stapelberg.de>
-April 2009
+July 2011
This document describes how to debug i3 suitably for sending us useful bug
reports, even if you have no clue of C programming.
== Enabling logging
-i3 spits out much information onto stdout. To have a clearly defined place
-where log files will be saved, you should redirect stdout and stderr in
-xsession. While you’re at it, putting each run of i3 in a separate log file
-with date/time in it is a good idea to not get confused about the different
-log files later on.
+i3 logs useful information to stdout. To have a clearly defined place where log
+files will be saved, you should redirect stdout and stderr in your
++~/.xsession+. While you’re at it, putting each run of i3 in a separate log
+file with date/time in its filename is a good idea to not get confused about
+the different log files later on.
--------------------------------------------------------------------
-exec /usr/bin/i3 >/home/michael/i3/i3log-$(date +'%F-%k-%M-%S') 2>&1
+exec /usr/bin/i3 >~/i3log-$(date +'%F-%k-%M-%S') 2>&1
+--------------------------------------------------------------------
+
+To enable verbose output and all levels of debug output (required when
+attaching logfiles to bugreports), add the parameters +-V -d all+, like this:
+
+--------------------------------------------------------------------
+exec /usr/bin/i3 -V -d all >~/i3log-$(date +'%F-%k-%M-%S') 2>&1
--------------------------------------------------------------------
== Enabling core dumps
core dump, you have to make sure that the user limit for core dump files is set
high enough. Many systems ship with a default value which even forbids core
dumps completely. To disable the limit completely and thus enable core dumps,
-use the following command (in your .xsession, before starting i3):
+use the following command (in your +~/.xsession+, before starting i3):
-------------------
ulimit -c unlimited
== Compiling with debug symbols
To actually get useful core dumps, you should make sure that your version of i3
-is compiled with debug symbols, that is, that they are not stripped during the
-build process. You can check whether your executable contains symbols by
-issuing the following command:
+is compiled with debug symbols, that is, that the symbols are not stripped
+during the build process. You can check whether your executable contains
+symbols by issuing the following command:
----------------
file $(which i3)