[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Traverso-devel] Hint (not a question) -> How to switch debugging ON

From: Peter Hoppe
Subject: [Traverso-devel] Hint (not a question) -> How to switch debugging ON
Date: Mon, 21 Jul 2008 21:37:37 +0100
User-agent: Thunderbird (X11/20080505)

This is not so much a question, but a hint for anyone who wants to do
development on Traverso.

To my great delight I found that a debugging feature has been included
which can be enabled by defining the preprocessor directive USE_DEBUGGER
and then rebuilding the application.

I enabled the feature in the file [traverso-src]/common/Debugger.h:

> /*
>     Copyright (C) 2005-2006 Remon Sijrier
>     This file is part of Traverso
>     Traverso is free software; you can redistribute it and/or modify
>     it under the terms of the GNU General Public License as published by
>     the Free Software Foundation; either version 2 of the License, or
>     (at your option) any later version.
>     This program is distributed in the hope that it will be useful,
>     but WITHOUT ANY WARRANTY; without even the implied warranty of
>     GNU General Public License for more details.
>     You should have received a copy of the GNU General Public License
>     along with this program; if not, write to the Free Software
>     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  
> USA.
>     $Id: Debugger.h,v 1.2 2007/10/29 08:59:14 r_sijrier Exp $
> */
> #include <QString>
> /* 
>  * TODO PH, 2008-07-21 21:31:22 -- Remove or comment-out 
>  *      following line to disable debugging support for 
>  *      production version 
>  */
> #define USE_DEBUGGER 

After rebuilding, the debugger support was compiled into the application.

The program can then be started in a commandline session (e.g. use
konsole program in KDE desktop or similar console emulator) with the
commandline option -d1, -d2, ..., -d5 where the number denotes the
amount of output generated (d1, very little; d5, lots). Whilst the
program runs, there's then lots of output. For convenience I made a
little bash script which starts Traverso with -d2 and captures all the
output and streams it to a timestamped text file:

> #!/bin/bash
> exe="/home/peter/Documents/programming/traverso-0.42.0/traverso-0.42.0/bin/traverso"
> log="/home/peter/Documents/programming/traverso-0.42.0/traverso-0.42.0/0_runlog/"`date
>  +%Y-%m-%d-%H-%M-%S`
> $exe --d2 >> $log 2>&1

The debug feature tool is a great help to understand the runtime
behaviour, as Traverso is a multithreaded application, which is
controlled by events. I worked on such apps in Java, and believe me, it
can be very hard to run them in a debugger and to see what gets called
when! The debugging feature makes this tasks much much easier. Thanks so
much for this feature!

Hope this helps!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]