Question: F . 4 Debugging Session i ) Load the program to be debugged with gdb . / cVirX ii ) List the source code of

F.4 Debugging Session i) Load the program to be debugged with gdb ./cVirX ii) List the source code of the function to be debugged with l main; display the next 10 lines with l iii) Set a breakpoint at line 79 with b 79 iv) Run the program providing its arguments, until the breakpoint at line 79 with r arg1 arg2 arg3 v) Print argc with p argc and the first argument with p argv[1] vi) Display list of function arguments with info args vii) Execute the next instruction with s(step) and print V p V viii) Execute the puts function with n(next) without stepping inside the function ix) Display stack frame of main with info frame and analyze it x) Display local variables in the stack frame of main with info locals and analyze it xi) Set a breakpoint at line 45 with b 45 xii) Execute the program until the breakpoint witn c(continue) xiii) Examine the context of function f1(arguments, local variables) xiv) Use relevant instructions to examine the context of function f2(arguments, local variables) xv) Stop debugging with q(quit)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!