-
Notifications
You must be signed in to change notification settings - Fork 141
GDB
This page is maintained by Ivan ...
Full gdb manual.
Debugging is the process of finding and resolving defects or problems within a computer program that prevent correct operation of computer software or a system.
Two tactics of debugging exists:
- By using debugging programs which includes user interface for step-by-step program running e.g. GNU Debugger.
- Output of the current state of the program using output statements located at critical points of the program on the monitor.
The GNU Project Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, C, C++, Objective-C, Free Pascal, Fortran, Go, Java and partially others.
If you are using Linux, you probably already have GDB. You only have to follow the guide below. But if you are using Windows, you will need to use this guide on YouTube to install and this one to build program to be used by GDB there.
1. Open console. (Ctrl + Alt + T for Linux)
2. Open directory with your program file. (Use command "ls -al" to view your directory list. Use "cd 'path'")
3. Compile your program with "-g" key in order to include information about debugging into your running file. Write in console "gcc -g 'NameOfFile.c' -o 'NameOfRunFile'".
// GNU Debugger is usually used to debug C or C++ files.
4. And then you can upload your program into GDB. Write in console "gdb 'NameOfRunFile'" for Linux. If it works you will instantly appear in (gdb) console.
MIPT-V / MIPT-MIPS — Cycle-accurate pre-silicon simulation.