GDB Debugger Questions & Answers – 4

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

1. The execution of the program in GDB can be affected by
a) arguments
b) working directory
c) environment
d) all of the mentioned
View Answer

Answer: d
Explanation: None.

2. While debugging with GDB, arguments to the program can be specified by the arguments of _____ command.
a) run
b) gdb
c) make
d) none of the mentioned
View Answer

Answer: a
Explanation: None.

3. Inside GDB, a program may stop because of
a) a signal
b) a breakpoint
c) step command
d) all of the mentioned
View Answer

Answer: d
Explanation: None.

4. Which one of the following is a special breakpoint that stops the program when the value of an expression changes in GDB?
a) watchpoint
b) catchpoint
c) getpoint
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement
advertisement

5. With the list command, by default GDB prints the ____ source lines.
a) 20
b) 10
c) all
d) none of the mentioned
View Answer

Answer: b
Explanation: None.

6. In GDB which one of the following allows us to specify a variable in terms of the file or function where it is defined?
a) ::
b) @
c) $
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!

7. If we want to print the value of a variable in hexadecimal, we have to use “print” command with the option ___ in GDB.
a) x
b) h
c) hex
d) none of the mentioned
View Answer

Answer: a
Explanation: None.

8. Which one of the following variables is used within GDB to hold on to a value and refer to it later?
a) convenience variables
b) environment variables
c) temporary variables
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

9. In GDB, we can refer to machine register contents, in expressions, as variables with names starting with
a) $
b) #
c) !
d) none of the mentioned
View Answer

Answer: a
Explanation: None.

10. In GDB hardware-dependent information about the floating point unit can be displayed by the command
a) info float
b) display float
c) show float
d) none of the mentioned
View Answer

Answer: a
Explanation: None.
advertisement

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.

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.