Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- int main() {
- int a = 5;
- int b = 7;
- int result = a + b;
- printf("Result: %d\n", result);
- return 0;
- }
- +++Langkah-langkah untuk menggunakan GDB+++
- Kompilasi program:
- #gcc -o my_program -g my_program.c
- Mulai GDB:
- #gdb my_program
- Jalankan program:
- #run
- Lihat nilai variabel result:
- #print result
- Tetapkan breakpoint di baris printf:
- #break line_number
- Jalankan program hingga breakpoint:
- #run
- Langkah demi langkah:
- #step
- Melihat stack trace:
- #backtrace
- Keluar dari GDB:
- #quit
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement