Skip to content

Developer How to debug

Daniel Kastl edited this page Jun 5, 2013 · 4 revisions

Debug Output

Start by uncommenting #define DEBUG 1 in both the C and C++ code. Then add more DBG('I got here message\n").

In the C++ code these messages get written to a file '/tmp/sew-debug' and you can do a tail -f on that in another window to see your progress.

Rebuild PostgreSQL

If you build your own Postgresql you might want to rebuild it with --enable-cassert option to configure, which will put the database backend into a more rigorous memory check mode.

Example for Debian/Ubuntu environment:

sudo /etc/init.d/postgresql stop
apt-get source postgresql-server-dev-9.2
sudo apt-get build-dep postgresql-server-dev-9.2
dpkg-source -x postgresql-9.2_9.2.4-1.pgdg60+1.dsc
cd postgresql-9.2-9.2.4/
DEB_BUILD_OPTIONS="--enable-cassert --enable-debug" fakeroot debian/rules binary
DEB_BUILD_OPTIONS="--enable-cassert --enable-debug" debian/rules binary
DEB_BUILD_OPTIONS="--enable-cassert --enable-debug" fakeroot debian/rules binary
cd ..
sudo dpkg -i postgresql-server-dev-9.2_9.2.4-1.pgdg60+1_i386.deb
sudo /etc/init.d/postgresql start
Clone this wiki locally