Tutorial for gdb debug under Win32

From VideoLAN Wiki
(Redirected from Gdb)
Jump to navigation Jump to search
See also: Debug

The point of this page is to show you how to get VLC related crash info with a tool called gdb.

This crash info is VERY useful when tracking down the reason for the crash, so if you can provide us with this info, the likelihood of getting your bug fixed is much higher.

What you need

  • Windows computer
  • 32-bit VLC build (this tutorial isn't for 64-bit VLC builds, but it will work for 64-bit Windows versions that run 32-bit VLC).
  • A way to crash VLC (freezes aren't useful unfortunately)

What you have to do

1. Download latest nightly debug build of VLC from http://nightlies.videolan.org/build/win32/?C=M;O=D

  • Trunk folders are current development (unstable) version, Branch folders are current/next stable versions (usually you want latest branch folder)
  • Make sure you take the debug version. It is usually named as vlc-x.y.z-something-date-randomnumber-win32-debug.7z or vlc-x.y.z-something-date-randomnumber-win32-debug.zip

Vlc gdb nightly.png

2. Extract the .zip/.7z to somewhere (like in your desktop)

  • Tool called 7-Zip can be used to extract .7z packages
  • Folder doesn't really matter. So you don't have to uninstall your current VLC version. And you can have multiple VLC versions in your computer.

Vlc gdb nofolder.png

3. Run vlc.exe from that folder and see if you can replicate the issue that is causing your current VLC to crash.

  • Some issues might be already fixed, so it might not be possible to replicate the crash

4. If you can replicate the issue, next step is to download gdb debugger from ftp://ftp.equation.com/gdb/32/gdb.exe

5. Copy the gdb.exe to the same directory where you extracted the VLC debug build

Vlc gdb folder.png

6. Launch gdb.exe by double clicking it

  • You can also launch it via .bat or by other method

7. Type in target exec vlc and press enter

  • gdb takes commands via this terminal

Vlc gdb target exec.png

8. Type in run and VLC should start after few moments

  • first vlc.exe startup might take some time, so please wait

Vlc gdb run.png

9. After vlc.exe is launched, repeat the actions that crash VLC

  • certain crashes might not happen when vlc.exe is run via gdb.exe, so crash might not happen
  • crashes can be noticed from gdb console, which shows "Program received signal..." message

Vlc gdb signal.png

10. Once vlc.exe has crashed, type in bt to the gdb console

  • bt is short for backtrace

Vlc gdb bt.png

11. Share us the info that bt command gave

  • right click the gdb window and select Edit -> Mark to mark the text you want to copy, and then left click to select area, then right click to copy it to clipboard
  • you can share us info via trac, via IRC, via forums etc.

Vlc gdb marked.png

12. You can close the gdb by typing quit

  • you can answer y to the question

Vlc gdb quit.png