250+ TOP MCQs on GDB Debugger and Answers

Linux / Unix questions and answers focuses on GDB. This is set 2.1. Which GDB command prints the value of a variable in hex.
a) print/x
b) print/h
c) print/e
d) none of the mentioned

Answer: a
Clarification: None.

2. Which GDB command interrupts the program whenever the value of a variable is modified and prints the value old and new values of the variable?
a) watch
b) show
c) trace
d) none of the mentioned

Answer: a
Clarification: None.

3. Which GDB command produces a stack trace of the function calls that lead to a segmentation fault?
a) trace
b) backtrace
c) forwardtrace
d) none of the mentioned

Answer: b
Clarification: None.

4. The specific break point can be deleted by _____ command in GDB.
a) delete
b) del
c) remove
d) none of the mentioned

Answer: a
Clarification: None.

5. The “step” command of GDB
a) executes the current line of the program
b) stops the next statement to be executed
c) executes the current line of the program & stops the next statement to be executed
d) none of the mentioned

Answer: c
Clarification: None.

6. Which GDB command reloads the debugging information?
a) file
b) reload
c) debug
d) none of the mentioned

Answer: a
Clarification: None.

7. GDB can be used
a) to find out the memory leakages
b) to get the result of a particular expression in a program
c) to find the reason of segementation fault
d) all of the mentioned

Answer: d
Clarification: None.

8. Which GDB command can be used to put a breakpoint at the beginning of the program?
a) b main
b) b start
c) break
d) none of the mentioned

  250+ TOP MCQs on File Permissions and Answers

Answer: a
Clarification: None.

9. To put the breakpoint at the current line ____ command can be used?
a) b
b) break
c) both b and break
d) none of the mentioned

Answer: c
Clarification: None.

10. We can list all the breakpoint in GDB by the command
a) info break
b) break all
c) both info break and break all
d) none of the mentioned

Answer: a

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top