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

From VideoLAN Wiki
Jump to navigation Jump to search
Line 6: Line 6:
 
* Way to crash your VLC (freezes aren't useful unfortunately)
 
* Way to crash your VLC (freezes aren't useful unfortunately)
  
== What you have to do ==
+
== 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
 
  
2. Extract the .zip/.7z to somewhere (like in your desktop)
+
1. Download latest nightly debug build of VLC from http://nightlies.videolan.org/build/win32/?C=M;O=D
* 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.
 
  
3. Run vlc.exe from that folder and see if you can replicate the issue that is causing your current VLC to crash.
+
*'''Trunk''' folders are current development (unstable) version, '''Branch''' folders are current/next stable versions (usually you want latest branch folder)
* Some issues might be already fixed
+
*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
  
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
+
[[File:Vlc_gdb_nightly.png‎]]
  
5. Extract the gdb.exe from that package to the same directory where you extracted the VLC debug build
+
2. Extract the .zip/.7z to somewhere (like in your desktop)  
* Tool called 7-Zip can be used to extract .tar.bz2 packages (actually that is compressed twice, once with bz2 and once with tar)
 
  
6. Launch gdb.exe by double clicking it
+
*Tool called 7-Zip can be used to extract .7z packages
* You can also launch it via .bat or by other method
+
*Folder doesn't really matter. So you '''don't''' have to uninstall your current VLC version.
  
7. Type in ''target exec vlc'' and press enter
+
3. Run vlc.exe from that folder and see if you can replicate the issue that is causing your current VLC to crash.
* gdb takes commands via this terminal
 
  
8. Type in ''run'' and VLC should start
+
*Some issues might be already fixed, so it might not be possible to replicate the crash
* first vlc.exe startup might take some time
 
  
9. After vlc.exe is launched, repeat the actions that crash VLC
+
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
* certain crashes might not happen when vlc.exe is run via gdb.exe, so crash might not happen
 
  
10. Once vlc.exe has crashed, type in ''bt''
+
5. Extract the gdb.exe from that package to the same directory where you extracted the VLC debug build
* crashes can be noticed from gdb console, which shows "Program received signal..." message
 
* bt is short for backtrace
 
  
11. Share us the info that bt command gave
+
*Tool called 7-Zip can be used to extract .tar.bz2 packages (actually that is compressed twice, once with bz2 and once with tar)
* 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
 
  
12. You can close the gdb by typing ''quit''
+
[[File:Vlc_gdb_folder.png‎‎]]
* you can answer ''y'' to the question
+
 
 +
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
 +
 
 +
[[File:Vlc_gdb_target_exec.png‎‎‎‎]]
 +
 
 +
8. Type in ''run'' and VLC should start
 +
 
 +
*first vlc.exe startup might take some time, so please wait
 +
 
 +
[[File: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
 +
 
 +
10. Once vlc.exe has crashed, type in ''bt''
 +
 
 +
*crashes can be noticed from gdb console, which shows "Program received signal..." message
 +
*bt is short for backtrace
 +
 
 +
[[File: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
 +
 
 +
12. You can close the gdb by typing ''quit''  
 +
 
 +
*you can answer ''y'' to the question

Revision as of 15:29, 15 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.

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 http://sourceforge.net/projects/mingw/files/OldFiles/gdb-6.8-mingw.tar.bz2/download

5. Extract the gdb.exe from that package 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)

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

  • 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

10. Once vlc.exe has crashed, type in bt

  • crashes can be noticed from gdb console, which shows "Program received signal..." message
  • 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

12. You can close the gdb by typing quit

  • you can answer y to the question