(→How to Not Step Into Functions in the Debugger: Enable automatic expanding of Qt data structures) |
(→Enable automatic expanding of Qt data structures) |
||
| Line 65: | Line 65: | ||
==Enable automatic expanding of Qt data structures== | ==Enable automatic expanding of Qt data structures== | ||
| − | From the msvc docs: "While debugging, Data Tips and items in the Watch and Variable windows are automatically expanded to show their most important elements. The expansion follows the format given by the rules in this file. You can add rules for your types or change the predefined rules." | + | From the msvc docs: "While debugging, Data Tips and items in the Watch and Variable windows are automatically expanded to show their most important elements. The expansion follows the format given by the rules in this file. You can add rules for your types or change the predefined rules." ([http://www.thedatafarm.com/blog/content/binary/datatips2.jpg example screen]) |
MSVC 2005: To add support for expanding Qt data structures like QString of QRect, edit {msvc_installation_directory}\Common7\Packages\Debugger\autoexp.dat file and paste [[/Automatic expanding of Qt data structures|definitions]] after [AutoExpand] line. | MSVC 2005: To add support for expanding Qt data structures like QString of QRect, edit {msvc_installation_directory}\Common7\Packages\Debugger\autoexp.dat file and paste [[/Automatic expanding of Qt data structures|definitions]] after [AutoExpand] line. | ||
Contents |
Debug messages (logs) generated by kDebug() and kWarning() are not visible on MS Windows unless application is compiled in so-called CONSOLE subsystem. To show these messages also in WINDOWS subsystem, you can use DebugView tool, coming from SysInternals (currently acquired by Microsoft). The tool offers searching in logs, filtering and saving them to file.
kioslaves on windows are started by klauncher (or kio) as separate kioslave processes. The kioslave executable then loads the related kioslave dll dynamically.
To debug kioslaves:
| Note |
|---|
| For example, set the variable to 'file' for the kio_file slave, but set it to 'smtps' for the kio_smtp is you want to debug smtp protocol secured with SSL. |
If the requested kioslave is requested the next time, a debugger will be started and attached to the kioslave process immediatly before the kioslave's kdemain() function.
On mingw platform gdb is launched and connected to the kioslave process. On msvc platforms the currently installed just-in-time debugger is used. This may be msvc's IDE or the windbg debugger. The latter could be set as jit-debugger by running 'windbg -I' command.
You may inspect kioslave sources [1] for more informations.
Let's assume you're using command line tools (typically CMake) and want to use MS Visual Studio environment for just debugging. You don't need to create msvc project for your KDE application to be able to start debugging.
If you have your application is already running, you can attach to it and then start debugging.
You can create a macro that automates the task. See [2].
If you are using the debug heap, memory is initialized and cleared with special values. Most interesting values are:
See also: [3]
You'll probably want to avoind stepping into lower-level functions like QString constructors or operators while debugging step-by-step. Here's the detailed (unofficial) instruction for various msvc versions.
From the msvc docs: "While debugging, Data Tips and items in the Watch and Variable windows are automatically expanded to show their most important elements. The expansion follows the format given by the rules in this file. You can add rules for your types or change the predefined rules." (example screen)
MSVC 2005: To add support for expanding Qt data structures like QString of QRect, edit {msvc_installation_directory}\Common7\Packages\Debugger\autoexp.dat file and paste definitions after [AutoExpand] line.