Line 101: | Line 101: | ||
3) Verify that the receiver isn't already deleted at that time | 3) Verify that the receiver isn't already deleted at that time | ||
4) Verify that emitter->signalsBlocked() returns false | 4) Verify that emitter->signalsBlocked() returns false | ||
− | |||
− | |||
− | |||
===Is there a preferred way to print debug output on stderr?=== <!--T:29--> | ===Is there a preferred way to print debug output on stderr?=== <!--T:29--> | ||
− | + | Yes; see [[Special:myLanguage/Development/Tutorials/Debugging/Using_Error_Messages|this tutorial]]. | |
− | Yes | + | |
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
<!--T:39--> | <!--T:39--> |
You must set the environment variable KDE_DEBUG (to 1 or whatever you want in fact).
To get Dr Konqi back, unset the KDE_DEBUG environment variable.
Example:
export KDE_DEBUG=1
unset KDE_DEBUG
Edit file $KDEHOME/share/config/drkonqirc and add the following:
[drkonqi]
ConfigName=developer
A core file is an image of the memory when your application crashed. Using the core file, you can know which variables were set and where your application crashed.
Some distributions disable the generation of core files. To re-enable them, use ulimit -c unlimited
.
Once you have a core file for a crash, you can examine it with gdb appname core . This will open gdb on the core file for the given application. Once at the gdb prompt, the most useful command is bt
which generates a backtrace of the crash.
For more information about how to use gdb, see this page
Check this page and kdesdk, there are a bunch of useful scripts there.
Check out kdesdk, and add this line to your ~/.gdbinit :
source /path/to/kde/sources/kdesdk/scripts/kde-devel-gdb
Then in gdb you can do printqstring myqstring
to see its contents.
For instance, QString myqstring = QString::fromLatin1("contents");
can be examined using
(gdb) printqstring myqstring $1 = "content"
See the kde-devel-gdb file for the other macros it defines.
You must stop just after the main to load the debugging symbols of the shared library. After that, you can debug normally. One can go as far as creating a gdb macro, to stop right after the part was loaded. For kword, by example, I use:
define startkword break main run break 'KoDocument::KoDocument(int, QWidget *, char const *, QObject *, char const *, bool)' cont
Here are some steps that you can use to troubleshoot why your signal/slot connection is not working (your slot does not get called for some reason).
1) Verify that the connect() doesn't print a warning to the console at runtime.
If it does, check that you wrote Q_OBJECT, that the parameter names are not in the connect, that the parameter types are compatible, and that the slot is defined, and that the moc was compiled.
1b) Or you can just check to see what connect() returns as a bool. Although this won't give you the error message. 2) Verify that the signal is indeed emitted 3) Verify that the receiver isn't already deleted at that time 4) Verify that emitter->signalsBlocked() returns false
Yes; see this tutorial.