GDB
De la Wikipedia, enciclopedia liberă
| Calitatea informaţiilor sau a exprimării din acest articol sau secţiune trebuie îmbunătăţită. Consultaţi manualul de stil şi îndrumarul, apoi daţi o mână de ajutor. Acest articol a fost etichetat în noiembrie 2007 |
| Întreţinere: | GNU Project |
|---|---|
| Ultima versiune: | 6.7.1 / October 29, 2007 |
| Tip: | Debugger |
| Licenţă: | GPL |
| Disponibil în română: | |
| Website: | gnu.org/software/gdb/ |
GNU Debugger (Debugger-ul GNU), de obicei numit GDB, este debuggerul standard pentru sistemul de software GNU. Este un debugger portabil care rulează pe multe sisteme Unix-like şi funcţionează pentru multe limbaje de programare, printre care Ada, C, C++, FreeBASIC şi Fortran.
Cuprins |
[modifică] Istorie
GDB a fost publicat prima dată de Richard Stallman în 1986 ca parte a sistemului său GNU, după ce GNU Emacs a fost „suficient de stabil”. [1] GDB este software liber, publicat sub GPL. A fost modelat după Dbx debugger, care venea cu distibuţiile BSD.
[modifică] Detalii tehnice
[modifică] Funcţionalităţi
[modifică] Depanare remote
[modifică] Limitări
[modifică] Exemple de comenzi
[modifică] O sesiune exemplu
Acesta un exemplu de sesiune GDB pe un program de exemplu în stack trace:
GNU gdb Red Hat Linux (6.3.0.0-1.21rh) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/libthread_db.so.1". (gdb) run Starting program: /home/sam/programming/crash Reading symbols from shared object read from target memory...done. Loaded system supplied DSO at 0xc11000 This program will demonstrate gdb Program received signal SIGSEGV, Segmentation fault. 0x08048428 in function_2 (x=24) at crash.c:22 22 return *y; (gdb) edit (gdb) shell gcc crash.c -o crash -gstabs+ (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y warning: cannot close "shared object read from target memory": File in wrong format `/home/sam/programming/crash' has changed; re-reading symbols. Starting program: /home/sam/programming/crash Reading symbols from shared object read from target memory...done. Loaded system supplied DSO at 0xa3e000 This program will demonstrate gdb 24 Program exited normally. (gdb) quit
Program este rulat. După ce se găseşte cauza segmentation fault, programul este editat pentru a folosi comportamentul corect. Programul corectat este recompilat cu GCC şi apoi rulat.
[modifică] Mai vezi
- Binary File Descriptor (libbfd)
[modifică] Referinţe
- ^ Curs al lui Richard Stallman la Instittul Regal de Tehnologie, Suedia (30-10-1986). Accesat la data de 2006-09-21. „Then after GNU Emacs was reasonably stable, which took all in all about a year and a half, I started getting back to other parts of the system. I developed a debugger which I called GDB which is a symbolic debugger for C code, which recently entered distribution. Now this debugger is to a large extent in the spirit of DBX, which is a debugger that comes with Berkeley Unix.“
[modifică] Citiţi în continuare
- Richard M. Stallman, Roland Pesch, Stan Shebs, et al., Debugging with GDB (Free Software Foundation, 2002) ISBN 1-882114-88-4
[modifică] Legături externe
[modifică] Documentaţie
- Documentaţia gdb: "Debugging with GDB" (html şi >400 de pagini ca pdf)
- GDB Internals
[modifică] Tutoriale
- Tutorialul GDB al lui Peter Jay Salzman: Using GNU's GDB Debugger

