Site Root : Patches : gdb.deferredbreakAgainst_gdb6.0

Update

gdb snapshots since 2004-02-03 now contain support identical to this patch

Enable deferred breaks in gdb

Purpose

Allow gdb to set breakpoints in libraries that are not loaded yet (i.e. libraries that will be loaded with dlopen in the future)

OpenOffice and Mozilla especially use a large amount of components which are loaded at runtime from .so files with dlopen. gdb normally only sets breakpoints if they can be resolved as the time of user insertion. This patch allows them to be set even when they cannot be resolved, and gdb will attempt to resolve the deferred breakpoints whenever a .so is afterwards loaded.

Execution

To enable this you need to apply the patch of course, and in gdb set the variable hack-allow-future-breaks to 1. You can put this in your .gdbinit or from the gdb command line as follows...

 (gdb) set hack-allow-future-breaks 1

How to Apply

 get gdb release 6
	(e.g. ftp://ftp.gnu.org/gnu/gdb)
 tar xvzf gdb-6.0.tar.gz
 cd gdb-6.0
 patch -p1 < ../file.patch (or whatever you called it)
 ./configure
 make

Details

This (as its name implies) is something of a hack, but it appears to work fine. Its based on the work by apple on their version of gdb. There they call the feature future-break, their patch was unsuccesfully submitted as http://sources.redhat.com/ml/gdb-patches/2001-12/msg00296.html

Caolan McNamara (2003) <caolan@skynet.ie>

Download Patch

Patch Against gdb6.0
Last generated at Sun Feb 7 00:45:00 2016 Caolán McNamara <caolan@skynet.ie> Created with WebMake/0.5