CentrioHost Blog

Stories and News from IT Industry, Reviews & Tips | Technology Blog


GDB for Debugging Linux Software

GDB is a nice tool for debugging linux software and find out its flaws. Let me give an easy way how you can use gdb to debug your application. If you see one of your application crashing or not working well, you can use gdb to debug it and send the result to its developers. The only thing you need to make sure is that , your program must be compiled with the debugger flag ‘-g’ , if not there will be no debugger flags in the software. In general all free and opensource software have gdb feature enabled by default.

Let us take and example here to study GDB . The command is “gedit” . It is an editor in gnome.

Step 1 : Go to shell and start the command with gdb

# gdb  gedit

It will show the following in my box,

sherin@:~$ gdb gedit
GNU gdb (GDB) 7.1-ubuntu
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu".
For bug reporting instructions, please see:
...
Reading symbols from /usr/bin/gedit...(no debugging symbols found)...done.
(gdb)

Step 2 : Run the command from gdb prompt

(gdb) run
Starting program: /usr/bin/gedit

Now gedit will be open and you can type and save a document.

It will show the debugger output in your gdb terminal

Step 3 : To stop execution use the command kill

(gdb) kill

Step 4: To exit from gdb use the command “quit”

These all are basic to know how you work win gdb.

Now if you need to debug an already running program use the flag –pid=PID

# gdb --pid=10345

Subscribe Now

10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!

Archive Calendar

SatSunMonTueWedThuFri
 1
2345678
9101112131415
16171819202122
23242526272829
3031 

Over 20000 Satisfied Customers!

  • web hosting reviewer
    Valerie Quinn
    CTO, Acteon Group

    Centriohost staff were fantastic, I had a concern with a domain and they got back to me very quickly and they helped me to resolve the issue! ~ . . . Read more

  • Joomla hosting reviewer
    Collin Bryan
    Photographer, Allister Freeman

    I'm using centrio for my portfolio since 2006. The transition was seamless, the support was immediate, and everything works perfectly. ~ . . . Read more

  • dedicated server reviewer
    Harry Collett
    Actor, A&J Artists

    Very easy to understand & use even though I am not very technologically minded. No complications whatsoever & I wouldn't hesitate to recommend it to all. ~ . . . Read more

  • vps web hosting reviewer
    Porfirio Santos
    Technician, Diageo PLC

    Centrio support team have been amazingly responsive and helpful to any of my queries, thank you so much to the Centriohost have been amazingly responsive and helpful to any of my queries 👍👍👍 ~ . . . Read more

  • wordpress hosting plans reviewer
    Catherine Auer
    Doctor, SmartClinics

    Anytime I've had a problem I can't solve, I've found Centriohost to be diligent and persistent. They simply won't let an issue go until the client is happy. ~ . . . Read more

  • reseller hosting reviewer
    Effectivo Social
    Freelancer, Fiverr

    Recommend their shared hosting for all my SME web design clients. Their cloud or VME offerings are too great to deal with. Pricing is perfect and suitable for all users (͠≖ ͜ʖ͠≖) 👌 ~ . . . Read more

Top