Guidelines and HOWTOs/Debugging/Debugging IOSlaves

From KDE Community Wiki

If KDE_FORK_SLAVES is set

The only difference between this section and the previous one is how the io-slave is started.

If the io-slaves are forked (this became the default since Frameworks 5.86, before that you needed to set the KDE_FORK_SLAVES environment variable, e.g. export KDE_FORK_SLAVES=1 and start the application from that terminal).

Now when you start your application, a dedicated io-slave will be created in-process by the kioslave executable. To make the io-slave start then wait for debug, just like with the kdeinit/klauncher approach, you need to export KDE_SLAVE_DEBUG_WAIT, for example:

// Will start any io-slave then call `kill -SIGSTOP pid` to make it wait for debugging,
// e.g. you can create a breakpoint ...etc
export KDE_SLAVE_DEBUG_WAIT=all
kioslave5: Suspending process to debug io slave(s): all
kioslave5: 'gdb kioslave5 28008' to debug
kioslave5: 'kill -SIGCONT 28008' to continue

// This will do the same but only for kio_file
export KDE_SLAVE_DEBUG_WAIT=file
kioslave5: Suspending process to debug io slave(s): file
kioslave5: 'gdb kioslave5 25208' to debug
kioslave5: 'kill -SIGCONT 25208' to continue

then follow the same debugging steps from the previous section.