GDB Debugger Questions & Answers – 3

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 these

Answer: Option 'C'

if the execution is stopped by kill command then it can not be started again

DigitalOcean Referral Badge

2.

While debugging with GDB

   A.) variables can be print
   B.) variables can be modify
   C.) variables can be print & modify
   D.) none of these

Answer: Option 'C'

variables can be print & modify

DigitalOcean Referral Badge

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 these

Answer: Option 'A'

to change the stack frames

DigitalOcean Referral Badge

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 these

Answer: Option 'C'

displays the list of local variables & value of local values for the current stack frame

DigitalOcean Referral Badge

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 these

Answer: Option 'B'

break point can be set by “break” command with a filename

DigitalOcean Referral Badge

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 these

Answer: Option 'C'

it stops the program once & removes after one execution of the program

DigitalOcean Referral Badge

7.

In GDB breakpoints can be skipped by the command

   A.) ignore
   B.) reject
   C.) skip
   D.) none of these

Answer: Option 'A'

ignore

DigitalOcean Referral Badge

8.

Which GDB command is used to examine the memory?

   A.) x
   B.) y
   C.) z
   D.) none of these

Answer: Option 'A'

x

DigitalOcean Referral Badge

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 these

Answer: Option 'C'

first 32 bits of the variable can not be examined

DigitalOcean Referral Badge

10.

Assemble code of the program can be displayed in GDB by the command

   A.) disassemble
   B.) assemble
   C.) assembly
   D.) none of these

Answer: Option 'A'

disassemble

DigitalOcean Referral Badge

GDB Debugger Questions & Answers – 3 Download Pdf

Recent Posts