SlideShare uma empresa Scribd logo
1 de 12
Baixar para ler offline
Gdb


Juan A. Suárez Romero



          Master on Free Software
List of topics
●   Bugs
●   Fixing bugs
●   GDB
●   Ways of working
●   Coredumps
●   Main basic commands


                      Master on Free Software
What is a bug?
●   Basically, an error in a program
●    When a program performs as it shouldn't
    perform
●   All software have bugs
    –   Programming is complex
    –   Human task -> errors



                       Master on Free Software
Fixing bugs
●   Have you ever debugged a program?
●   Have you ever debugged a C program?
●   A debugger allows you to check how a
    program is executed or checking what
    was doing when it crashed
●   In gnome we use gdb for debugging



                     Master on Free Software
GDB
●   GNU Debugger
●   Text mode
    –   Other frontends: IDEs, emacs, DDD, XXGDB
●   Trace the code
    –   See what is doing
    –   Inspect the data



                            Master on Free Software
GDB


●   Requirements to debug an application
    –   Add debugging symbols -> not stripped
    –   Remove optimizations (-O0)




                         Master on Free Software
Ways of working


●   debug a program, start and stop


●   debug a running process


●   debug a core file (cores activate)


                      Master on Free Software
Core dumps
●   Dump of information of a process when it
    crashes
    –   See while it crashed
    –   Inspect data
●   ulimit -c <size of core>
●   ./gdb <program> <core>



                          Master on Free Software
Commands
●   Run: runs the program from start
●   Continue: continues running a stopped program
●   Backtrace: show the stack
●   Break: add a breakpoint
●   Delete: delete a breakpoint
●   Next: runs the current line to next
●   Step: same as Next, but if current is a function, enter
    inside
●   Print: print the content of a variable
●   Display: same as Print, but more permanent
                              Master on Free Software
Other commands
●   Watchpoints (slow)
●   Handle signals
●   Remote debug
●   Use the refcard:
        http://www.cs.dal.ca/studentservices/refcards/gdbref.pdf




                             Master on Free Software
References


●   refcard:
    www.cs.dal.ca/studentservices/refcards/gdbref.pdf
●   http://www.gnu.org/software/gdb/gdb.html




                          Master on Free Software
Acknowledgments


●   Alejandro García Castro




                     Master on Free Software

Mais conteúdo relacionado

Semelhante a MSL2009. Gdb

Debugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbDebugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbSenthilKumar Selvaraj
 
gdb-tutorial.pdf
gdb-tutorial.pdfgdb-tutorial.pdf
gdb-tutorial.pdfligi14
 
Extending GDB with Python
Extending GDB with PythonExtending GDB with Python
Extending GDB with PythonLisa Roach
 
Introduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debuggerIntroduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debuggerNaoto Ono
 
LCU14 201- Binary Analysis Tools
LCU14 201- Binary Analysis ToolsLCU14 201- Binary Analysis Tools
LCU14 201- Binary Analysis ToolsLinaro
 
Writing mruby Debugger
Writing mruby DebuggerWriting mruby Debugger
Writing mruby Debuggeryamanekko
 
Gdb tutorial-handout
Gdb tutorial-handoutGdb tutorial-handout
Gdb tutorial-handoutSuraj Kumar
 
Drupal and contribution (2010 - 2011 / 2)
Drupal and contribution (2010 - 2011 / 2)Drupal and contribution (2010 - 2011 / 2)
Drupal and contribution (2010 - 2011 / 2)Peter Arato
 
Android app to the challenge
Android   app to the challengeAndroid   app to the challenge
Android app to the challengeUdi Cohen
 
Debugging With the GNU Debugger
Debugging With the GNU DebuggerDebugging With the GNU Debugger
Debugging With the GNU Debuggergoakley123
 
Introduction to segmentation fault handling
Introduction to segmentation fault handling Introduction to segmentation fault handling
Introduction to segmentation fault handling Larion
 
Debug JNI code with ndk-gdb and eclipse GUI
Debug JNI code with ndk-gdb and eclipse GUIDebug JNI code with ndk-gdb and eclipse GUI
Debug JNI code with ndk-gdb and eclipse GUITom Chen
 
Advanced Debugging with GDB
Advanced Debugging with GDBAdvanced Debugging with GDB
Advanced Debugging with GDBDavid Khosid
 
Continuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritageContinuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritageRan Levy
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applicationsRoman Podoliaka
 

Semelhante a MSL2009. Gdb (20)

