GDB Debugger Questions & Answers – 3

This set of Linux / Unix questions and answers focuses on GDB. This is set 1.

1. Which one of the following is not true about GDB?
a) quit command is used to exit the GDB
b) kill command is used to stop execution in GDB
c) if the execution is stopped by kill command then it can not be started again
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

2. While debugging with GDB
a) variables can be print
b) variables can be modify
c) variables can be print & modify
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

3. GDB command “frame” is used
a) to change the stack frames
b) to check the stack frames only
c) it is not a valid command
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement
advertisement

4. The GDB command “info local”
a) displays the list of local variables
b) value of local values for the current stack frame
c) displays the list of local variables & value of local values for the current stack frame
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

5. If we have multiple source files, then during the debugging with GDB
a) breakpoint can not be set
b) break point can be set by “break” command with a filename
c) break point can be set only to makefile
d) none of the mentioned
View Answer

Answer: b
Explanation: None.
Note: Join free Sanfoundry classes at Telegram or Youtube

6. What is temporary breakpoint?
a) it stops the program once
b) it is removed after one execution of the program
c) it stops the program once & removes after one execution of the program
d) none of the mentioned
View Answer

Answer: c
Explanation: None.

7. In GDB breakpoints can be skipped by the command
a) ignore
b) reject
c) skip
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

8. Which GDB command is used to examine the memory?
a) x
b) y
c) z
d) none of the mentioned
View Answer

Answer: a
Explanation: None.

9. Which one of the following is not true about the GDB?
a) info register is used to see that what is in the processor registers
b) processor registers can not be accessed by GDB
c) first 32 bits of the variable can not be examined
d) none of the mentioned
View Answer

Answer: c
Explanation: None.
advertisement

10. Assemble code of the program can be displayed in GDB by the command
a) disassemble
b) assemble
c) assembly
d) none of the mentioned
View Answer

Answer: a
Explanation: None.

Sanfoundry Global Education & Learning Series – Linux Administration & Programming.
Here’s the list of Best Books in Linux Commands & Shell Programming.
Here’s the list of Best Books in Linux Kernel, Device-Drivers & System Programming.

To practice all questions on Linux Administration & Programming, here is complete set of 1000+ Multiple Choice Questions and Answers on Linux.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.