GDB for Debugging Linux Software
- Category : Linux Helpline (Easy Guide)
- Posted on : Jun 15, 2019
- Views : 3,076
- By : Kapueo I.
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
Categories
- cPanel Question 47
- cPanel Software Management 29
- cPanel Tutorials 13
- Development 29
- Domain 13
- General 19
- Linux Helpline (Easy Guide) 156
- Marketing 47
- MySQL Question 13
- News 2
- PHP Configuration 14
- SEO 4
- SEO 42
- Server Administration 84
- SSL Installation 54
- Tips and Tricks 24
- VPS 3
- Web Hosting 44
- Website Security 22
- WHM questions 13
- WordPress 148
Subscribe Now
10,000 successful online businessmen like to have our content directly delivered to their inbox. Subscribe to our newsletter!Archive Calendar
Sat | Sun | Mon | Tue | Wed | Thu | Fri |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 |
30 |
Recent Articles
-
Posted on : Sep 17
-
Posted on : Sep 10
-
Posted on : Aug 04
-
Posted on : Apr 01
Tags
- ts
- myisam
- vpn
- sql
- process
- kill
- tweak
- server load
- attack
- ddos mitigation
- Knowledge
- layer 7
- ddos
- webmail
- DMARC
- Development
- nginx
- seo vpn
- Hosting Security
- wireguard
- innodb
- exim
- smtp relay
- smtp
- VPS Hosting
- cpulimit
- Plesk
- Comparison
- cpu
- encryption
- WHM
- xampp
- sysstat
- optimize
- cheap vpn
- php-fpm
- mariadb
- apache
- Small Business
- Error
- Networking
- VPS
- SSD Hosting
- Link Building
- centos
- DNS
- optimization
- ubuntu