Debugging Modern C++ Application with Gdb
Debugging Modern C++ Application with GdbDebugging Modern C++ Application with Gdb
Debugging Modern C++ Application with Gdb
 
gdb-tutorial.pdf
gdb-tutorial.pdfgdb-tutorial.pdf
gdb-tutorial.pdf
 
Debuging like a pro
Debuging like a proDebuging like a pro
Debuging like a pro
 
Extending GDB with Python
Extending GDB with PythonExtending GDB with Python
Extending GDB with Python
 
GNU Debugger
GNU DebuggerGNU Debugger
GNU Debugger
 
Gnu debugger
Gnu debuggerGnu debugger
Gnu debugger
 
Introduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debuggerIntroduction of Tools for providing rich user experience in debugger
Introduction of Tools for providing rich user experience in debugger
 
LCU14 201- Binary Analysis Tools
LCU14 201- Binary Analysis ToolsLCU14 201- Binary Analysis Tools
LCU14 201- Binary Analysis Tools
 
Writing mruby Debugger
Writing mruby DebuggerWriting mruby Debugger
Writing mruby Debugger
 
Gdb tutorial-handout
Gdb tutorial-handoutGdb tutorial-handout
Gdb tutorial-handout
 
Gccgdb
GccgdbGccgdb
Gccgdb
 
Drupal and contribution (2010 - 2011 / 2)
Drupal and contribution (2010 - 2011 / 2)Drupal and contribution (2010 - 2011 / 2)
Drupal and contribution (2010 - 2011 / 2)
 
Android app to the challenge
Android   app to the challengeAndroid   app to the challenge
Android app to the challenge
 
Debugging With the GNU Debugger
Debugging With the GNU DebuggerDebugging With the GNU Debugger
Debugging With the GNU Debugger
 
Introduction to segmentation fault handling
Introduction to segmentation fault handling Introduction to segmentation fault handling
Introduction to segmentation fault handling
 
Debug JNI code with ndk-gdb and eclipse GUI
Debug JNI code with ndk-gdb and eclipse GUIDebug JNI code with ndk-gdb and eclipse GUI
Debug JNI code with ndk-gdb and eclipse GUI
 
Advanced Debugging with GDB
Advanced Debugging with GDBAdvanced Debugging with GDB
Advanced Debugging with GDB
 
Continuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritageContinuous Deployment Applied at MyHeritage
Continuous Deployment Applied at MyHeritage
 
lab1-ppt.pdf
lab1-ppt.pdflab1-ppt.pdf
lab1-ppt.pdf
 
Debugging of (C)Python applications
Debugging of (C)Python applicationsDebugging of (C)Python applications
Debugging of (C)Python applications
 

Mais de Juan A. Suárez Romero

Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)Juan A. Suárez Romero
 
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...Juan A. Suárez Romero
 
Writing multimedia applications with Grilo
Writing multimedia applications with GriloWriting multimedia applications with Grilo
Writing multimedia applications with GriloJuan A. Suárez Romero
 
Grilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia ContentGrilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia ContentJuan A. Suárez Romero
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionJuan A. Suárez Romero
 
Una Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de IntrusosUna Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de IntrusosJuan A. Suárez Romero
 
An add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADEAn add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADEJuan A. Suárez Romero
 
Integrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADEIntegrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADEJuan A. Suárez Romero
 
A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...Juan A. Suárez Romero
 
A Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/OzA Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/OzJuan A. Suárez Romero
 
A Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion DetectionA Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion DetectionJuan A. Suárez Romero
 

Mais de Juan A. Suárez Romero (15)

Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
Graphics stack updates for Raspberry Pi devices (FOSDEM 2024)
 
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
On-going challenges in the Raspberry Pi driver stack: OpenGL 3, Vulkan and mo...
 
Writing multimedia applications with Grilo
Writing multimedia applications with GriloWriting multimedia applications with Grilo
Writing multimedia applications with Grilo
 
Grilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia ContentGrilo: Easy Access to Online Multimedia Content
Grilo: Easy Access to Online Multimedia Content
 
Grilo: present and future
Grilo: present and futureGrilo: present and future
Grilo: present and future
 
Rygel-Grilo
Rygel-GriloRygel-Grilo
Rygel-Grilo
 
MSL2009. Valgrind
MSL2009. ValgrindMSL2009. Valgrind
MSL2009. Valgrind
 
Logical Volume Manager. An Introduction
Logical Volume Manager. An IntroductionLogical Volume Manager. An Introduction
Logical Volume Manager. An Introduction
 
