Wiki Ubuntu-it

Indice
Partecipa
FAQ
Wiki Blog
------------------
Ubuntu-it.org
Forum
Chiedi
Chat
Cerca
Planet
  • Pagina non alterabile
  • Informazioni
  • Allegati
  • Differenze per "Programmazione/Debug"
Differenze tra le versioni 1 e 18 (in 17 versioni)
Versione 1 del 29/06/2007 11.20.44
Dimensione: 4028
Commento:
Versione 18 del 02/04/2008 16.28.37
Dimensione: 3905
Commento:
Le cancellazioni sono segnalate in questo modo. Le aggiunte sono segnalate in questo modo.
Linea 1: Linea 1:
## page was renamed from Debug
Linea 4: Linea 5:
||<tablestyle="float:right; font-size: 0.9em; width:30%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;">'''Indice:'''[[BR]][[TableOfContents]]|| ||<tablestyle="float:right; font-size: 0.9em; width:35%; background:#F1F1ED; margin: 0 0 1em 1em;" style="padding:0.5em;">'''Indice:'''[[BR]][[TableOfContents]]||
Linea 6: Linea 7:
= Introduzione =
Linea 7: Linea 9:
This document describes how to install debug packages on Ubuntu, which will aid in providing information for bugs. Questo documento descrive come installare pacchetti per eseguire le operazioni di ''debug'' in '''Ubuntu'''.
Linea 9: Linea 11:
= Preparativi =
Linea 10: Linea 13:
== Edgy Eft 6.10 == È necessario adeguare la propria [:SourcesList:lista] dei [:Repository:repository] in modo da poter installare gli strumenti necessari alle operazioni di debug. Aprire il file `/etc/apt/sources.list` con un [:Ufficio/EditorDiTesto:editor di testo] con i [:AmministrazioneSistema/Sudo:privilegi di amministrazione] e aggiungere le righe adatte alla versione in uso:
Linea 12: Linea 15:
Use this section only if you are using Ubuntu Edgy 6.10. See the following section if you are using a prior version.

