250+ TOP MCQs on GDB Debugger and Answers

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

Answer: d
Clarification: 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

Answer: a
Clarification: None.

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

Answer: d
Clarification: 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

Answer: a
Clarification: None.

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

Answer: b
Clarification: 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) @
b) $
d) none of the mentioned

Answer: a
Clarification: None.

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

Answer: a
Clarification: 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

  250+ TOP MCQs on File Management and Answers

Answer: a
Clarification: None.

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

Answer: a
Clarification: 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

Answer: a

Leave a Comment

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

Scroll to Top