Linux Basics Practice Test: GDB Debugger — Flashcards | Linux | FatSkills

Linux Basics Practice Test: GDB Debugger — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

GNU Debugger (gdb) is an open-source tool for debugging source code in Linux programs. It's also used for commercial software development on UNIX platforms. 

Here are some things you can do with gdb:
Run:
Starts a program execution
Quit: Quits gdb
Print expr: Prints an expression, where expr may be a variable name
Next: Goes to the next line
Set a breakpoint: Pauses a running program and lets you examine the variables, arguments, memory areas, stack, heap, and more
Use breakpoints: Tells gdb to stop or pause the program execution at certain line, or function, or address
Use watchpoints: Stops execution whenever the value of an expression changes 

You can get started with gdb by invoking it using the gdb command, which will display some information about the platform and drop you into the (gdb) prompt. 

Here are some other things you can do with gdb:
Understand why and how a program is crashing
Obtain a backtrace, which is a detailed list of all functions that were running when the program failed
Observe program states on specific breakpoints
Alter the flow or values for further execution 

1 of 50 Ready
For debugging with GDB, the file “fatskills” can be created with the command
gcc -g -o fatskills fatskills.c
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password