Running GDB from the build directory

GDB requires several ancillary files to function properly. These files are contained in GDB's data-directory and include things like the Python support files.

When GDB is run from its installed location GDB can find these files automatically. Furthermore, if GDB is configured in a way such that its entire install tree is relocatable, then GDB can find its ancillary files based on its own location.

However, when run from its build directory the ancillary files aren't necessarily in a place where GDB will look, so GDB has to be explicitly told where to look. This is done with the --data-directory option.

To simplify running GDB from its build directory the Makefile has the following rule:

.PHONY: run
run: Makefile
        ./gdb$(EXEEXT) --data-directory=`pwd`/data-directory $(GDBFLAGS)

None: Internals Run-From-Build-Directory (last edited 2013-10-11 17:31:30 by DougEvans)

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