B.5. Changes in GDB

Red Hat Developer Toolset 3.0 is distributed with GDB 7.8, which provides a number of improvements and bug fixes over the Red Hat Enterprise Linux system versions and the version included in the previous release of Red Hat Developer Toolset. Below is a comprehensive list of new features in this release.

B.5.1. Changes Since Red Hat Enterprise Linux 6.6

The following features have been added since the release of GDB in Red Hat Enterprise Linux 6.6:

New Features

  • Support for linespecs has been improved (in particular, a more consistent handling of ambiguous linespecs, some support for labels in the program's source, and FILE:LINE support now extends to further linespecs types). Breakpoints are now set on all matching locations in all inferiors and will be updated according to changes in the inferior.
  • New inferior control commands skip function and skip file have been added. These commands can be uses to skip certain functions and files when stepping.
  • The info threads command now displays the thread name as set by prctl or pthread_setname_np. In addition, new commands thread name and thread find have been added. The thread name command accepts a name as an argument and can be used to set the name of the current thread. The thread find command accepts a regular expression and allows the user to find threads that match it.
  • GDB now provides support for reading and writing a new .gdb_index section. The command gdb-add-index can be used to add .gdb_index to a file, which allows GDB to load symbols from that file faster. Note that this feature is already present in Red Hat Enterprise Linux 6.1 and later.
  • The watch command has been adapted to accept -location as an optional argument.
  • Two new special values can now be used when specifying the current search path for libthread_db: $sdir represents the default system locations of shared libraries, and $pdir stands for the directory with the libthread that is used by the application.
  • The info macro command now accepts -all and -- as valid options.
  • To display a function parameter's entry value (that is, the value at the time of function entry), the suffix @entry can be added to the parameter. GDB now displays @entry values in backtraces, if available.
  • The watch command now accepts mask mask_value as an argument. This can be used to create masked watchpoints.
  • The info os command has been changed and can now display information on several objects managed by the operating system, in particular:
    • The info os procgroups command lists process groups.
    • The info os files command lists file descriptors.
    • The info os sockets command lists internet-domain sockets.
    • The info os shm command lists shared-memory regions.
    • The info os semaphores command lists semaphores.
    • The info os msg command lists message queues.
    • The info os modules command lists loaded kernel modules.
  • GDB now has support for Static Defined Tracing (SDT) probes. Currently, the only implemented back end is for SystemTap probes (the sys/sdt.h header file). You can set a breakpoint by using the new -probe, -pstap, or -probe-stap options, and inspect the probe arguments by using the new $_probe_arg family of convenience variables.
  • The symbol-reloading option has been deleted.
  • gdbserver now supports STDIO connections, for example:
    (gdb) target remote | ssh myhost gdbserver - hello
  • GDB is now able to print flag enums. In a flag enum, all enumerator values have no bits in common when pairwise AND-ed. When GDB prints a value whose type is a flag enum, GDB shows all the constants; for example, for enum E { ONE = 1, TWO = 2}:
    (gdb) print (enum E) 3
              $1 = (ONE | TWO)
  • The file name part of a linespec now matches trailing components of a source file name. For example, break gcc/expr.c:1000 now sets a breakpoint in the build/gcc/expr.c file, but not in build/libcpp/expr.c.
  • The info proc and generate-core-file commands now work on remote targets connected to gdbserver.
  • The command info catch has been removed.
  • The Ada-specific catch exception and catch assert commands now accept conditions at the end of the command.
  • The info static-tracepoint-marker command now works on native targets with an in-process agent.
  • GDB can now set breakpoints on inline functions.
  • The .gdb_index section has been updated to include symbols for inline functions. By default, GDB now ignores older .gdb_index sections until their .gdb_index sections can be recreated. The new command set use-deprecated-index-sections on causes GDB to use any older .gdb_index sections it finds. If this option is set, the ability to set breakpoints on inline functions is lost in symbol files with older .gdb_index sections.
    The .gdb_index section has also been updated to record more information about each symbol.
  • GDB now provides Ada support for GDB/MI Variable Objects.
  • GDB now supports breakpoint always-inserted mode in the record target.
  • gdbserver now supports evaluation of breakpoint conditions. Note that you can instruct GDB to send the breakpoint conditions in bytecode form, but gdbserver only reports the breakpoint trigger to GDB when its condition evaluates to true.
  • New convenience functions $_memeq(buf1, buf2, length), $_streq(str1, str2), $_strlen(str), and $_regex(str, regex) have been added.
  • Target record has been renamed to record-full. Consequently, you can now use the record full command to record or replay an execution log. In addition, the following commands have been renamed:
    • The set record insn-number-max and show record insn-number-max commands have been renamed to set record full insn-number-max and show record full insn-number-max.
    • The set record memory-query and show record memory-query commands have been renamed to set record full memory-query and show record full memory-query.
    • The set record stop-at-limit and show record stop-at-limit commands have been renamed to set record full stop-at-limit and show record full stop-at-limit.
  • A new record target, record-btrace, has been added. This target uses hardware support to record the control flow of a process and can be enabled by using the record btrace command. This record target does not support replaying the execution.

    Important

    The record-btrace target is only available on Intel Atom processors and requires the Linux kernel in version 2.6.32 or later.
  • The -epoch command line option has been removed. This option was used by GDB mode in Epoch, a deprecated clone of the Emacs text editor.
  • The ptype and whatis commands have been updated to accept an argument to control the type formatting.
  • The info proc command has been updated to work on some core files.
  • The cd command has been enhanced and no longer requires a directory path as its first argument. When executed with no arguments, the command now changes to the home directory.
  • GDB now uses GNU v3 ABI as the default C++ ABI. This has been the default option for GCC since November 2000.
  • The info tracepoints command has been enhanced to display installed on target or not installed on target for each non-pending location of a tracepoint.

New Remote Packets

A number of new remote packets have been added. See Table B.3, “New Remote Packets” for a complete list.

Table B.3. New Remote Packets

Remote PacketDescription
QTBuffer:size Sets the size of the trace buffer. The remote stub reports support for this packet to the qSupported query.
Qbtrace:bts Enables branch tracing based on Branch Trace Store (BTS) for the current thread. The remote stub reports support for this packet to the qSupported query.
Qbtrace:off Disables branch tracing for the current thread. The remote stub reports support for this packet to the qSupported query.
qXfer:btrace:read Reads the traced branches for the current thread. The remote stub reports support for this packet to the qSupported query.
qXfer:libraries-svr4:read's annex
The previously unused annex of the qXfer:libraries-svr4:read packet is now used to support passing of an argument list. The remote stub reports support for this argument list to the qSupported query.
The defined arguments are start and prev. These arguments are used to reduce work necessary for updating the library list and significantly speed up the process.
The z0/z1 breakpoint insertion packets have been extended to carry a list of conditional expressions over to the remote stub depending on the condition evaluation mode. You can use the set remote conditional-breakpoints-packet command to control the use of this extension.

New RSP Packet

A new RSP packet has been added:
  • A new RSP packet QProgramSignals can be used to specify the signals the remote stub can pass to the debugged program without GDB involvement.

Changes in the Machine Interface Interpreter (GDB/MI)

The following MI changes have been made:
  • A new command -info-os has been added as the MI equivalent of info os.
  • Output logs, such as set logging and related, now include MI output.
  • A new async record, =cmd-param-changed, has been added. This async record reports that a command parameter has changed.
  • A new async record, =traceframe-changed, has been added. This async record reports that a trace frame has been changed by using the tfind command.
  • New async records =tsv-created, =tsv-deleted, and =tsv-modified have been added. These async records report that a trace state variable has been created, deleted, or modified.
  • New async records =record-started and =record-stopped have been added. These async records report that a process record has been started or stopped.
  • A new async record, =memory-changed, has been added. This async record reports that the memory has changed.
  • When the source is requested, the -data-disassemble command now includes a new fullname field containing an absolute path to the source file name.
  • The fullname filed is now always present along with the file field. This field is included even if GDB cannot find the file.
  • A new optional parameter, COUNT, has been added to the -data-write-memory-bytes command. This parameter can be used to allow pattern filling of memory areas.
  • The response to breakpoint commands and breakpoint async records now includes a new installed field. This field reports the current state of each non-pending tracepoint location: when the tracepoint is installed, the value of this field is y, otherwise the value is n.
  • The output of the -trace-status command now includes a new trace-file field. This field is only present when examining a trace file and contains the name of this file.

New Commands

The following new commands have been added:
  • New set use-deprecated-index-sections on|off and show use-deprecated-index-sections on|off commands have been added. These commands allow you to control the use of deprecated .gdb_index sections.
  • New catch load and catch unload commands have been added. These commands allow you to stop execution of a debugged program when a shared library is loaded or unloaded.
  • A new enable count command has been added. This command allows you to auto-disable a breakpoint after several hits.
  • A new info vtbl command has been added. This command allows you to show the virtual method tables for C++ and Java objects.
  • A new explore command has been added. It supports two subcommands explore value and explore type, and allows you to recursively explore values and types of expressions. Note that this command is only available with Python-enabled GDB.
  • A new dprintf location,format,args... command has been added. This command allows you to create a dynamic printf-type breakpoint, which performs a printf-like operation and then resumes program execution.
  • New set print symbol and show print symbol commands have been added. These commands allow you to control whether GDB attempts to display the symbol, if any, that corresponds to addresses it prints. This functionality is enabled by default, but you can restore the previous behavior by running the set print symbol off command.
  • New record instruction-history and record function-call-history commands have been added. These commands allow you to view information about an execution log without having to replay it. The record instruction-history command displays the execution history at instruction granularity and the record function-call-history displays the execution history at function granularity. The commands are only supported by the record btrace command.
  • A new command, fo, has been added. This commands serves as a shorter variant of the forward-search command.
  • A new command, catch signal, has been added. This command can be used to catch signals by their names and is similar to the handle command, but also allows you to attach additional conditions or commands.
  • A new command, maint info bfds, has been added. This command can be used to list all binary files (BFDs) opened by GDB.
  • Two new commands, python-interactive [command] and its shorter variant pi [command], have been added. These commands allow you to start an interactive Python prompt or evaluate a Python command and print the results to standard output.
  • A new command, py [command], has been added. This command serves as a shorter variant of the python [command] command.
  • New enable type-printer [name...] and disable type-printer [name...] commands have been added. These commands allow you to enable or disable type printers.
  • New set breakpoint condition-evaluation and show breakpoint condition-evaluation commands have been added. These commands allow you to control whether breakpoint conditions are evaluated by GDB (the host option), or by gdbserver (the target option). The default option, auto, chooses the most efficient available mode.
  • New set dprintf-style gdb|call|agent and show dprintf-style commands have been added. These commands allow you to control the way in which a dynamic printf is performed: the gdb option requests a GDB printf command, call causes dprintf to call a function in the inferior, and agent requests that the target agent such as gdbserver does the printing.
  • New set dprintf-function expression, show dprintf-function, set dprintf-channel expression, and show dprintf-channel commands have been added. These commands allow you to set the function and optional first argument to the call when using the call style of dynamic printf.
  • New set disconnected-dprintf on|off and show disconnected-dprintf commands have been added. These commands allow you to control whether agent-style dynamic printfs continue to be in effect after GDB disconnects.
  • New set print type methods on|off and show print type methods commands have been added. These commands allow you to control whether method declarations are displayed by the ptype command. This functionality is enabled by default.
  • New set print type typedefs on|off and show print type typedefs commands have been added. These commands allow you to control whether typedef definitions are displayed by the ptype command. This functionality is enabled by default.
  • New set filename-display basename|relative|absolute and show filename-display commands have been added. These commands allow you to control the way in which file names are displayed: the basename option displays only the base name of a file name, relative displays a path relative to the compilation directory, and absolute displays an absolute path to the file. The default option is relative to preserve the previous behavior.
  • New set trace-buffer-size and show trace-buffer-size commands have been added. These commands allow you to control the size of the trace buffer for a target.
  • New set remote trace-buffer-size-packet auto|on|off and show remote trace-buffer-size-packet commands have been added. These commands allow you to control the use of the remote protocol QTBuffer:size packet.
  • New set debug notification and show debug notification commands have been added. These commands allow you to control whether to display debugging information for asynchronous remote notification. This functionality is disabled by default.
  • A new command info macros has been added. This command accepts linespec as an optional argument and can be used to display the definitions of macros at that linespec location. Note that in order to do this, the debugged program must be compiled with the -g3 command line option to have macro information available in it.
  • A new command alias has been added. This command can be used to create an alias of an existing command.
  • New set print entry-values and show print entry-values commands have been added. The set print entry-values command accepts both, compact, default, if-needed, no, only, and preferred as valid arguments and can be used to enable printing of function arguments at function entry. The show print entry-values command can be used to determine whether this feature is enabled.
  • New set debug entry-values and show debug entry-values commands have been added. The set debug entry-values command can be used to enable printing of debugging information for determining frame argument values at function entry and virtual tail call frames.
  • !command has been added as an alias of shell command.
  • New set extended-prompt and show extended-prompt commands have been added. The set extended-prompt command enables support for a defined set of escape sequences that can be used to display various information. The show extended-prompt command can be used to determine whether the extended prompt is enabled.
  • New set basenames-may-differ and show basenames-may-differ commands have been added. The set basenames-may-differ command enables support for source files with multiple base names. The show basenames-may-differ command can be used to determine whether this support is enabled. The default option is off to allow faster GDB operations.

New Command Line Options

The following new options have been added:
  • A new command line option, -ix (or --init-command), has been added. This option acts like -x (or --command), but is executed before loading the debugged program.
  • A new command line option, -iex (or --init-eval-command), has been added. This option acts like -ex (or --eval-command), but is executed before loading the debugged program.
  • A new command line option, -nh, has been added. This option allows you to disable automatic loading of the ~/.gdbinit file without disabling other initialization files.

C++ Language Support

The following changes have been made to the C++ language support:
  • When debugging a template instantiation, parameters of the template are now put in scope.

Python Scripting Support

The following changes have been made to the Python scripting support:
  • The register_pretty_printer function in module gdb.printing now takes an optional replace argument.
  • The maint set python print-stack on|off command has been deprecated and will be deleted in GDB 7.5. The new command set python print-stack none|full|message has replaced it.
  • A prompt substitution hook (prompt_hook) is now available to the Python API.
  • A new Python module gdb.prompt has been added to the GDB Python modules library.
  • Python commands and convenience-functions located in data_directory/python/gdb/command/ and data_directory/python/gdb/function/ are now automatically loaded on GDB start-up.
  • Blocks now provide four new attributes: global_block, static_block, is_static, and is_global.
  • The gdb.breakpoint function has been deprecated in favor of gdb.breakpoints.
  • A new class gdb.FinishBreakpoint is provided.
  • Type objects for struct and union types now allow access to the fields using standard Python dictionary (mapping) methods.
  • A new event gdb.new_objfile has been added.
  • A new function deep_items has been added to the gdb.types module.
  • The function gdb.Write now accepts an optional keyword stream.
  • Parameters can now be sub-classed in Python, which allows for implementation of the get_set_doc and get_show_doc functions.
  • Symbols, Symbol Table, Symbol Table and Line, Object Files, Inferior, Inferior Thread, Blocks, and Block Iterator APIs now have an is_valid method.
  • Breakpoints can now be sub-classed in Python, which allows for implementation of the stop function that is executed each time the inferior reaches that breakpoint.
  • A new function gdb.lookup_global_symbol has been added. This function can be used to look up a global symbol.
  • GDB values in Python are now callable if the value represents a function.
  • A new module gdb.types has been added.
  • A new module gdb.printing has been added.
  • New commands info pretty-printers, enable pretty-printer, and disable pretty-printer have been added.
  • A new gdb.parameter("directories") function call is now available.
  • A new function gdb.newest_frame has been added. This function can be used to return the newest frame in the selected thread.
  • The gdb.InferiorThread class now supports a new name attribute.
  • Support for inferior events has been added. Python scripts can now add observers in order to be notified of events occurring in the process being debugged.
  • GDB commands implemented in Python can now be put in the gdb.COMMAND_USER command class.
  • The maint set python print-stack on|off command has been removed and replaced by set python print-stack.
  • A new class gdb.printing.FlagEnumerationPrinter has been added. This class can be used to apply flag enum-style pretty-printing to enums.
  • The gdb.lookup_symbol function now works correctly when there is no current frame.
  • The gdb.Symbol object now has an additional attribute line. This attribute holds the line number in the source at which the symbol was defined.
  • The gdb.Symbol object now has an additional attribute needs_frame, and a new method value. The needs_frame attribute indicates whether the symbol requires a frame to compute its value, and the value method computes the symbol's value.
  • The gdb.Value object now has a new method referenced_value. This method can be used to dereference a pointer as well as C++ reference values.
  • The gdb.Symtab object now has two new methods, global_block and static_block. These methods return the global and static blocks (as gdb.Block objects) of the underlying symbol table respectively.
  • A new method gdb.find_pc_line returns the gdb.Symtab_and_line object associated with a PC value.
  • The gdb.Symtab_and_line object now has an additional attribute last. This attribute holds the end of the address range occupied by the code for the current source line.
  • Users can now create vectors by using the gdb.Type.vector() method.
  • The atexit.register() method is now supported.
  • Users can now pretty-print types by using the Python API.
  • In addition to Python 2.4 and later, GDB now also supports Python 3.
  • A new class, gdb.Architecture, has been added. This class exposes the internal representation of the architecture in the Python API.
  • A new method, Frame.architecture, has been added. This method can be used to return the gdb.Architecture object corresponding to the frame's architecture.
  • Frame filters and frame decorators have been added.

Compatibility Changes

  • A new command info auto-load has been added and can be used to display the status of various automatically loaded files. The info auto-load gdb-scripts command lists automatically loaded canned sequences of commands, info auto-load python-scripts displays the status of automatically loaded Python scripts, info auto-load local-gdbinit displays whether a local .gdbinit file in the current working directory is loaded, and info auto-load libthread-db displays whether the inferior-specific thread debugging shared library is loaded.
  • New commands set auto-load and show auto-load have been added and can be used to control automatic loading of files:
    • The set auto-load gdb-scripts and show auto-load gdb-scripts commands control automatic loading of GDB scripts.
    • The set auto-load python-scripts and show auto-load python-scripts commands control automatic loading of Python scripts.
    • The set auto-load local-gdbinit and show auto-load local-gdbinit commands control automatic loading of .gdbinit from the current working directory.
    • The set auto-load libthread-db and show auto-load libthread-db commands control automatic loading of inferior-specific libthread_db.
    • The set auto-load scripts-directory and show auto-load scripts-directory commands control the list of directories from which to automatically load GDB and Python scripts.
    • The set auto-load safe-path and show auto-load safe-path commands control the list of directories from which it is safe to automatically load all previously mentioned items.
    • The set debug auto-load and show debug auto-load commands control displaying of debugging information for all previously mentioned items.
    The set auto-load off command can be used to disable automatic loading globally. You can also use show auto-load with no subcommand to display current settings of all previously mentioned items.
  • The maint set python auto-load on|off command has been replaced with set auto-load python-scripts on|off.
  • The maintenance print section-scripts command has been renamed to info auto-load python-scripts [pattern] and is no longer classified as a maintenance-only command.
  • Support for the Guile extension language has been removed.
  • The GNU Debugger has been adapted to follow GCC's rules on accessing volatile objects when reading or writing target state during expression evaluation.

B.5.2. Changes Since Red Hat Developer Toolset 2.1 and Red Hat Enterprise Linux 7.0

The following features have been added since the release of GDB in Red Hat Developer Toolset 2.1 and Red Hat Enterprise Linux 7.0:

Python Scripting Support

Python scripting support has been improved:
  • Support for frame filters and frame decorators has been added. Frame filters are Python objects that can be used to manipulate whether frames are visible when GDB prints a backtrace. Frame decorators, which are sister objects to frame filters, are used to customize the printed content of each gdb.Frame in commands that execute frame filters.
  • Temporary breakpoints, which are automatically deleted after they have been hit, are now supported through the optional temporary argument to the Breakpoint initializer.
  • A representation of line tables has been added. Line tables map source lines to their executable locations in memory. The linetable function can be used to acquire line-table information for a particular symbol table.
  • A new attribute, parent_type, has been added for gdb.Field objects.
  • gdb.Field objects can now be used as subscripts on gdb.Value objects to access structure elements.
  • A new attribute, name, has been added for gdb.Type objects.
  • Valid Python operations on gdb.Value objects representing structs or classes now invoke the corresponding overloaded operators if available.
  • A new feature, Xmethods, has been added to the Python API. Xmethods are additional methods or replacements for existing methods of a C++ class. This feature is useful for those cases where a method defined in C++ source code could be inlined or optimized out by the compiler, making it unavailable to GDB.

New Commands

A number of new commands have been added:
  • A new command, catch rethrow, has been added. This command works like the catch throw command, but it only catches re-thrown exceptions.
  • A new command, maint check-psymtabs, has been added. This command has been renamed from the old maint check-symtabs. It is used for checking the consistency of partial symbol tables.
  • A new command, maint check-symtabs, has been added. It performs consistency checks on full symbol tables.
  • A new command, maint expand-symtabs, has been added. It is used for expanding full symbol tables that match an optional regular expression.
  • A new command, show configuration, has been added. The command displays the details of the configuration options with which GDB was built. This command is the equivalent of the --configuration command line option.
  • A new command, remove-symbol-file, has been added. It can be used to remove a symbol file added using the add-symbol-file command. The file to remove can be identified by its file name:
    remove-symbol-file FILENAME
    Or by an address that lies within the boundaries of this symbol file in memory. In that case, use the -a option:
    remove-symbol-file -a ADDRESS
  • A new command, info exceptions, has been added. It can be used to display the list of Ada exceptions defined in the program being debugged. Optionally, a regular expression can be supplied to limit the list of displayed exceptions:
    info exceptions REGEXP
    If provided, only the exceptions whose names match REGEXP are listed.
The following new pairs of commands make it possible to change settings and show their values:
set debug symfile [off|on]
Controls the displaying of debugging information regarding the reading of symbol files and symbol tables within those files. The show debug symfile command shows the value of this setting.
set print raw frame-arguments [off|on]
Controls the displaying of frame arguments in raw mode, disregarding any defined pretty-printers. The show print raw frame-arguments command shows the value of this setting.
set remote trace-status-packet off|on|auto
Controls the use of the remote-protocol qTStatus packet. The packet is used to ask the remote stub whether a trace experiment is currently running. The show remote trace-status-packet command shows the value of this setting.
set range-stepping [off|on]
Controls whether GDB instructs the target to step through the corresponding range of addresses. If disabled, single-steps are always issued. The show range-stepping command shows the value of this setting. This is set to on by default.
set startup-with-shell [off|on]
Controls whether the shell is used to start subprocesses. If set to off, processes are started directly. The show startup-with-shell command shows the value of this setting. This is set to on by default.
set code-cache [off|on]
Controls whether the target memory cache is used for accesses to code segments, disregarding any configured memory regions. This improves performance of remote debugging (particularly disassembly). The show code-cache command shows the value of this setting. This is set to on by default.
set print symbol-loading off|brief|full
Controls whether to print informational messages when loading symbol information for a file. The default value for this option is full, but when debugging programs with large numbers of shared libraries, the amount of output becomes less useful. The show print symbol-loading command shows the value of this setting.
maint ada set ignore-descriptive-types [on|off]
Controls whether the debugger ignores descriptive types in Ada programs. The default value is off, that is, not to ignore the descriptive types. See the user manual for more details on descriptive types and the intended usage of this option. The maint ada show ignore-descriptive-types command shows the value of this setting.
set auto-connect-native-target [on|off]
Controls whether GDB may automatically connect to the native target when not connected to any target yet. If set to on, GDB attempts the run, attach, and other commands with the native target. The show auto-connect-native-target command shows the value of this setting.
set record btrace replay-memory-access read-only|read-write
Controls what memory accesses are allowed during replays. The show record btrace replay-memory-access command shows the value of this setting.
maint set target-async on|off
Controls whether GDB targets operate in synchronous or asynchronous mode. By default and if available, asynchronous mode is used. Set to off to simplify the debugging of problems that only occur in synchronous mode. The maint show target-async command shows the value of this setting.
set mi-async [on|off]
Controls whether GDB/MI uses asynchronous mode. By default, synchronous mode is used. Set to on to enable background execution of commands. The show mi-async command shows the value of this setting. This command supersedes the set target-async command from previous versions of GDB.
The following series of new commands enables displaying GDB resources used by each executed command:
maint set per-command space [on|off]
Enable or disable the displaying of the amount of memory used by each command. The maint show per-command space command shows the value of this setting.
maint set per-command time [on|off]
Enable or disable the displaying of the execution time of each command. The maint show per-command time command shows the value of this setting.
maint set per-command symtab [on|off]
Enable or disable the displaying of basic symbol-table statistics for each command. The maint show per-command symtab command shows the value of this setting.

New Command Line Options

Two new command line options have been added:
  • A new command line option, --configuration, has been added. It displays the details of the configuration options with which GDB was built. This option is the equivalent of the show configuration interactive command.
  • A new command line option, -D, has been added. This option is an alias for the --data-directory option. This option allows you to specify where GDB looks for its auxiliary files.

Changes in the Machine Interface Interpreter (GDB/MI)

The machine interface interpreter (GDB/MI) has been improved in a number of ways:
  • All MI commands now accept an optional --language option. Support for this feature can be verified by using the -list-features command, which should contain the "language-option" item.
  • A new command, -info-gdb-mi-command, has been added. It allows the user to determine whether a GDB/MI command is supported or not.
  • The ^error result record returned when trying to execute an undefined GDB/MI command now provides a variable named code whose content is the undefined-command error code. Support for this feature can be verified by using the -list-features command, which should contain the "undefined-command-error-code" item.
  • The -trace-save command can now optionally save trace buffer in the Common Trace Format.
  • A new command, -dprintf-insert, has been added. It sets a dynamic printf breakpoint.
  • The -data-list-register-values command now accepts an optional --skip-unavailable option. When used, only available registers are displayed.
  • A new command, -trace-frame-collected, has been added. It returns objects, register names, trace-state variables, memory ranges, and computed expressions that have been collected in a trace frame. There is no corresponding GDB command.
  • The -stack-list-locals, -stack-list-arguments, and -stack-list-variables commands now accept the --skip-unavailable option. When used, only available locals or arguments are displayed.
  • The -exec-run command now accepts the optional --start option. When used, the command follows the same semantics as the start command, stopping the program's execution at the start of its main subprogram. Support for this feature can be verified by using the -list-features command, which should contain the "exec-run-start-option" item.
  • New commands, -catch-assert and -catch-exceptions, have been added. The commands insert catchpoints stopping the program when Ada exceptions are raised.
  • A new command, -info-ada-exceptions, has been added. It provides the equivalent of the new info exceptions command in GDB.
  • A new command, -gdb-set mi-async [on|off], has been added. It replaces the -gdb-set target-async command, which has been deprecated and only serves as an alias to the new command for backward compatibility purposes. The -gdb-set mi-async command controls whether MI operates in asynchronous mode. If set to on, and provided the target supports it, MI commands are executed in the background, and GDB interprets them while the target is still running.

New Features in Remote Packets

Two remote packets have had their feature set expanded:
  • The vCont packet now supports a new r start,end action. The action instructs the remote stub to perform one step and then continue stepping through the address range specified by the start (inclusive) and end (exclusive) parameters.
  • The qXfer:btrace:read packet now supports a new annex, delta, to read the branch trace incrementally.

New Features in the GDB Remote Stub, GDBserver

GDBserver has had two new features added and one new option:
  • Support for target-assisted range stepping has been added.
  • A new element, tvar, has been added to the XML in the reply to the qXfer:traceframe-info:read packet. It has the id of the collected trace state variables.
  • A new option, --debug-format=option1[,option2, ...], has been added. It allows for adding additional text to each output. At present, only time stamps are supported: --debug-format=timestamps. Time stamps can also be turned on with the monitor set debug-format timestamps command in GDB.

General Changes

  • The Fission DWP file format in version 2 is now supported. To use Fission, supply the -gsplit-dwarf option to gcc to generate split DWARF files at compile time. This option must be used in conjunction with the -c option, which disables linking, because Fission cannot be used when compiling and linking in the same step. See http://gcc.gnu.org/wiki/DebugFission for more information about the Fission project.
  • Access to Intel® MPX registers is now supported.
  • Support for Intel® AVX-512 registers has been added, that is, support for displaying and modifying the following Intel® AVX-512 registers: $zmm0$zmm31, $k0$k7, $xmm16$xmm31, and $ymm16$ymm31.
  • A new convenience function, $_isvoid (expression), has been added. The function returns 1 if the type of the evaluated expression is void. In other cases, it returns 0.
  • When displaying the values of registers for which the debugging information shows that they have not been saved in the frame, and there is no place to retrieve them from (callee-saved or call-clobbered registers), the <not saved> message is now consistently printed.
  • A new formatter, z, has been added. When printing and examining memory, this formatter causes the value to be displayed as a hexadecimal zero padded on the left to the size of the type.
  • Target-assigned range stepping with remote targets is now supported. The achieved reduction in the number of control packets sent to and from GDB results in an improved performance.
  • GDB now understands the new tvar element, which has been added to the XML in the traceframe information. It has the id of the collected trace state variables.
  • The typeid C++ operator is now supported.
  • A new convenience variable, $_exception, has been added. It holds the exception that is being thrown or caught at an exception-related catchpoint.
  • Exception-related catchpoints, such as catch throw, can now filter exceptions by type using a supplied regular expression.
  • A new convenience variable, $_exitsignal, has been added. It can be used to determine the signal number with which a program terminates if it dies due to an uncaught signal. The $_exitcode is then automatically set to void.
  • Commands, such as c&, s&, can now be executed in the background if the target supports them. In previous versions, asynchronous execution had to be explicitly enabled using the (now deprecated) set target-async on command.
  • The btrace record target now supports the record goto command. For locations inside the execution trace, the back trace is computed based on the information stored in the execution trace.
  • The btrace record target now supports limited reverse execution and replay. The target does not record data and therefore does not allow for reading the memory or registers.
  • The naming of native targets has been unified, and they are now all called native. To reflect this change, the target child command has been replaced by target native. Target names feature in the output of the following commands: help target, info target, info files, and maint print target-stack.
The following commands have been modified:
  • The unlimited literal value can now be used for options that interpret the 0 or -1 values as unlimited.
  • The set debug symtab-create debugging command has been changed to accept a verbosity level. 0 provides no debugging information, 1 provides basic debugging output, and values of 2 or greater provide a more verbose output.
  • The compare-sections command now works with all targets. In previous versions, it was limited to the remote target.
  • The target native command can now be used to explicitly connect to the native target, which overrides the setting of the set auto-connect-native-target command.
  • The ranges given as arguments to the record function-call-history and record instruction-history commands are now inclusive.
  • The record instruction-history command now starts counting instructions at one. This also affects the instruction ranges reported by the record function-call-history command when given the /i modifier.
  • The tsave command now supports a new option, -ctf, to save trace data in the Common Trace Format (CTF).
  • The maintenance print objfiles command now accepts an optional argument in the form of a regular expression.
  • The commands set remotebaud and show remotebaud are no longer supported. Use set serial baud to set the baud rate for remote serial I/O and show serial baud to display the set rate.
  • The record function-call-history command has been modified in a number of ways:
    • The command now supports a new modifier, /c, for indenting function names based on their call-stack depth.
    • The fields for the /i and /l modifiers have been reordered.
    • The source-line range is now prefixed with at.
    • The instruction range is now prefixed with inst. Both ranges are now printed as <from>, <to> to allow copy-and-paste to the record instruction-history and list commands.