Run Sanfoundry’s sample source file gfile.c and do the following under GDB control:
-
1. Set breakpoint at main()
2. Run the program now (it should stop at main)
3. Single step once
4. Show the content of gfile.c
5. Show the content of main() function
6. Show stack frames
7. Show stack frames and local variables in each frames
8. Show local variables for main
9. Show value of lvar and change it to 4
10. Show global variables
11. Show values of global variables
12. Show arguments to the program
13. Show process map
14. Show registers
15. Show assembly level instructions for main()
16. show 10 instructions at the current instruction pointer
17. Show all threads
18. Print the address of gvar variable
19. Dump/print 10 bytes at a specified address (take address of gvar)
20. set breakpoint at sum
21. run the program now (it should stop at sum)
22. Single step once
23. Show local variables of sum()
24. Show local variables of main()
25. Single step
26. Step over the next line (it will not enter function)
27. Execute the next assembly instruction
28. Continue to execute the program till the end