GDB Debugger Questions & Answers – 4

DigitalOcean Referral Badge DigitalOcean Referral Badge

1.

The execution of the program in GDB can be affected by

   A.) arguments
   B.) working directory
   C.) environment
   D.) all of these

Answer: Option 'D'

all of these

DigitalOcean Referral Badge

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 these

Answer: Option 'A'

run

DigitalOcean Referral Badge

3.

Inside GDB, a program may stop because of

   A.) a signal
   B.) a breakpoint
   C.) step command
   D.) all of these

Answer: Option 'D'

all of these

DigitalOcean Referral Badge

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 these

Answer: Option 'A'

watchpoint

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

5.

With the list command, by default GDB prints the ____ source lines.

   A.) 20
   B.) 10
   C.) all
   D.) none of these

Answer: Option 'B'

10

DigitalOcean Referral Badge

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 these

Answer: Option 'A'

::

DigitalOcean Referral Badge

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 these

Answer: Option 'A'

x

DigitalOcean Referral Badge

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 these

Answer: Option 'A'

convenience variables

DigitalOcean Referral Badge

9.

In GDB, we can refer to machine register contents, in expressions, as variables with names starting with

   A.) $
   B.) #
   C.) !
   D.) none of these

Answer: Option 'A'

$

DigitalOcean Referral Badge
    DigitalOcean Referral Badge DigitalOcean Referral Badge

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 these

Answer: Option 'A'

info float

DigitalOcean Referral Badge

GDB Debugger Questions & Answers – 4 Download Pdf

Recent Posts