Bug 2161820
| Summary: | Apparent issue with -fdebug-prefix-map | ||||||
|---|---|---|---|---|---|---|---|
| Product: | [Fedora] Fedora | Reporter: | Orion Poplawski <orion> | ||||
| Component: | gcc | Assignee: | Jakub Jelinek <jakub> | ||||
| Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> | ||||
| Severity: | unspecified | Docs Contact: | |||||
| Priority: | unspecified | ||||||
| Version: | 38 | CC: | aoliva, dmalcolm, fweimer, jakub, jlaw, jwakely, mcermak, mpolacek, msebor, nickc, sipoyare | ||||
| Target Milestone: | --- | ||||||
| Target Release: | --- | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | gcc-13.0.1-0.7.fc39 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2023-03-22 02:27:11 UTC | Type: | Bug | ||||
| 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: | 2171460 | ||||||
| Attachments: |
|
||||||
|
Description
Orion Poplawski
2023-01-18 01:43:58 UTC
Can't reproduce.
For empty test.c there isn't much debug info produced, but still I see
Contents of section .debug_str:
0000 474e5520 43313720 31332e30 2e302032 GNU C17 13.0.0 2
0010 30323330 31313520 28526564 20486174 0230115 (Red Hat
0020 2031332e 302e302d 3029202d 6d736563 13.0.0-0) -msec
0030 7572652d 706c7420 2d6d7475 6e653d70 ure-plt -mtune=p
0040 6f776572 38202d6d 6370753d 706f7765 ower8 -mcpu=powe
0050 7238202d 67005858 582f7465 73742e63 r8 -g.XXX/test.c
0060 00 .
When I try something non-empty:
int main () { return 0; }
I get:
readelf -wi a.o | grep 'tmp\|XXX'
<12> DW_AT_name : (indirect string, offset: 0x0): XXX/a.c
<16> DW_AT_comp_dir : XXX
Oh, and readelf -wl a.o | grep 'tmp\|XXX' 1 XXX Created attachment 1939079 [details]
Reproducer spec file
Okay, I think I've finally created a reproducer based on the actual test ccache runs. It also shows a situation in which debug-prefix-map works and fails.
On rawhide I get:
+ cd debug-prefix-map-test-1.0.0
+ for dir in run.real run.real/dir1
+ mkdir -p run.real/include run.real/src
+ rm -f run
+ ln -s run.real run
+ cd run
+ cat
+ cat
+ CCACHE_DISABLE=1
+ CCACHE_COMPILER=
+ CCACHE_PREFIX=
+ /usr/bin/gcc -g -fdebug-prefix-map=/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run=some_name_not_likely_to_exist_in_path -Iinclude -c -fdiagnostics-color -o ./test.o src/test.c
+ readelf -wi test.o
+ grep -E '/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run|some_name_not_likely_to_exist_in_path'
<12> DW_AT_name : (indirect line string, offset: 0x2b): some_name_not_likely_to_exist_in_path.real/src/test.c
<16> DW_AT_comp_dir : (indirect line string, offset: 0x0): some_name_not_likely_to_exist_in_path.real
+ readelf -wl test.o
+ grep -E '/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run|some_name_not_likely_to_exist_in_path'
0 (indirect line string, offset: 0x61): some_name_not_likely_to_exist_in_path.real
1 (indirect line string, offset: 0x8c): some_name_not_likely_to_exist_in_path.real/src
2 (indirect line string, offset: 0xbb): some_name_not_likely_to_exist_in_path.real/include
+ cd -
/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0
+ for dir in run.real run.real/dir1
+ mkdir -p run.real/dir1/include run.real/dir1/src
+ rm -f run
+ ln -s run.real run
+ cd run/dir1
+ cat
+ cat
+ CCACHE_DISABLE=1
+ CCACHE_COMPILER=
+ CCACHE_PREFIX=
+ /usr/bin/gcc -g -fdebug-prefix-map=/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run/dir1=some_name_not_likely_to_exist_in_path -Iinclude -c -fdiagnostics-color -o ./test.o src/test.c
+ readelf -wi test.o
+ grep -E '/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run/dir1|some_name_not_likely_to_exist_in_path'
<16> DW_AT_comp_dir : (indirect line string, offset: 0xb): /home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run/dir1
+ readelf -wl test.o
+ grep -E '/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run/dir1|some_name_not_likely_to_exist_in_path'
0 (indirect line string, offset: 0x52): /home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0/run/dir1
+ cd -
/home/orion/debug-prefix-map-test/debug-prefix-map-test-1.0.0
+ exit 1
So in the directory directly under the symlink the mapping works. But when in a subdirectory of it it does not.
On F37:
+ cd debug-prefix-map-test-1.0.0
+ for dir in run.real run.real/dir1
+ mkdir -p run.real/include run.real/src
+ rm -f run
+ ln -s run.real run
+ cd run
+ cat
+ cat
+ CCACHE_DISABLE=1
+ CCACHE_COMPILER=
+ CCACHE_PREFIX=
+ /usr/bin/gcc -g -fdebug-prefix-map=/builddir/build/BUILD/debug-prefix-map-test-1.0.0/run=some_name_not_likely_to_exist_in_path -Iinclude -c -fdiagnostics-color -o ./test.o src/test.c
+ readelf -wi test.o
+ grep -E '/builddir/build/BUILD/debug-prefix-map-test-1.0.0/run|some_name_not_likely_to_exist_in_path'
<16> DW_AT_comp_dir : (indirect line string, offset: 0x0): some_name_not_likely_to_exist_in_path
+ readelf -wl test.o
+ grep -E '/builddir/build/BUILD/debug-prefix-map-test-1.0.0/run|some_name_not_likely_to_exist_in_path'
0 (indirect line string, offset: 0x31): some_name_not_likely_to_exist_in_path
/builddir/build/BUILD/debug-prefix-map-test-1.0.0
+ cd -
+ for dir in run.real run.real/dir1
+ mkdir -p run.real/dir1/include run.real/dir1/src
+ rm -f run
+ ln -s run.real run
+ cd run/dir1
+ cat
+ cat
+ CCACHE_DISABLE=1
+ CCACHE_COMPILER=
+ CCACHE_PREFIX=
+ /usr/bin/gcc -g -fdebug-prefix-map=/builddir/build/BUILD/debug-prefix-map-test-1.0.0/run/dir1=some_name_not_likely_to_exist_in_path -Iinclude -c -fdiagnostics-color -o ./test.o src/test.c
+ readelf -wi test.o
+ grep -E '/builddir/build/BUILD/debug-prefix-map-test-1.0.0/run/dir1|some_name_not_likely_to_exist_in_path'
<16> DW_AT_comp_dir : (indirect line string, offset: 0x0): some_name_not_likely_to_exist_in_path
+ readelf -wl test.o
+ grep -E '/builddir/build/BUILD/debug-prefix-map-test-1.0.0/run/dir1|some_name_not_likely_to_exist_in_path'
0 (indirect line string, offset: 0x31): some_name_not_likely_to_exist_in_path
+ cd -
/builddir/build/BUILD/debug-prefix-map-test-1.0.0
+ exit 1
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle. Changing version to 38. This appears to be fixed now. |