Stupid questions about debugging kde apps

Thiago Macieira thiago at kde.org
Sun Feb 3 13:04:49 GMT 2008


Marc Espie wrote:
>In my opinion, there's a lot of stuff missing in DEBUG (the one in
>kdelibs).
>
>- is there a magical cmake settings to compile applications with
>debugging info, BUT without any of the extra messages ? I need this
>because of a few heisenbugs, I've got at least two or three instances
>of crashes that go away when I compile with full debug info, so I
>suspect that some of the debug code does have side-effects.

Two possible reasons for that:
1) code being called from inside kDebug(), which means it won't get called 
from a release-mode build

or 2) a real heisenbug that goes away in a debug-mode build simply because 
of different compiler flags or memory layout.

To turn off debugging completely, set the macro that is listed in 
kdebug.h.

>- should document stuff like -nofork along with -nocrashhandler... any
>apps that don't react to -nofork ?  Writing out the basic kde app model
>in there would make sense (is it still fork() from kdeinit ?)

They are documented:
  --nocrashhandler          Disable crash handler, to get core dumps
  --nofork                  Do not run in the background.

The --nofork option only applies to applications deriving from 
KUniqueApplication.

KDE applications are normal applications. A KUniqueApplication will 
fork(): the parent process exits, the child continues. kdeinit is 
just .the master app launcher: fork + exec.

>- what's the protocol about kioslave debugging ? Especially when you're
>not on linux, you do not get symbol backtrace. This is really poorly
>documented... I found out about DBUS_BLOCK_ON_ABORT, which is good.
>Now I'm stuck (don't laugh) because I actually do not know which app it
>is running, so I don't know which symbol-set to load...

KDE_SLAVE_DEBUG_WAIT=protocol kdeinit4

Works by calling raise(SIGSTOP) in the beginning of the ioslave, before 
control is passed to the slave code. I don't care about platforms where 
raise() doesn't work.

The application for any ioslave is kdeinit4 or kioslave. Depends on how 
the process was launched. You can tell that by looking in the /proc 
structure for the process (don't tell me that information isn't easily 
accessible on the BSDs because that would be a stupid decision on the 
kernel developers).

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20080203/aecf0108/attachment.sig>


More information about the kde-core-devel mailing list