[RFA] Let GDB find the right options.c
Jie Zhang
jie@codesourcery.com
Wed Mar 31 08:27:00 GMT 2010
When I was trying to set a breakpoint on a function in GCC generated
options.c, like cl_optimization_restore, GDB always thought it's the
options.c in gcc/fortran/ . That's because the .gdbinit in the GCC build
directory looks like:
dir .
dir ../../../svn/trunk/gcc
dir ../../../svn/trunk/gcc/ada
dir ../../../svn/trunk/gcc/cp
dir ../../../svn/trunk/gcc/fortran
dir ../../../svn/trunk/gcc/java
dir ../../../svn/trunk/gcc/lto
dir ../../../svn/trunk/gcc/objc
dir ../../../svn/trunk/gcc/objcp
source ../../../svn/trunk/gcc/gdbinit.in
So GDB will search ../../../svn/trunk/gcc/fortran before the build
directory. This patch moves "dir ." after all other dir commands. So the
build directory will be searched first.
The options.c in gcc/fortran should still be able to be found correctly
when setting breakpoint on the functions in that file, since the file
name for that options.c will contains "fortran/"
Is it OK?
--
Jie Zhang
CodeSourcery
(650) 331-3385 x735
-------------- next part --------------
A non-text attachment was scrubbed...
Name: gcc-gdbinit-search-builddir-first.diff
Type: text/x-patch
Size: 625 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100331/6a857ed7/attachment.bin>
More information about the Gcc-patches
mailing list