Difference between revisions of "Tutorial for gdb debug under Win32"

From VideoLAN Wiki
Jump to navigation Jump to search
Line 18: Line 18:
  
 
*Tool called 7-Zip can be used to extract .7z packages  
 
*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.
+
*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.
  
 
[[File:Vlc_gdb_nofolder.png‎‎]]
 
[[File:Vlc_gdb_nofolder.png‎‎]]
Line 26: Line 26:
 
*Some issues might be already fixed, so it might not be possible to replicate the 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 http://sourceforge.net/projects/mingw/files/OldFiles/gdb-6.8-mingw.tar.bz2/download
+
4. If you can replicate the issue, next step is to download gdb debugger from ftp://ftp.equation.com/gdb/32/gdb.exe
  
5. Extract the gdb.exe from that package to the same directory where you extracted the VLC debug build  
+
5. Copy the gdb.exe to the same directory where you extracted the VLC debug build  
 
 
*Tool called 7-Zip can be used to extract .tar.bz2 packages (actually that is compressed twice, once with bz2 and once with tar)
 
  
 
[[File:Vlc_gdb_folder.png‎‎]]
 
[[File:Vlc_gdb_folder.png‎‎]]
Line 44: Line 42:
 
[[File:Vlc_gdb_target_exec.png‎‎‎‎]]
 
[[File:Vlc_gdb_target_exec.png‎‎‎‎]]
  
8. Type in ''run'' and VLC should start  
+
8. Type in ''run'' and VLC should start after few moments
  
 
*first vlc.exe startup might take some time, so please wait
 
*first vlc.exe startup might take some time, so please wait
Line 57: Line 55:
 
[[File:Vlc_gdb_signal.png‎]]
 
[[File:Vlc_gdb_signal.png‎]]
  
10. Once vlc.exe has crashed, type in ''bt''  
+
10. Once vlc.exe has crashed, type in ''bt'' to the gdb console
  
 
*bt is short for backtrace
 
*bt is short for backtrace

Revision as of 12:48, 22 January 2012

Editing Tutorial for gdb debug under Win32

Point of this page is to show how to get VLC related crash info with tool called gdb. This crash info is VERY useful when tracking down the reason for the crash, so if you can provide us this info, the likehood for bug fix is much higher.

What you need

  • Computer that runs Windows builds of VLC (this tutorial isn't for 64 bit VLC builds, but it will work for 64 bit Windows versions that run 32 bit VLC).
  • Way to crash your 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