A.6. Changes in GDB
Red Hat Developer Toolset 4.0 is distributed with GDB 7.10, which provides a number of bug fixes and improvements over the Red Hat Enterprise Linux system version and the version included in the previous release of Red Hat Developer Toolset. Below is a comprehensive list of new features in this release.
A.6.1. Changes Since Red Hat Developer Toolset 3.1
The following features have been added since the release of GDB in Red Hat Developer Toolset 3.1:
- GDB now honors the content of the
PIDis the process ID). This file can be used to specify the types of memory mappings that will be included in a corefile. For more information, please see the core(5) manual page.GDB also has a new command:
set use-coredump-filter on|off. It allows to set whether GDB reads the content of the
/proc/file when generating a corefile.
info oscommand can now be used to display information about CPUs. Run
info os cpusto list all CPUs and cores on the system.
info sourcecommand can now be used to display the producer string (if it was included in the debugging information). The string usually contains the compiler version and command-line arguments.
- Directory names supplied to the
set sysrootcommands may be prefixed with
target:to instruct GDB to access shared libraries from the target system, regardless of whether it is local or remote. This replaces the
remote:prefix. The default system root has been changed from "" (empty) to
target:. For backward compatibility,
remote:is automatically converted to
- The system root specified by the
set sysrootcommand is prepended to the filename of the main executable (if reported to GDB as absolute by the operating system) when starting processes remotely and when attaching to already-running local or remote processes.
- GDB now supports automatic location and retrieval of executable files from remote targets. Remote debugging can now be initiated using only the
target extended-remotecommands (no
filecommands are required). See also the section called “New Remote Packets” below.
- Support for the Verilog hexadecimal format has been added to the
- GDB and gdbserver are now able to access executable and shared library files without the
set sysrootcommand when attaching to processes running in different mount namespaces from the debugger. This makes it possible to attach to processes in containers as simply as
gdb -p PIDor
gdbserver --attach PID. See also the section called “New Remote Packets” below.
- Support for completion for all of the available register groups, including target-specific groups, has been added to the
- The size of GDB's command history is no longer determined by reading the
HISTSIZEenvironment variable. Instead, the dedicated
GDBHISTSIZEenvironment variable is now used. To disable truncation of command history, set
-1or leave it empty. Non-numeric values are ignored.
- Support for fork events on extended-remote Linux targets has been added. This makes it possible to use the
detach-on-forkoptions on targets with Linux kernels 2.5.60 and higher for both the
vforkcalls, as well as
- Using new
qSupportedpacket allows GDB to request support for
vforkevents, and the
qSupportedresponse can contain the corresponding
showcommands can be used to set and display whether these features are enabled.
info recordcommand now displays the format of the recording and when the btrace record target is used, it also shows the branch-tracing configuration for the current thread. In case of the BTS format, the command displays the ring buffer size.
- Support for DTrace USDT (Userland Static Defined Tracing) probes has been added.
- GDB now supports the compilation and injection of source code into the inferior. GDB will use GCC 5.0 or higher built with
libcc1.soto compile the source code to object code, and if successful, inject and execute that code within the current context of the inferior. Currently, the C language is supported. The commands used for interfacing with this new feature are:
compile code [-raw|-r] [--] [source code]
compile file [-raw|-r] filename
dll-symbolscommand and its two aliases (
assf) have been removed. Use the
sharedlibrarycommand or its alias
- On resume, GDB now always passes the signal the program had stopped for to the thread the signal was sent to, even if the user changed threads before resuming. Previously, GDB would often (but not always) deliver the signal to the thread that happened to be current at resume time.
- Conversely, the
signalcommand now consistently delivers the requested signal to the current thread. GDB now asks for confirmation if the program had stopped for a signal, and the user switched threads meanwhile.
autostates of the
breakpoint always-insertedmode have been merged into one. Now, when the
breakpoint always-insertedmode is set to
off, GDB does not remove breakpoints from the target until all threads stop, even in non-stop mode. The
automode has been removed, and
offis now the default mode.
--xdbcommand-line option (HP-UX XDB compatibility mode) has been removed.
New Remote Packets
A number of new remote packets have been added. See Table A.1, “New Remote Packets” for a complete list.
Table A.1. New Remote Packets
| ||Return the branch-trace configuration for the current thread.|
| ||Set the requested ring-buffer size for branch tracing in the BTS format.|
| ||Indicates a memory breakpoint instruction was executed, irrespective of whether it was GDB that planted the breakpoint or the breakpoint was hardcoded in the program. This is required for correct non-stop mode operation.|
| ||Indicates the target stopped for a hardware breakpoint. This is required for correct non-stop mode operation.|
| ||Return information about files on the remote system.|
| ||Return the full absolute name of the file that was executed to create a process running on the remote system.|
| || Select the file system on which |
| || Indicates that a |
| || Indicates that a |
| || Indicates that a |
Python Scripting Support
Python scripting support has been improved:
- Objects of the
gdb.Objfileclass have a new attribute,
username, which is the user-specified name of the objfile.
- Support for writing frame unwinders in Python has been added.
- A new method,
optimized_out, has been added to
gdb.Typeobjects. It is used for returning the optimized out
gdb.Valueinstance of this type.
- New methods,
const_value, have been added to
gdb.Valueobjects. They are used to return a reference to the value and the
constversion of the value, respectively.
- Auto-loading of Python scripts contained in the
.debug_gdb_scriptsspecial section is now supported.
Xmethodscan now specify the type of the result.
- You can now access frame registers from Python scripts.
gdb.Symtabobjects has been added.
gdb.Objfileobjects has been added. It is the
gdb.Progspaceobject of the containing program space.
gdb.Objfileobjects has been added.
gdb.Objfileobjects has been added. It is the build ID generated when the file was built.
add_separate_debug_filemethod has been added to
- A new event,
gdb.clear_objfiles, has been added. It is triggered when a new file for debugging is selected.
- You can now add attributes to
- A new function,
gdb.lookup_objfile, has been added.
The following new events are triggered when the state of the inferior is modified by GDB.
- Function call is about to be made.
- Function call has just been made.
- A memory location has been altered.
- A register has been altered.
The following new Python-based convenience functions have been added.
$_caller_is(name [, number_of_frames])
$_caller_matches(regexp [, number_of_frames])
$_any_caller_is(name [, number_of_frames])
$_any_caller_matches(regexp [, number_of_frames])
The following new commands have been added:
set serial parity odd|even|none,
show serial parity
- Set or show parity for remote serial I/O.
maint print symbol-cache
- Print the contents of the symbol cache.
maint print symbol-cache-statistics
- Print statistics of symbol cache usage.
- Flush the contents of the symbol cache.
record btrace bts,
- Begin branch-trace recording using the Branch Trace Store (BTS) format.
- Enable or and disable the TUI (Text User Interface) mode.
set mpx bound,
show mpx bound
- Investigate bound tables in Intel(R) MPX-enabled applications.
maint info btrace
- Display information about branch-tracing internals.
maint btrace packet-history
- Display raw branch-tracing data.
maint btrace clear-packet-history
- Discard stored raw branch-tracing data.
maint btrace clear
- Discard all branch-tracing data. The next invocation of the
recordcommand will fetch and process it again.
demangle [-l language] [--] name
- Demangle name in the specified language or the current language if the parameter is omitted. This command replaces the renamed
maint demanglecommand. The old command name is kept as a no-op command to avoid
maint demanglebeing interpreted as
- Queue a signal to be delivered to the thread when it is resumed.
maint print user-registers
- Display all currently available user registers.
compile code [-r|-raw] [--] [source code]
- Compile, inject, and execute in the inferior the executable object code produced by compiling the provided source code.
compile [file -r|-raw] filename
- Compile and inject into the inferior the executable object code produced by compiling the source code stored in the filename provided.
- Evaluate an expression using the compiler and display the result.
The following new options have been added:
set debug dwarf-die,
show debug dwarf-die
- Renamed from
set debug dwarf2-dieand
show debug dwarf2-dierespectively.
set debug dwarf-read,
show debug dwarf-read
- Renamed from
set debug dwarf2-readand
show debug dwarf2-readrespectively.
maint set dwarf always-disassemble,
maint show dwarf always-disassemble
- Renamed from
maint set dwarf2 always-disassembleand
maint show dwarf2 always-disassemblerespectively.
maint set dwarf max-cache-age,
maint show dwarf max-cache-age
- Renamed from
maint set dwarf2 max-cache-ageand
maint show dwarf2 max-cache-agerespectively.
set debug dwarf-line,
show debug dwarf-line
- Control display of debugging info regarding DWARF line processing.
- Set the maximum number of candidates to be considered during completion. The default value is
200. This limit allows GDB to avoid generating large completion lists, the computation of which can cause the debugger to become temporarily unresponsive.
set history remove-duplicates,
show history remove-duplicates
- Control the removal of duplicate history entries.
maint set symbol-cache-size,
maint show symbol-cache-size
- Control the size of the symbol cache.
set record btrace bts buffer-size,
show record btrace bts buffer-size
- Set and show the size of the ring buffer used for branch tracing in the BTS format. The obtained size may differ from the requested size. To see the obtained buffer size, use the
set debug linux-namespaces,
show debug linux-namespaces
- Control display of debugging info regarding Linux namespaces.
set debug symbol-lookup,
show debug symbol-lookup
- Control display of debugging info regarding symbol lookup.
thread apply allcommand now supports a new option,
-ascending, for calling its specified command for all threads in an ascending order.
Change in the Machine Interface Interpreter (GDB/MI)
The following change has been made the GDB/MI.
-list-thread-groupscommand outputs an exit-code field for inferiors that have exited.