Bug 142122 (IT_55303)
Summary: | [PATCH] gdb fails to find files in certain cases | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 3 | Reporter: | Neil Horman <nhorman> | ||||||
Component: | gdb | Assignee: | Elena Zannoni <ezannoni> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Jay Turner <jturner> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 3.0 | CC: | cagney, jjohnstn, srevivo, tao | ||||||
Target Milestone: | --- | ||||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | RHBA-2005-241 | Doc Type: | Bug Fix | ||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | Environment: | ||||||||
Last Closed: | 2005-05-19 12:09:50 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | |||||||||
Bug Blocks: | 132991, 146413 | ||||||||
Attachments: |
|
Description
Neil Horman
2004-12-07 15:05:46 UTC
Created attachment 108041 [details]
testcase demonstrating bug
This is the testcase demonstrating the gdb bug
Created attachment 108043 [details]
patch to fix gdb file searching
This is a patch to fix the way gdb searches for files. I've tested it and it
seems to work well. I'm not sure its the best fix, as there are a few
alternatives. The problem stems from the fact that in open_source_file, as
part of the search algorithm, gdb attempts to open the needed source file in
$cdir/<symtab->dirname>/<symtab->filename>, but unfortunately:
1) nothing in gdb ever sets $cdir, and it should be set to the compilation
directory if one exists in the binary debug information
2) open_source_file is broken in the way it seems to parse the directory
information in this manner
I wasn't sure of the history behind cdir, and why nobody seems to use it, so I
opted instead in this patch to modify dwarf_decode_lines such that the
compilation directory was prepended to the symtab->dirname field. This allows
a different code path to be taken in open_source_file, and as a result the file
is properly found. I'm not 100% sure of all the repercussions of doing this,
but it seems to me to be reasonably safe since the C files seem to be handled
in this fashion.
A patch has been built into gdb version 6.1post-1.20040607.52.6 which fixes the problem. I just ran through a quick test w/ the customers reproducer and this does indeed appear to be fixed in 6.1post-1.20040607.52.6. I'll provide this to the customer for verification. An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2005-187.html |