1. Add the following line to `/etc/apt/sources.list`:
 {{{deb http://people.ubuntu.com/~pitti/ddebs edgy main universe
 * '''Ubuntu 7.10''' «'''Gutsy Gibbon'''»: {{{
deb http://people.ubuntu.com/~pitti/ddebs gutsy main universe
}}}
 * '''Ubuntu 7.04''' «'''Feisty Fawn'''»: {{{
deb http://people.ubuntu.com/~pitti/ddebs feisty main universe
}}}
 * '''Ubuntu 6.10''' «'''Edgy Eft'''»: {{{
deb http://people.ubuntu.com/~pitti/ddebs edgy main universe
Linea 18: Linea 25:
2. Import Martin's public key to your keyring:
 {{{
Per importare la chiave [:Sicurezza/GnuPG:gpg] è sufficiente digitare il seguente comando in una finestra di terminale:
{{{
Linea 23: Linea 30:
3. Then run
 {{{
Infine aggiornare la lista dei pacchetti con il seguente comando:
{{{
Linea 27: Linea 34:
to update your package list.
Linea 29: Linea 35:
4. The debug symbol packages have the '-dbgsym' suffix attached, so to install the debug symbols for the package 'yelp', you run:
 {{{
= Installare programmi per il debugging =

Per installare i pacchetti dei simboli per il debug è utile ricordarsi che tali pacchetti hanno il suffisso «-dbgsym». Ad esempio, per installare i simboli di debug per il pacchetto ''yelp'', occorre digitare il seguente comando:
{{{
Linea 34: Linea 42:
 a. Now you make a ["Backtrace"].
 a. You can also run ["Valgrind"], if the program crashes with a "Segmentation fault" or "Bus error".
 a. Optionally, you may be asked to produce an ["Strace"].
 a. Adesso è stato realizzato un [wiki:Ubuntu/Backtrace Backtrace];
 a. eseguire [:Programmazione/Valgrind:Valgrind], se il programma crasha a causa di ''Segmentation fault'' o ''Bus error'';
 a. a scelta, potrebbe venir chiesta una wiki:Ubuntu/Strace.
Linea 39: Linea 47:
=== References === = Versioni di Ubuntu precedenti =
Linea 41: Linea 49:
 * Announcement: https://lists.ubuntu.com/archives/ubuntu-devel-announce/2006-September/000195.html Questa sezione riguarda le versioni che precedono '''Ubuntu 6.10''' «'''Edgy Eft'''».
Linea 43: Linea 51:
||<tablestyle="text-align: justify; width:100%; " style="border:none;" 5%>[[Immagine(Icone/Piccole/note.png,,center)]] ||<style="padding:0.5em; border:none;"> ''Se si vuole creare un pacchetto, assicurarsi di avere la linea deb-src in `/etc/apt/sources.list`''||
Linea 44: Linea 53:
== Feisty Fawn 7.04 == Controllare se il pacchetto è disponibile per la versione di debugging. Generalmente, i pacchetti di debug saranno identificati con il suffisso `-dbg`.
Linea 46: Linea 55:
The steps described above for Edgy also work for Feisty, just add the following line to `/etc/apt/sources.list`: Se non è disponibile, è possibile crearne uno in questo modo:
Linea 48: Linea 57:
 {{{deb http://people.ubuntu.com/~pitti/ddebs feisty main universe
}}}

== Gutsy Gibbon 7.10 ==

The steps described above for Edgy also work for Gutsy, just add the following line to '/etc/apt/sources.list' :
 {{{deb http://people.ubuntu.com/~pitti/ddebs gutsy main universe
}}}

== Prior Ubuntu versions ==

Use this section if you are using an Ubuntu version prior to Edgy 6.10.

 1. Check if the package has a debugging version available. In general, debugging packages will be named with a `-dbg` suffix
 1. If not, you can generally* build one this way:

Something to keep in mind: if you would like to create a build you're going to need to have the relevant deb-src lines in your /etc/apt/sources.list

  a. Install the development scripts:
  {{{
installare lo script seguente: {{{
Linea 71: Linea 61:
  a. Find out to which package your program belongs to:
  {{{
scoprire quale pacchetto appartiene al proprio programma: {{{
Linea 76: Linea 65:
  a. Install the build-time dependencies for the package:
  
{{{
installare le dipendenze:{{{
Linea 80: Linea 68:
  a. Build .debs for debugging:
  
{{{

creare
`.deb` per il debugging:{{{
Linea 85: Linea 73:
  a. Install the needed .debs (they will be in the current working directory if the build succeeded):
  {{{

installare i necessari `.deb` (si troveranno nella cartella di lavoro, in caso di successo nella creazione): {{{
Linea 90: Linea 78:

* Most packages support the build of debugging version in this way. If this process doesn't work for a package, please open a bug against it.


== The Xorg server ==
The X server will by default trap its own crashes and dump a stack trace in /var/log/Xorg.0.log. However, this stack trace is modified by the signal handler itself. To get a "normal" crash, which will trigger a core dump (and ''apport'' reporting), add this to your /etc/X11/xorg.conf:
{{{
= Xorg server =
Il server X server è in grado di gestire i ''crash'' creando uno "scarico" (''dump'') lasciando la traccia in `/var/log/Xorg.0.log`. Questa traccia è modificata dallo stesso segnale responsabile. Per ottenere un "normale" crash, cioè che crei un ''core dump'' (e un resoconto tramite '''apport'''), aggiungere nel file `/etc/X11/xorg.conf` la seguente opzione: {{{
Linea 103: Linea 86:
== Info for the BugSquad == = Ulteriori risorse =
Linea 105: Linea 88:
If you're trying to `apport-retrace` a crash report from a bug that didn't happen on the same Ubuntu release as the one you're running, do the following:  * [https://wiki.ubuntu.com/DebuggingProgramCrash Documento originale]
Linea 107: Linea 90:
Say that you're running `feisty` and the crash happened on `edgy`:

 0. This will create a minimal `edgy` system. {{{
sudo mkdir -p /chroots/edgy
sudo debootstrap edgy /chroots/edgy/}}}
 0. Now you change into this minimal `edgy` system. {{{
sudo chroot /chroot/edgy}}}
 0. edit `/etc/apt/sources/list` and all the repositories you need, especially Martin's ddeb repository.
 0. {{{
apt-get update; apt-get install gdb apport}}}
 0. use `apport-retrace` as you're used to.
 * Annunci: https://lists.ubuntu.com/archives/ubuntu-devel-announce/2006-September/000195.html
Linea 120: Linea 92:
CategoryProgrammazione CategoryDaRevisionare

BR

Introduzione

Questo documento descrive come installare pacchetti per eseguire le operazioni di debug in Ubuntu.

Preparativi

È necessario adeguare la propria [:SourcesList:lista] dei [:Repository:repository] in modo da poter installare gli strumenti necessari alle operazioni di debug. Aprire il file /etc/apt/sources.list con un [:Ufficio/EditorDiTesto:editor di testo] con i [:AmministrazioneSistema/Sudo:privilegi di amministrazione] e aggiungere le righe adatte alla versione in uso:

  • Ubuntu 7.10 «Gutsy Gibbon»:

    deb http://people.ubuntu.com/~pitti/ddebs gutsy main universe
  • Ubuntu 7.04 «Feisty Fawn»:

    deb http://people.ubuntu.com/~pitti/ddebs feisty main universe
  • Ubuntu 6.10 «Edgy Eft»:

    deb http://people.ubuntu.com/~pitti/ddebs edgy main universe

Per importare la chiave [:Sicurezza/GnuPG:gpg] è sufficiente digitare il seguente comando in una finestra di terminale:

wget -q "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x0DE7276D5E0577F2" -O- | sudo apt-key add -

Infine aggiornare la lista dei pacchetti con il seguente comando:

sudo apt-get update

Installare programmi per il debugging

Per installare i pacchetti dei simboli per il debug è utile ricordarsi che tali pacchetti hanno il suffisso «-dbgsym». Ad esempio, per installare i simboli di debug per il pacchetto yelp, occorre digitare il seguente comando:

sudo apt-get install yelp-dbgsym
  1. Adesso è stato realizzato un [wiki:Ubuntu/Backtrace Backtrace];
  2. eseguire [:Programmazione/Valgrind:Valgrind], se il programma crasha a causa di Segmentation fault o Bus error;

  3. a scelta, potrebbe venir chiesta una wiki:Ubuntu/Strace.

Versioni di Ubuntu precedenti

Questa sezione riguarda le versioni che precedono Ubuntu 6.10 «Edgy Eft».

Immagine(Icone/Piccole/note.png,,center)

Se si vuole creare un pacchetto, assicurarsi di avere la linea deb-src in /etc/apt/sources.list

Controllare se il pacchetto è disponibile per la versione di debugging. Generalmente, i pacchetti di debug saranno identificati con il suffisso -dbg.

Se non è disponibile, è possibile crearne uno in questo modo:

installare lo script seguente:

sudo apt-get install devscripts fakeroot

scoprire quale pacchetto appartiene al proprio programma:

dpkg --search <program> 

installare le dipendenze:

sudo apt-get build-dep <package>

creare .deb per il debugging:

export DEB_BUILD_OPTIONS="debug nostrip noopt"
fakeroot apt-get source -b <package>

installare i necessari .deb (si troveranno nella cartella di lavoro, in caso di successo nella creazione):

sudo debi <package>*.changes

Xorg server

Il server X server è in grado di gestire i crash creando uno "scarico" (dump) lasciando la traccia in /var/log/Xorg.0.log. Questa traccia è modificata dallo stesso segnale responsabile. Per ottenere un "normale" crash, cioè che crei un core dump (e un resoconto tramite apport), aggiungere nel file /etc/X11/xorg.conf la seguente opzione:

Section "ServerFlags"
        Option "NoTrapSignals" "true"
EndSection

Ulteriori risorse


CategoryProgrammazione CategoryDaRevisionare