Although I prefer the command line interface if I work with gdb, but gdb can be operated in GUI (graphical user interface) mode via front end application DDD (Data Display Debugger).
To install DDD, open your linux terminal and type the command below:
$ sudo apt-get install ddd [sudo] password for darklinux: Reading package lists... Done Building dependency tree Reading state information... Done Suggested packages: ddd-doc pydb glibc-doc gnuplot The following NEW packages will be installed: ddd 0 upgraded, 1 newly installed, 0 to remove and 310 not upgraded. Need to get 1,428 kB of archives. After this operation, 3,920 kB of additional disk space will be used. Get:1 http://old-releases.ubuntu.com/ubuntu/ oneiric/universe ddd i386 1:3.3.12-2.1 [1,428 kB] Fetched 1,428 kB in 5s (270 kB/s) Selecting previously deselected package ddd. (Reading database ... 152578 files and directories currently installed.) Unpacking ddd (from .../ddd_1%3a3.3.12-2.1_i386.deb) ... Processing triggers for man-db ... Processing triggers for doc-base ... Processing 2 added doc-base files... Registering documents with scrollkeeper... Processing triggers for install-info ... Processing triggers for gnome-menus ... Processing triggers for desktop-file-utils ... Setting up ddd (1:3.3.12-2.1) ... $
To run the program, type ddd.
$ddd
If installation is correct, you will get this welcome screen.
Now you can select a file for a test. Click File > Open Program.
Select the file and click ‘open’ button.
You will get the screen below.
There are 3 windows will be open.
–Source window (you will see your source code)
–Data window (assembly language code here)
–GDB console (you can type gdb command line here)
To close, just select “File>Exit” or type “Ctrl-Q”.
To set breakpoint, just select the line in your code. In this tutorial, I select ‘_start’ then click ‘Break’ button (with red STOP color icon).
To start debugging, select “Program>Run” or press F2 button. A small window will be displayed (with DDD-Run program title) for entering any arguments if you have. If you don’t have, just click ‘Run’ button again in this small window.
After program run, it stop at your breakpoint.
You can continue with next process by the menu below:
Try with yourself to proceed with few process.
To check the register status, select Status > Registers on program menu.
Leave a comment