Go to the previous, next section.

New Features since GDB Version 3.5

Targets
Using the new command target, you can select at runtime whether you are debugging local files, local processes, standalone systems over a serial port, or realtime systems over a TCP/IP connection. The command load can download programs into a remote system. Serial stubs are available for Motorola 680x0, Intel 80386, and Sparc remote systems; GDB also supports debugging realtime processes running under VxWorks, using SunRPC Remote Procedure Calls over TCP/IP to talk to a debugger stub on the target system. Internally, GDB now uses a function vector to mediate access to different targets; if you need to add your own support for a remote protocol, this makes it much easier.

Watchpoints
GDB now sports watchpoints as well as breakpoints. You can use a watchpoint to stop execution whenever the value of an expression changes, without having to predict a particular place in your program where this may happen.

Wide Output
Commands that issue wide output now insert newlines at places designed to make the output more readable.

Object Code Formats
GDB uses a new library called the Binary File Descriptor (BFD) Library to permit it to switch dynamically, without reconfiguration or recompilation, between different object-file formats. Formats currently supported are COFF, ELF, a.out, Intel 960 b.out, MIPS ECOFF, HPPA SOM (with stabs debugging), and S-records; files may be read as .o files, archive libraries, or core dumps. BFD is available as a subroutine library so that other programs may take advantage of it, and the other GNU binary utilities are being converted to use it.

Configuration and Ports
Compile-time configuration (to select a particular architecture and operating system) is much easier. The script configure now allows you to configure GDB as either a native debugger or a cross-debugger. See section Installing GDB, for details on how to configure.

Interaction
The user interface to the GDB control variables is simpler, and is consolidated in two commands, set and show. Output lines are now broken at readable places, rather than overflowing onto the next line. You can suppress output of machine-level addresses, displaying only source language information.

C++
GDB now supports C++ multiple inheritance (if used with a GCC version 2 compiler), and also has limited support for C++ exception handling, with the commands catch and info catch: GDB can break when an exception is raised, before the stack is peeled back to the exception handler's context.

Modula-2
GDB now has preliminary support for the GNU Modula-2 compiler, currently under development at the State University of New York at Buffalo. Coordinated development of both GDB and the GNU Modula-2 compiler will continue. Other Modula-2 compilers are currently not supported, and attempting to debug programs compiled with them will likely result in an error as the symbol table of the executable is read in.

Command Rationalization
Many GDB commands have been renamed to make them easier to remember and use. In particular, the subcommands of info and show/set are grouped to make the former refer to the state of your program, and the latter refer to the state of GDB itself. See section Renamed Commands, for details on what commands were renamed.

Shared Libraries
GDB 4 can debug programs and core files that use SunOS, SVR4, or IBM RS/6000 shared libraries.

Threads
On some systems, GDB 4 has facilities to debug multi-thread programs.

Reference Card
GDB 4 has a reference card. See section Formatting Documentation, for instructions about how to print it.

Go to the previous, next section.