Explore topic-wise MCQs in Testing Subject.

This section includes 657 Mcqs, each offering curated multiple-choice questions to sharpen your Testing Subject knowledge and support exam preparation. Choose a topic below to get started.

1.

The result of an expression can be assigned to an environement variable with the command

A. assign
B. set
C. env
D. none of the mentioned
Answer» C. env
2.

Which one of the following GDB command deletes any breakpoint at the next instruction to be executed in the selected stack frame?

A. clear
B. delete
C. disable
D. none of the mentioned
Answer» B. delete
3.

Which one of the following GDB command allows to move from one stack frame to another without printing the frame?

A. select-frame
B. frame
C. frame move
D. none of the mentioned
Answer» B. frame
4.

The GDB text user interface uses the ____ library to show the source file.

A. Curses
B. YUI
C. JUI
D. None of the mentioned
Answer» B. YUI
5.

By default the GDB automatically executes the command from its

A. init files
B. start files
C. begin files
D. none of the mentioned
Answer» B. start files
6.

The user can define a command for GDB with the command

A. define
B. command
C. assign
D. none of the mentioned
Answer» B. command
7.

The GDB command “show output-radix”

A. sets the default base for numeric display
B. displays the current default base for numeric display
C. sets the default base
D. none of the mentioned
Answer» C. sets the default base
8.

The command “show commands” of GDB

A. displays the last 10 commands in the command history
B. displays all commands of the command history
C. displays all the commands available in GDB
D. none of the mentioned
Answer» B. displays all commands of the command history
9.

Which one of the following command saves the command history of GDB in a file?

A. history
B. set history
C. set history save on
D. none of the mentioned
Answer» D. none of the mentioned
10.

In GDB, a tracepoint can be set by the command

A. trace
B. set
C. break trace
D. none of the mentioned
Answer» B. set
11.

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» B. display float
12.

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» B. #
13.

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
Answer» B. environment variables
14.

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» B. h
15.

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
Answer» B. @
16.

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

A. 20
B. 10
C. all
D. none of the mentioned
Answer» C. all
17.

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» B. catchpoint
18.

Inside GDB, a program may stop because of

A. a signal
B. a breakpoint
C. step command
D. all of the mentioned
Answer» E.
19.

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» B. gdb
20.

The execution of the program in GDB can be affected by

A. arguments
B. working directory
C. environment
D. all of the mentioned
Answer» E.
21.

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

A. disassemble
B. assemble
C. assembly
D. none of the mentioned
Answer» B. assemble
22.

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 the mentioned
Answer» D. none of the mentioned
23.

Which GDB command is used to examine the memory?

A. x
B. y
C. z
D. none of the mentioned
Answer» B. y
24.

In GDB breakpoints can be skipped by the command

A. ignore
B. reject
C. skip
D. none of the mentioned
Answer» B. reject
25.

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 the mentioned
Answer» D. none of the mentioned
26.

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 the mentioned
Answer» C. break point can be set only to makefile
27.

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 the mentioned
Answer» D. none of the mentioned
28.

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 the mentioned
Answer» B. to check the stack frames only
29.

While debugging with GDB

A. variables can be print
B. variables can be modify
C. variables can be print & modify
D. none of the mentioned
Answer» D. none of the mentioned
30.

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 the mentioned
Answer» D. none of the mentioned
31.

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» B. break all
32.

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» D. none of the mentioned
33.

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
Answer» B. b start
34.

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» E.
35.

Which GDB command reloads the debugging information?

A. file
B. reload
C. reload
D. none of the mentioned
Answer» B. reload
36.

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» D. none of the mentioned
37.

The specific break point can be deleted by _____ command in GDB.

A. delete
B. del
C. remove
D. remove
Answer» B. del
38.

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» C. forwardtrace
39.

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» B. show
40.

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» B. print/h
41.

To print the value of a variable while debugging with GDB, ______ command can be used

A. printf
B. print
C. show
D. none of the mentioned
Answer» C. show
42.

At the time of debugging with GDB, if we just press ENTER

A. GDB will repeat the same command you just gave it
B. GDB will do nothing
C. GDB will exit
D. None of the mentioned
Answer» B. GDB will do nothing
43.

In GDB debugging, we can proceed to the next breakpoint with command

A. next
B. continue
C. both next and continue
D. none of the mentioned
Answer» C. both next and continue
44.

In debugging with GDB, break points can be set to

A. any line
B. any function
C. both any line and function
D. none of the mentioned
Answer» D. none of the mentioned
45.

The command “gdb sanfoundy”

A. will start debugging for the file “sanfoundry” if the file is compiled with -g option with GCC
B. will create executable for debugging
C. will provide all errors present in the file “sanfoundry”
D. none of the mentioned
Answer» B. will create executable for debugging
46.

GDB can be used for

A. c language
B. c++ language
C. both c and c++ language
D. none of the mentioned
Answer» D. none of the mentioned
47.

GDB stands for

A. GNU debugger
B. General debugging breakpoint
C. General debugger
D. None of the mentioned
Answer» B. General debugging breakpoint
48.

In GDB, breakpoints can be set by the command

A. break
B. b
C. both break and b
D. none of the mentioned
Answer» D. none of the mentioned
49.

For debugging with GDB, the compiled program can be run by the command

A. run
B. execute
C. ./<filename>
D. none of the mentioned
Answer» B. execute
50.

Which command can be used to update the shared library system?

A. lconfig
B. ldconfig
C. slconfig
D. none of the mentioned
Answer» C. slconfig