Una Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de IntrusosUna Arquitectura Multiagente Inteligente para la Detección de Intrusos
Una Arquitectura Multiagente Inteligente para la Detección de Intrusos
 
An add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADEAn add-on for managing behaviours with priority in JADE
An add-on for managing behaviours with priority in JADE
 
Integrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADEIntegrating a Priority-Based Scheduler of Behaviours in JADE
Integrating a Priority-Based Scheduler of Behaviours in JADE
 
A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...A New Learning Method for Single Layer Neural Networks Based on a Regularized...
A New Learning Method for Single Layer Neural Networks Based on a Regularized...
 
A Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/OzA Tool for Agent Communication in Mozart/Oz
A Tool for Agent Communication in Mozart/Oz
 
A Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion DetectionA Multi-Agent Architecture for Intrusion Detection
A Multi-Agent Architecture for Intrusion Detection
 
The KNITTER System: KQML for Erlang
The KNITTER System: KQML for ErlangThe KNITTER System: KQML for Erlang
The KNITTER System: KQML for Erlang
 

Último

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfphamnguyenenglishnb
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxMaryGraceBautista27
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxCarlos105
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxnelietumpap1
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPCeline George
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxChelloAnnAsuncion2
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4MiaBumagat1
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...JhezDiaz1
 

Último (20)

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdfAMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
AMERICAN LANGUAGE HUB_Level2_Student'sBook_Answerkey.pdf
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
Science 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptxScience 7 Quarter 4 Module 2: Natural Resources.pptx
Science 7 Quarter 4 Module 2: Natural Resources.pptx
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptxBarangay Council for the Protection of Children (BCPC) Orientation.pptx
Barangay Council for the Protection of Children (BCPC) Orientation.pptx
 
Q4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptxQ4 English4 Week3 PPT Melcnmg-based.pptx
Q4 English4 Week3 PPT Melcnmg-based.pptx
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
What is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERPWhat is Model Inheritance in Odoo 17 ERP
What is Model Inheritance in Odoo 17 ERP
 
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptxGrade 9 Q4-MELC1-Active and Passive Voice.pptx
Grade 9 Q4-MELC1-Active and Passive Voice.pptx
 
ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4ANG SEKTOR NG agrikultura.pptx QUARTER 4
ANG SEKTOR NG agrikultura.pptx QUARTER 4
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
ENGLISH 7_Q4_LESSON 2_ Employing a Variety of Strategies for Effective Interp...
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 

MSL2009. Gdb

  • 1. Gdb Juan A. Suárez Romero Master on Free Software
  • 2. List of topics ● Bugs ● Fixing bugs ● GDB ● Ways of working ● Coredumps ● Main basic commands Master on Free Software
  • 3. What is a bug? ● Basically, an error in a program ● When a program performs as it shouldn't perform ● All software have bugs – Programming is complex – Human task -> errors Master on Free Software
  • 4. Fixing bugs ● Have you ever debugged a program? ● Have you ever debugged a C program? ● A debugger allows you to check how a program is executed or checking what was doing when it crashed ● In gnome we use gdb for debugging Master on Free Software
  • 5. GDB ● GNU Debugger ● Text mode – Other frontends: IDEs, emacs, DDD, XXGDB ● Trace the code – See what is doing – Inspect the data Master on Free Software
  • 6. GDB ● Requirements to debug an application – Add debugging symbols -> not stripped – Remove optimizations (-O0) Master on Free Software
  • 7. Ways of working ● debug a program, start and stop ● debug a running process ● debug a core file (cores activate) Master on Free Software
  • 8. Core dumps ● Dump of information of a process when it crashes – See while it crashed – Inspect data ● ulimit -c <size of core> ● ./gdb <program> <core> Master on Free Software
  • 9. Commands ● Run: runs the program from start ● Continue: continues running a stopped program ● Backtrace: show the stack ● Break: add a breakpoint ● Delete: delete a breakpoint ● Next: runs the current line to next ● Step: same as Next, but if current is a function, enter inside ● Print: print the content of a variable ● Display: same as Print, but more permanent Master on Free Software
  • 10. Other commands ● Watchpoints (slow) ● Handle signals ● Remote debug ● Use the refcard: http://www.cs.dal.ca/studentservices/refcards/gdbref.pdf Master on Free Software
  • 11. References ● refcard: www.cs.dal.ca/studentservices/refcards/gdbref.pdf ● http://www.gnu.org/software/gdb/gdb.html Master on Free Software
  • 12. Acknowledgments ● Alejandro García Castro Master on Free Software