4. Which GDB command produces a stack trace of the function calls? O a. trace o
ID: 3815182 • Letter: 4
Question
4.
Which GDB command produces a stack trace of the function calls? O a. trace o b. forwar O C, none d backtrace While debugging with GDB a variables can be printed out b variables can be modified o c both (a) and (b) O d. none of the mentioned In the following program, at breakpoint line 3, when you type "p x", what value will be printed out? At breakpoint line 6, when you type "p x", what value will be printed out? 1 void foo1 (void)( int x F 1 3 nt y 2, 4 5 void foo2 (void 6 int x 3; 7 nt y 2 8 9 int main 10 10. foo 11 foo2 12 return 0 13 a. 3,3 b. 3.1 O c. 1,3 d. 1,1Explanation / Answer
Please follow the data and description :
1) A backtrace is the flow of how the program got executed or implemented and where it is. It shows one line per frame, for many frames, starting with the currently executing frame, followed by its caller, and on up the stack.
So the answer is OPTION D (Backtrace).
2) While the process of debugging with GDB the defined variables can be modified and then even be printed out as and when needed.
So the answer is OPTION C (both a and b).
3) When the program breakpoints 3 and 6 are replaced with the given value we have the values 3 and 3 as the ouput regardless of the execution.
So the answer is OPTION A (3, 3).
Hope this is helpful.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.