How Do I Start Gdb on Linux?
Contents

How do I run a GDB file?

Use the run command to start your program under GDB. You must first specify the program name with an argument to GDB (see the description of the gdb utility). The run creates an inferior process and makes that process run your program. Specify the arguments to give your program as the arguments of the run command.

How do I run GDB on Ubuntu?

How to use GDB?

  1. Step 1: Compile and Build program with debugging symbols $ gcc -g main. c You can see -g flag is provided to compile program. …
  2. Step 2: Run program with GDB $ gdb a.out. …
  3. Step 3: Use GDB commands to analyze and debug program.
  4. Step 4: Exit GDB (gdb) quit Type “quit” on GDB prompt to exit GDB.
Alexander Ross

Alexander Ross

Gaming, Esports & Interactive Media Writer

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.

Share this article
Twitter Facebook Pinterest