How to use gdb with gui to debug c program. gdb is very strong debug tool. gdb tool comes with very simple inbuilt graphical user interface. In this article we will learn how to use gdb with its inbuilt gui.

how to use gdb with gui to debug c program

( Step 1) Let us create a simple C program as shown below.

Step 2) build sample code ( file: sample.c)

Note: To debug c/cpp program compile with -g option is necessary. After running above command ( step 2) , our executable or binary file sample would be created inside current working directory. to know the current working directory run pwd command on linux terminal.

Step 3) Run gdb with binary sample to debug with GUI

After running above command you will get gdb running with your binary file sample with a simple screen on top of the terminal screen. simply debug your program. when we do break and execute next command on gdb , you can see highlighted code executing on screen.

Video tutorial for how to use gdb with gui to debug c program




Related Contents to follow