GDB: The GNU Project Debugger (2024)

[bugs][maintainers][contributing][currentgit][documentation][download][home][irc][links][mailinglists][news][schedule][song][wiki]

What is GDB?

GDB, the GNU Project debugger, allows you to see what is going on`inside' another program while it executes -- or what another programwas doing at the moment it crashed.

GDB can do four main kinds of things (plus other things in supportof these) to help you catch bugs in the act:

  • Start your program, specifying anything that might affect its behavior.
  • Make your program stop on specified conditions.
  • Examine what has happened, when your program has stopped.
  • Change things in your program, so you can experiment withcorrecting the effects of one bug and go on to learn about another.
Those programs might be executing on the same machine as GDB (native),on another machine (remote), or on a simulator. GDB can run on mostpopular UNIX and Microsoft Windows variants, as well as on macOS.

What Languages does GDB Support?

GDB supports the following languages (in alphabetical order):
  • Ada
  • Assembly
  • C
  • C++
  • D
  • Fortran
  • Go
  • Objective-C
  • OpenCL
  • Modula-2
  • Pascal
  • Rust

GDB version 14.2

Version 14.2 of GDB, the GNUDebugger, is now available for download. See the ANNOUNCEMENT for detailsincluding changes in this release.

An errata list (PROBLEMS) and documentationare also available.

News

May 26th, 2024: GDB 15 branch created

The GDB 15 branch (gdb-15-branch) has been created.To check out a copy of the branch use:

git clone --branch gdb-15-branch https://sourceware.org/git/binutils-gdb.git
March 3rd, 2024: GDB 14.2 Released!

The latest version of GDB, version 14.2, is available for download.

This is a minor corrective release over GDB 14.1, fixing the followingissues:

  • PR symtab/31112 (DLL export forwarding is broken)
  • PR c++/31128 (gdb crashes when trying to print a global variable stub without a running inferior)
  • PR tdep/31254 ([gdb/tdep, arm] FAIL: gdb.threads/staticthreads.exp: up 10)
  • PR gdb/31256 (Crash with basic 'list .')
  • PR python/31366 (Frame.static_link() segfaults)
See the NEWS file for a more complete and detailed list of what this release includes.
December 3rd, 2023: GDB 14.1 Released!

The latest version of GDB, version 14.1, is available for download.
This version of GDB includes the following changes and enhancements:
  • Removed features, removed configurations:
    • GDB no longer support AiX 4.x, 5.x and 6.x. The minimum version supported is AiX 7.1.
    • GDB/MI version 1 support has been removed
  • Initial built-in support for Debugger Adapter Protocol (DAP)
  • GDB now recognizes the NO_COLOR environment variable
  • Initial support for integer types larger than 64 bits
  • Breakpoints can now be inferior-specific
  • New convenience function "$_shell", to execute a shell command and return its result.
  • Python support
    • New class gdb.Thread
    • New class gdb.unwinder.FrameId
    • New class gdb.ValuePrinter
    • New gdb.Inferior.arguments attribute, holding the command-line arguments to the inferior, if known
    • New gdb.Inferior.main_name attribute, holding the name of the inferior's 'main', if known.
    • New gdb.Breakpoint.inferior attribute
    • New gdb.Progspace.symbol_file attribute
    • New gdb.Progspace.executable_filename attribute
    • New function gdb.execute_mi(COMMAND, [ARG]...)
    • New function gdb.block_signals()
    • New method gdb.Frame.static_link
    • New gdb.Inferior 'clear_env', 'set_env' and 'unset_env' methods
    • New gdb.Type now has the 'is_array_like' and 'is_string_like' methods
    • New gdb.Value 'assign' method
    • New gdb.Value 'to_array' method
    • New gdb.Progspace 'objfile_for_address' method
    • New methods added to the gdb.PendingFrame class, with behavior which is the same as the corresponding methods on gdb.Frame.
    • gdb.LazyString now implements the __str__ method
    • New event gdb.ThreadExitedEvent
    • New event gdb.ExecutableChangedEvent
    • New event gdb.NewProgspaceEvent
    • New event gdb.FreeProgspaceEvent
    • The frame-id passed to gdb.PendingFrame.create_unwind_info now use either an integer or a gdb.Value object for each of its 'sp', 'pc', and 'special' attributes.
    • The Disassembler API from the gdb.disassembler module has been extended to include styling support
    • gdb.parse_and_eval now has a new "global_context" parameter, allowing the request to only examine global symbols.
    • The name argument passed to gdb.unwinder.Unwinder.__init__ must now be of type 'str' otherwise a TypeError will be raised.
    • The gdb.unwinder.Unwinder.enabled attribute can now only accept values of type 'bool'. Changing this attribute will now invalidate GDB's frame-cache.
    • It is now no longer possible to sub-class the gdb.disassembler.DisassemblerResult type.
  • Remote protocol
    • Support for enabling or disabling individual remote target features
  • GDB/MI support
    • New 'no-history' stop reason
    • Support for inferior-specific breakpoints
    • The bkpt tuple, which appears in breakpoint-created notifications, and in the result of the -break-insert command can now include an optional 'inferior' field for both the main breakpoint, and each location, when the breakpoint is inferior-specific.
    • Trying to create a thread-specific breakpoint using a non-existent thread ID now results in an error
    • New "simple-values-ref-types" -list-feature value indicating how the --simple-values option in various commands take reference types into account.
  • Enhanced AArch64 support
    • Initial support for Scalable Matrix Extension (SME) and for Scalable Matrix Extension 2 (SME2)
    • The 'org.gnu.gdb.aarch64.pauth' Pointer Authentication feature is now deprecated in favor of the 'org.gnu.gdb.aarch64.pauth_v2' feature string
  • Enhanced Ada support
    • Support for the Ada 2022 target name symbol ('@')
    • Support for the The Ada 2022 'Enum_Rep and 'Enum_Val attributes
  • Miscellaneous
    • The 'list' command now accepts '.' as an argument, telling GDB to print the location around the point of execution within the current frame
    • New '%V' output format for printf and dprintf commands.
    • The printf command now limits the size of strings fetched from the inferior to the value of the 'max-value-size' setting.
    • Support for extending at configure time the default value of the 'debug-file-directory' GDB parameter via the new --additional-debug-dirs=PATHs configure option.
    • New command "info main"
    • New command "set tui mouse-events [on|off]" (on by default)
    • New command "set always-read-ctf on|off" (off by default)
    • Various new debug and maitenance commands
See the NEWS file for a more complete and detailed list of what this release includes.
Nov 28, 2006: Reversible Debugging

The GDB maintainers are looking for contributors interestedin reversible debugging.

Late breaking information, such as recently added features, can befound in the NEWS file in the gdb source tree. Old announcements are in thenews archive.
[bugs][maintainers][contributing][currentgit][documentation][download][home][irc][links][mailinglists][news][schedule][song][wiki]

Please send FSF & GNU inquiries & questions to gnu@gnu.org. There are also other ways tocontact the FSF.

This page is maintained by the GDBdevelopers.

Copyright Free Software Foundation, Inc., 51 Franklin St - FifthFloor, Boston, MA 02110-1301 USA.

Verbatim copying and distribution of this entire article ispermitted in any medium, provided this notice is preserved.

Last modified 2024-05-26.

GDB: The GNU Project Debugger (2024)

FAQs

What is GDB used for? ›

GDB stands for the “Gnu DeBugger.” This is a powerful source-level debugging package that lets you see what is going on inside your program. You can step through the code, set breakpoints, examine and change variables, and so on. Like most Linux tools, GDB itself is command line driven, making it rather tedious to use.

Is there GDB for Windows? ›

The first step is ensuring that GDB is installed on the computer. It can be installed to work on Linux, macOS (via Mac Ports), and Windows.

Is GDB still relevant? ›

Overall, users consider GDB to be a great debugging tool with excellent capabilities and support for multiple programming languages. They recommend it as a cost-effective option, especially for machines integrated with Linux. It is regarded as a classic tool worth investing time in learning.

What is the gnu debugger? ›

The GNU Debugger (GDB) is a portable debugger that runs on many Unix-like systems and works for many programming languages, including Ada, Assembly, C, C++, D, Fortran, Haskell, Go, Objective-C, OpenCL C, Modula-2, Pascal, Rust, and partially others. GNU Debugger. Developer(s)

Is Visual GDB free? ›

You can download a free fully functional trial of VisualGDB. The trial will expire in 30 days after the first run.

Is online GDB free? ›

In this tutorial, we will explain how to use OnlineGBD to compile and run C++ programs. The main advantages of using this system are: The C++ compiler is free • It does not require you to download and install a program on your computer • The user interface is easy to use.

How do you start a program using GDB? ›

Starting your program. Use the run command to start your program under GDB. You must first specify the program name (except on VxWorks) with an argument to GDB (see section Getting In and Out of GDB), or by using the file or exec-file command (see section Commands to specify files).

How do I see the code of GDB debugger? ›

Since all of gdb is all in one window, when you are debugging you cannot see the source code for your program. To view the source code, type "list" or "l". gdb will print out the source code for the lines around the current line to be executed.

What languages can GDB debug? ›

Supported languages. GDB supports C, C++, Objective-C, Objective-C++, Fortran, Java, Pascal, assembly, Modula-2, and Ada.

How to do remote debugging in GDB? ›

To start remote debugging, run GDB on the host machine, and specify as an executable file the program that is running in the remote machine. This tells GDB how to find your program's symbols and the contents of its pure text. Start GDB on the host, and connect to the target (see section Connecting to a remote target).

Why does GDB not work on Mac? ›

The problem is caused by Apple switching away from GDB, the GNU debugger, to LLDB, the LLVM debugger, in their Xcode toolchain (along with the transition from GCC to Clang). Unfortunately, Eclipse is not capable of communicating with any debugger other than GDB (yet).

Does GDB have a GUI? ›

gdbgui is a browser-based frontend to gdb , the gnu debugger. You can add breakpoints, view stack traces, and more in C, C++, Go, and Rust! It's perfect for beginners and experts. Simply run gdbgui from the terminal to start the gdbgui server, and a new tab will open in your browser.

What is the benefit of GDB? ›

It plays a crucial role in identifying and resolving issues in programs written in various programming languages such as C, C++, Objective-C, Rust, Go, and many others. GDB's primary function is to help programmers analyze their code during execution or after a crash.

What is the usage GDB? ›

To use GDB in Linux, you first compile your code with the -g flag, then run it with gdb . This allows you to debug your program and uncover any hidden bugs. In this example, we first compile the myprogram. c file with the -g flag using the gcc command.

What does GDB file do? ›

A file geodatabase is a collection of files in a folder on disk that can store, query, and manage spatial and nonspatial data.

What is online GDB used for? ›

OnlineGDB.com is an online compiler and debugger tool for C/C++ languages. It is world's first online IDE which gives debugging facility with embedded gdb debugger.

References

Top Articles
Quick Gluten-Free Chocolate Babka
Heart Pancakes {Valentine's Day} - Two Peas & Their Pod
Spasa Parish
Rentals for rent in Maastricht
159R Bus Schedule Pdf
Sallisaw Bin Store
Black Adam Showtimes Near Maya Cinemas Delano
Espn Transfer Portal Basketball
Pollen Levels Richmond
11 Best Sites Like The Chive For Funny Pictures and Memes
Xenia Canary Dragon Age Origins
Momokun Leaked Controversy - Champion Magazine - Online Magazine
Maine Coon Craigslist
‘An affront to the memories of British sailors’: the lies that sank Hollywood’s sub thriller U-571
Tyreek Hill admits some regrets but calls for officer who restrained him to be fired | CNN
Haverhill, MA Obituaries | Driscoll Funeral Home and Cremation Service
Rogers Breece Obituaries
Ems Isd Skyward Family Access
Elektrische Arbeit W (Kilowattstunden kWh Strompreis Berechnen Berechnung)
Omni Id Portal Waconia
Kellifans.com
Banned in NYC: Airbnb One Year Later
Four-Legged Friday: Meet Tuscaloosa's Adoptable All-Stars Cub & Pickle
Model Center Jasmin
Ice Dodo Unblocked 76
Is Slatt Offensive
Labcorp Locations Near Me
Storm Prediction Center Convective Outlook
Experience the Convenience of Po Box 790010 St Louis Mo
Fungal Symbiote Terraria
modelo julia - PLAYBOARD
Poker News Views Gossip
Abby's Caribbean Cafe
Joanna Gaines Reveals Who Bought the 'Fixer Upper' Lake House and Her Favorite Features of the Milestone Project
Tri-State Dog Racing Results
Navy Qrs Supervisor Answers
Trade Chart Dave Richard
Lincoln Financial Field Section 110
Free Stuff Craigslist Roanoke Va
Stellaris Resolution
Wi Dept Of Regulation & Licensing
Pick N Pull Near Me [Locator Map + Guide + FAQ]
Crystal Westbrooks Nipple
Ice Hockey Dboard
Über 60 Prozent Rabatt auf E-Bikes: Aldi reduziert sämtliche Pedelecs stark im Preis - nur noch für kurze Zeit
Wie blocke ich einen Bot aus Boardman/USA - sellerforum.de
Infinity Pool Showtimes Near Maya Cinemas Bakersfield
Dermpathdiagnostics Com Pay Invoice
How To Use Price Chopper Points At Quiktrip
Maria Butina Bikini
Busted Newspaper Zapata Tx
Latest Posts
Article information

Author: Ouida Strosin DO

Last Updated:

Views: 5981

Rating: 4.6 / 5 (56 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Ouida Strosin DO

Birthday: 1995-04-27

Address: Suite 927 930 Kilback Radial, Candidaville, TN 87795

Phone: +8561498978366

Job: Legacy Manufacturing Specialist

Hobby: Singing, Mountain biking, Water sports, Water sports, Taxidermy, Polo, Pet

Introduction: My name is Ouida Strosin DO, I am a precious, combative, spotless, modern, spotless, beautiful, precious person who loves writing and wants to share my knowledge and understanding with you.