What is Debugging! How to do it ?

Sushant Gupta
2 min readMay 9, 2020

--

If you are a programmer, coder or a computer science enthusiast then, this is something which you have probably heard from your friend, colleague or in you coding community!

Debugging is such an important part of programming, not just programming but learning too. Because if you know how to debug your code, you are actually going to understand how your code works & how the computer actually run your code!

So, what’s the point of debugging, what do you mean when someone says lets debug our code!

The word DEBUG means to DE-BUG i.e., to remove bugs from code

In order to remove bugs from our code we have to diagnose what is wrong with our program. Debugging concepts are apply to any of the IDEs out there.

So, Here we are using GDB Tool to debug our programs!

Source : giphy.com

Now, What is this GDB Tool?

GDB — The GNU Project Debugger, is a powerful debugging tool for c,c++ and many other programming languages. It allows you to poke around inside your programs while they’re executing.

It actually gives you the opportunity to see exactly what happens when your program crashes. GDB is a command line tool that means you interact with it in a terminal using commands.

It’s a free( libre ) software. The latest version of GDB, version 9.1, is available online. Here are two ways to download GDB Tool :

  1. With MinGW GNU Compiler!
  2. With TDM-GCC Compiler!

You can download it for any IDEs which suits you best. It supports mostly all the possible languages. GDB itself can run on most popular GNU/Linux, Unix and Microsoft Windows Variants.

You can check that you’ve downloaded the GDB tool with the latest version or not? , by writing a single command in your command prompt!

“ gdb -v ”

From Command Prompt

End of /Part 1

In the /Part 2, you will get to know how it works & what are the commands which helps to debug! You’ll gonna like this tool as it helps you most of the time during debugging! (Here is the part 2)

--

--