List of requirements for patches

See ContributionChecklist.

GDB Internals documentation

GDB has an official Internals Manual (see the documentation page). It is a good reference guide for GDB, but some parts are incomplete or outdated.

Jeremy Bennett wrote Howto: Porting the GNU Debugger, which is a good source of information as well. It is primarily aimed at engineers who will port GDB to a new target for the first time, but contains an overview of GDB Internals that is of general interest.

Creating ChangeLog entries

The GCC folks have a tool called mklog to help generate ChangeLogs. This script creates a ChangeLog template for a diff file. Run "mklog diff-file" and the template will be added to the top of the file.

Editing configure.ac

After editing gdb/configure.ac, you need to regenerate gdb/configure, gdb/config.in and gdb/aclocal.m4:

$ pwd
/path/to/src/gdb
$ aclocal -I gnulib/m4
$ autoconf
$ autoheader

Please note:

Editing gdbarch.h/gdbarch.c

Don't. :-) These are generated files. Edit gdbarch.sh instead, and then run it.

Updating GDB's import of gnulib

GDB now imports various modules from the gnulib project, located in gdb/gnulib. This import is used when building both GDB and GDBserver.

To facilitate the update of our import, a script called update-gnulib.sh has been created to automate the process. To run this script:

    % cd /path/to/gdb-sources/gdb/gnulib
    % ./update-gnulib.sh /path/to/gnulib-git-repository

When run without change, the new import should be identical to the previous one. This is actually a good test to perform before making any update to our import, to make sure that everything is correctly setup.

The script maintains the two key pieces of information from which the import is created as constants defined inside the script:

When updating the import, please only modify one element at a time. For instance, if you want to import a new module only defined in a later version of gnulib, please first update the import to use the newer commit as a first patch, and then update the import to include the new module as a second patch.

Debugging gdbserver on uClinux / Linux with no MMU

GDB has issues with breakpoints set in gdbserver on !MMU targets. Ulrich Weigand has a tip to make it work:

Gdbserver uses a direct call to the Linux "clone" system call at startup,
and for some reason GDB gets really confused by this.

When I want to debug gdbserver, I generally simply comment out the call
to linux_test_for_tracefork in linux-nat.c:initialize_low to avoid this.

Writing testcases

See GDBTestcaseCookbook.

Finding Gnats bug entries in the Bugzilla database

If you ever had to find an old bug in the Bugzilla database, you probably stumbled upon this situation. There are some old entries from the now-retired Gnats database, which can be found by:

None: DeveloperTips (last edited 2013-05-17 17:31:55 by PedroAlves)

All content (C) 2008 Free Software Foundation. For terms of use, redistribution, and modification, please see the WikiLicense page.