Jump to content

Projects/KDE on Windows/Tools: Difference between revisions

From KDE Community Wiki
Rhabacker (talk | contribs)
add windbg receipt
 
Jackh (talk | contribs)
binary-factory no longer exists
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
= Download a binary with debug symbols =
= WinDbg =
You must download a binary for the corresponding KDE applications with debug icon support from https://binary-factory.kde.org, e.g. https://binary-factory.kde.org/job/Umbrello_Nightly_win64/win64/.
== Download a binary with debug symbols ==
# download umbrello-master-xxx-windows-msvc2017_64-cl.7z
You must download a binary for the corresponding KDE applications with debug icon support from https://cdn.kde.org/ci-builds/, e.g. https://cdn.kde.org/ci-builds/office/kmymoney/5.1/windows/.
# download umbrello-master-xxx-windows-msvc2017_64-cl-dbg.7z
# download both files ending with ".7z" (e.g. kmymoney-5.1-3138-windows-cl-msvc2019-x86_64.7z and kmymoney-5.1-3138-windows-cl-msvc2019-x86_64-dbg.7z)
# Unpack both archives to the same location.
# Unpack both archives to the same location.


= Download a debugger =
== Download a debugger ==
# Download SDK installer from https://developer.microsoft.com/de-de/windows/downloads/windows-10-sdk
The easiest way to install WinDbg is to download it from the [https://apps.microsoft.com/detail/WinDbg%20Preview/9PGJGD53TN86?launch=true&mode=mini Microsoft Store]. Alternatively you can follow the instructions at [https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/ Microsoft Learn].
# Start winsdksetzup, select "Download the Windows Software Development Kit ...." and press "Next".
# Uncheck all except "Debugging Tools for Windows x64".
# After the download is complete, enter the download directory and run "X64 Debuggers And Tools-x64_en-us.msi" from the Installers subdirectory.
# Then search the Start menu for "WinDbg (X64)" and run it.
# Select "File"->"Open Executable" from the application menu and select the main executable file you unpacked before, e.g. <unpack-root>\bin\umbrello5.exe.
# Select ""Debug"->"Go" to start the application. In case of a crash it will stop automatically.  


= Get the back trace =
== Get the back trace ==
# Search for "WinDbg (X64)" on the start menu and run it.
# Select "File"->"Open Executable" from the application menu and select the main executable file you unpacked before, e.g. <unpack-root>\bin\kmymoney.exe.
# Select "Debug"->"Go" to start the application. In case of a crash it will stop automatically.
# Select "View"->"Processes and Threads" from the application menu and select the main thread (id 000) if not already selected.
# Select "View"->"Processes and Threads" from the application menu and select the main thread (id 000) if not already selected.
# Select "View"->"Callstack" to see the backtrace.
# Select "View"->"Callstack" to see the backtrace.
Line 22: Line 19:




Note: Normally KF5 applications use drkonqi to automatically generate a backtrace after a crash, which is currently not possible under Windows.
Note: Normally KF5 applications use [https://community.kde.org/Projects/KDE_on_Windows/Getting_a_Backtrace_with_DrKonqi DrKonqi] to automatically generate a backtrace after a crash
 
= cdb =
cdb is the command line version of [[Projects/KDE_on_Windows/Tools#WinDbg | WinDbg]] and could also be used to generate back traces. To use cdb follow these steps:
# [[Projects/KDE_on_Windows/Tools#Download a binary with debug symbols | Download a binary with debug symbols]]
# [[Projects/KDE_on_Windows/Tools#Download a debugger | Download a debugger]]
# start cdb (normally installed into C:\Program Files (x86)\Windows Kits\10\Debuggers\x64) with:  <pre>cdb -g -lines <executable></pre>
# After the application crashes, enter the following command to select the main thread, if not already selected<pre>~0 s</pre>
# Then show the backtrace with<pre>k</pre>
You can save this backtrace to the clipboard and paste it into the related bug report.
= DebugView =
You can download DebugView from https://docs.microsoft.com/en-us/sysinternals/downloads/debugview.
 
To display debug messages, you must start this tool before the associated KDE application.

Latest revision as of 10:11, 25 April 2024

WinDbg

Download a binary with debug symbols

You must download a binary for the corresponding KDE applications with debug icon support from https://cdn.kde.org/ci-builds/, e.g. https://cdn.kde.org/ci-builds/office/kmymoney/5.1/windows/.

  1. download both files ending with ".7z" (e.g. kmymoney-5.1-3138-windows-cl-msvc2019-x86_64.7z and kmymoney-5.1-3138-windows-cl-msvc2019-x86_64-dbg.7z)
  2. Unpack both archives to the same location.

Download a debugger

The easiest way to install WinDbg is to download it from the Microsoft Store. Alternatively you can follow the instructions at Microsoft Learn.

Get the back trace

  1. Search for "WinDbg (X64)" on the start menu and run it.
  2. Select "File"->"Open Executable" from the application menu and select the main executable file you unpacked before, e.g. <unpack-root>\bin\kmymoney.exe.
  3. Select "Debug"->"Go" to start the application. In case of a crash it will stop automatically.
  4. Select "View"->"Processes and Threads" from the application menu and select the main thread (id 000) if not already selected.
  5. Select "View"->"Callstack" to see the backtrace.
  6. Press "Source" in the call stack windows to see the source information.
  7. To save the call stack to the clipboard, press the icon on the left side of the Close button in the window title.
  8. Open a new bugs at https://bugs.kde.org and paste the clipboard content into that bug.


Note: Normally KF5 applications use DrKonqi to automatically generate a backtrace after a crash

cdb

cdb is the command line version of WinDbg and could also be used to generate back traces. To use cdb follow these steps:

  1. Download a binary with debug symbols
  2. Download a debugger
  3. start cdb (normally installed into C:\Program Files (x86)\Windows Kits\10\Debuggers\x64) with:
    cdb -g -lines <executable>
  4. After the application crashes, enter the following command to select the main thread, if not already selected
    ~0 s
  5. Then show the backtrace with
    k

You can save this backtrace to the clipboard and paste it into the related bug report.

DebugView

You can download DebugView from https://docs.microsoft.com/en-us/sysinternals/downloads/debugview.

To display debug messages, you must start this tool before the associated KDE application.