Bug 109921
| Summary: | gdb is not finding the correct include file for variables | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 2.1 | Reporter: | Debby Townsend <dstownse> | ||||||||||
| Component: | gdb | Assignee: | Jan Kratochvil <jan.kratochvil> | ||||||||||
| Status: | CLOSED DEFERRED | QA Contact: | Jay Turner <jturner> | ||||||||||
| Severity: | low | Docs Contact: | |||||||||||
| Priority: | medium | ||||||||||||
| Version: | 2.1 | CC: | cagney, jan.kratochvil, jjohnstn, srevivo, tao | ||||||||||
| Target Milestone: | --- | ||||||||||||
| Target Release: | --- | ||||||||||||
| Hardware: | i586 | ||||||||||||
| OS: | Linux | ||||||||||||
| Whiteboard: | |||||||||||||
| Fixed In Version: | Doc Type: | Bug Fix | |||||||||||
| Doc Text: | Story Points: | --- | |||||||||||
| Clone Of: | Environment: | ||||||||||||
| Last Closed: | 2007-01-11 22:50:07 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: | 213784 | ||||||||||||
| Bug Blocks: | 222381, 222382 | ||||||||||||
| Attachments: |
|
||||||||||||
Created attachment 95935 [details]
first of two example files
Created attachment 95936 [details]
second file of the example
compile with:
cc -g -o foo foo.c
This is still a problem in U4 [mpg@black-monolith mpg]$ rpm -q gdb gdb-5.3.90-0.20030710.41.2.1 Created attachment 144625 [details]
Preliminary fix.
Created attachment 144627 [details]
Testcase.
Comment on attachment 144625 [details]
Preliminary fix.
Buggy - regression.
Comment on attachment 144627 [details]
Testcase.
Buggy - directory sensitive.
Committed to RawHide: * Tue Jan 9 2007 Jan Kratochvil <jan.kratochvil> - 6.5-23 - Find symbols properly at their original (included) file (BZ 109921). Posted upstream: http://sources.redhat.com/ml/gdb-patches/2007-01/msg00311.html Committed in RawHide. Not going to fix in RHEL2 as it is strictly a maintenance only (if at all) release. To be considered for fixing in RHEL4+. |
From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0) Description of problem: Both the "info variable" and the "list" command, when given the name of an external variable which is defined in an #include'd file, list the incorrect file-name. In the case of "list" the line number is extrapolated correctly; but the wrong source file is listed. The problem does not occur for functions defined in the same #include'd file. Version-Release number of selected component (if applicable): gdb-5.1-1 How reproducible: Always Steps to Reproduce: 1. Create a header file ( foo2.c ) which defines an external variable (bar) 2. #include the header file in a small program ( foo.c ) 3. compile with -g and run under gdb Actual Results: (gdb) info variable bar All variables matching regular expression "bar": File foo.c: static int bar; (gdb) list bar 7 int i5; 8 int i6; 9 int i7; 10 int i8; 11 int i9; 12 13 int main(void) 14 { 15 return circle(1); 16 } (gdb) shell grep -n bar foo.c (gdb) shell grep -n bar foo2.c 12:static int bar = 16; Expected Results: The "info variable bar" command correctly lists the variable definition but credits foo.c rather than foo2.c The "list bar" command lists lines 7-16 of foo.c instead of lines 7- 16 of foo2.c Additional info: See attachments for example