Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 65404 - gdb-6.2.1 fails to find include file in relative directory with dwarf2
Summary: gdb-6.2.1 fails to find include file in relative directory with dwarf2
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High blocker (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-26 06:57 UTC by Igor V. Kovalenko
Modified: 2004-11-09 18:19 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
A patch by Bryce McKinlay rediffed against gdb-6.2.1 (gdb-6.2.1-dwarf2read-relative.patch,3.42 KB, patch)
2004-09-26 07:07 UTC, Igor V. Kovalenko
Details | Diff
test case to verify this bug (gdb-relative-test.tar.bz2,965 bytes, application/x-bzip)
2004-09-26 07:22 UTC, Igor V. Kovalenko
Details
Alternative patch with relation to compilation directory (gdb-6.2.1-dwarf2read-relative-v3.patch,3.76 KB, patch)
2004-09-29 17:25 UTC, Igor V. Kovalenko
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Igor V. Kovalenko 2004-09-26 06:57:14 UTC
gcc may emit relative directory name for some included files.
While debugging programs which have dwarf2 debug information
and are not in the build hierarchy (i.e. installed to other location)
gdb fails to find such included files though all needed information
(source directory et al) is available.


Reproducible: Always
Steps to Reproduce:
1. Build a package which uses relative include paths and install resulting binary somewhere outside build directory.
2. Start a gdb session, then try to single-step into function which is implemented in #included file.

Actual Results:  
gdb say "No such file or directory" for such a file.

Expected Results:  
Included file should be correctly located.

This problem is addressed in a message thread resulting in a patch by Bryce
McKinlay, see http://sources.redhat.com/ml/gdb-patches/2004-07/msg00456.html for
details.
So this probably would be in the next released gdb, but it is not yet available
in current gdb CVS.
Comment 1 Igor V. Kovalenko 2004-09-26 07:07:35 UTC
Created attachment 40447 [details, diff]
A patch by Bryce McKinlay rediffed against gdb-6.2.1

A patch by Bryce McKinlay mentioned in desc, rediffed against gdb-6.2.1
I successively use gdb-6.2.1 with this patch and do not see this problem.
Comment 2 Igor V. Kovalenko 2004-09-26 07:22:49 UTC
Created attachment 40448 [details]
test case to verify this bug

To check please unpack a test case, then cd to gdb-relative-test and do 
export WANT_AUTOMAKE=1.8
autoreconf -i
./configure -v --prefix=`/bin/pwd`/inst
make install

then execute gdb as follows:
LD_LIBRARY_PATH=`/bin/pwd`/inst/lib gdb inst/bin/hello

then at gdb prompt do
break main
run
step
step

here you either see "9	aa.hh: No such file or directory"
which means gdb fails to find included file, or you do not see
the error and "list" command would display the correct source
code lines from included file
Comment 3 Igor V. Kovalenko 2004-09-29 17:25:36 UTC
Created attachment 40738 [details, diff]
Alternative patch with relation to compilation directory

As I'm reading dwarf standard, relative paths should be handled in relation to
compilation directory. This alternative patch does exactly this everywhere
relative path entry is found in dwarf directory table.
This patch makes some gdb testsuite failures. Now I strongly believe testsuite
should be somewhat fixed in relative paths handling :)
Comment 4 SpanKY gentoo-dev 2004-11-09 18:19:03 UTC
added patch to 6.2.1-r1, thanks