How to debug for reporting: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
(updated gdb on windows link)
 
(26 intermediate revisions by 7 users not shown)
Line 1: Line 1:
{{HOWTO Index}}
[[Category:EN]][[Category:Development]][[Category:Tips]][[Category:Easyhacks]]
{{TOC left}}
=Introduction=
This page assumes:
: You understand the basics of [[How to file a bug report|"How to file a bug report"]]
: You have searched through the [http://bugs.scribus.net Scribus bug tracker] and found out that your bug had not yet been reported
: You've searched this wiki for the issue and have come up empty-handed
Therefore it will be useful to try to reproduce the bug, and to find out what is the simplest scenario where/when it happens.
{{Clear}}
= Goal =
'''The goal is to help the developers get a grip on the bug and to understand how to troubleshoot it. '''


==Introduction==
'''When your bug is a reproduce-able crash, then you will be able to attach to its report a backtrace from a debugger.'''


When you fill a bug about a crash, most of the time it is very helpfull if you can attach a backtrace from a debugger.
'''This Howto tells you how to generate this information.'''
 
This Howto tells you how to get this informations.


= Generating a backtrace =
==On Linux==
==On Linux==


If the crash happens on a Linux machine (or generally on a unix machine with the GNU gcc) you can use <kbd>gdb</gdb>.
If the crash happens on a Linux machine (or generally on a unix machine with the GNU gcc compiler) you can use <code>gdb</code> AKA The GNU Debugger.


You have to first load scribus in a new gdb session and launch scribus from there. after scribus has crashed you automatically get some details about the error occured. you can get a full report with the command bt (''backtrace'').
# You have to first load scribus in a new gdb session and launch Scribus from there, in other words you are invoking Scribus within the GNU Debugger.  
# When Scribus crashes you will automatically see details generated about the error by <code>gdb</code>.
# Generate a full report with the command bt (''backtrace'').


<pre>
<pre>
Line 18: Line 29:
... error reporting ...
... error reporting ...
(gdb) bt
(gdb) bt
... full backtracking informations
... full backtracking information
(gdb) exit
(gdb) exit
$
$
</pre>
</pre>
'''NOTE:''' If you can compile Scribus yourself  from source  -- and you plan to report bugs -- '''you should enable the debugging at <u>compile time</u>:'''
* With Cmake (<code>cmake; make; make install</code>) , you should add '''-DWANT_DEBUG=1''' to your cmake line, e.g.:
  cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn -DWANT_DEBUG=1
==On Microsoft Windows==
I've not tried it, but this [http://rpg.hamsterrepublic.com/ohrrpgce/Gdb How-to explaining how to run gdb under Microsoft Windows].
Can anybody try it out and, eventually, report here if it works?
= Related Links =
* [[How to file a bug report]]
* [[Development Tricks]]

Latest revision as of 02:15, 8 September 2014

Introduction

This page assumes:

You understand the basics of "How to file a bug report"
You have searched through the Scribus bug tracker and found out that your bug had not yet been reported
You've searched this wiki for the issue and have come up empty-handed

Therefore it will be useful to try to reproduce the bug, and to find out what is the simplest scenario where/when it happens.

Goal

The goal is to help the developers get a grip on the bug and to understand how to troubleshoot it.

When your bug is a reproduce-able crash, then you will be able to attach to its report a backtrace from a debugger.

This Howto tells you how to generate this information.

Generating a backtrace

On Linux

If the crash happens on a Linux machine (or generally on a unix machine with the GNU gcc compiler) you can use gdb AKA The GNU Debugger.

  1. You have to first load scribus in a new gdb session and launch Scribus from there, in other words you are invoking Scribus within the GNU Debugger.
  2. When Scribus crashes you will automatically see details generated about the error by gdb.
  3. Generate a full report with the command bt (backtrace).
$ gdb scribus
(gdb) run
... error reporting ...
(gdb) bt
... full backtracking information
(gdb) exit
$

NOTE: If you can compile Scribus yourself from source -- and you plan to report bugs -- you should enable the debugging at compile time:

  • With Cmake (cmake; make; make install) , you should add -DWANT_DEBUG=1 to your cmake line, e.g.:
 cmake . -DCMAKE_INSTALL_PREFIX:PATH=/opt/scribus15svn -DWANT_DEBUG=1

On Microsoft Windows

I've not tried it, but this How-to explaining how to run gdb under Microsoft Windows.

Can anybody try it out and, eventually, report here if it works?

Related Links