Depanatorul GNU
GNU Debugger (Depanatorul GNU), de obicei numit GDB, este depanatorul (engleză debugger) standard pentru sistemul de software GNU. Este un depanator portabil care rulează pe multe sisteme Unix-like și funcționează pentru multe limbaje de programare, printre care Ada, C, C++, FreeBASIC și Fortran. IstorieGDB 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 distribuțiile BSD. Între 1990 și 1993 a fost dezvoltat de John Gilmore, iar în prezent este menținut de Comitetul GDB, numit de Fundația pentru Software Liber.[2] Detalii tehniceFuncționalitățiDepanare remoteLimităriExemple de comenziO sesiune exempluAcesta 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 În acest exemplu, programul este rulat. După ce se găsește cauza erorii (segmentation fault), programul este editat pentru a avea comportamentul corect. Programul corectat este recompilat cu GCC și apoi rulat. Pentru mai multe detalii asupra comenzilor disponibile în GDB vezi pagina de manual gdb. Vezi și
Referințe
Bibliografie
Legături externeDocumentație
Tutoriale
|
Portal di Ensiklopedia Dunia