[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/28629] New: [gas, --gdwarf-5] File 0 has wrong dir
From: |
vries at gcc dot gnu.org |
Subject: |
[Bug gas/28629] New: [gas, --gdwarf-5] File 0 has wrong dir |
Date: |
Fri, 26 Nov 2021 06:45:51 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=28629
Bug ID: 28629
Summary: [gas, --gdwarf-5] File 0 has wrong dir
Product: binutils
Version: 2.38 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: gas
Assignee: unassigned at sourceware dot org
Reporter: vries at gcc dot gnu.org
Target Milestone: ---
Consider the following compilation:
...
$ pwd -P
/home/vries/gdb_versions/devel
$ as --gdwarf-5 --64 -o tui-layout-asm-short-prog.o
/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S
...
First, lets look at the debug info:
...
$ readelf -wi tui-layout-asm-short-prog.o
Contents of the .debug_info section:
Compilation Unit @ offset 0x0:
Length: 0x24 (32-bit)
Version: 5
Unit Type: DW_UT_compile (1)
Abbrev Offset: 0x0
Pointer Size: 8
<0><c>: Abbrev Number: 1 (DW_TAG_compile_unit)
<d> DW_AT_stmt_list : 0x0
<11> DW_AT_low_pc : 0x0
<19> DW_AT_high_pc : 5
<1a> DW_AT_name : tui-layout-asm-short-prog.S
<1e> DW_AT_comp_dir : /home/vries/gdb_versions/devel
<22> DW_AT_producer : GNU AS 2.37.50
<26> DW_AT_language : 32769 (MIPS assembler)
...
First we have:
...
A DW_AT_comp_dir attribute whose value is a null-terminated string
containing the current working directory of the compilation command that
produced this compilation unit in whatever form makes sense for the host
system.
...
The DW_AT_comp_dir attribute looks correct, it matches pwd -P.
Then we have:
...
A DW_AT_name attribute whose value is a null-terminated string containing
the full or relative path name (relative to the value of the DW_AT_comp_dir
attribute, see below) of the primary source file from which the compilation
unit was derived.
...
That looks incorrect. It's a relative path name, so it's relative to
/home/vries/gdb_versions/devel, which makes it
/home/vries/gdb_versions/devel/tui-layout-asm-short-prog.S, which is a
non-existent file.
For comparison, we have with dwarf 4 instead:
...
<19> DW_AT_name :
/home/vries/gdb_versions/devel/src/gdb/testsuite/gdb.tui/tui-layout-asm-short-prog.S
<1d> DW_AT_comp_dir : /home/vries/gdb_versions/devel
...
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/28629] New: [gas, --gdwarf-5] File 0 has wrong dir,
vries at gcc dot gnu.org <=
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, vries at gcc dot gnu.org, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, vries at gcc dot gnu.org, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, vries at gcc dot gnu.org, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, cvs-commit at gcc dot gnu.org, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, vries at gcc dot gnu.org, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, vries at gcc dot gnu.org, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, hjl.tools at gmail dot com, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, cvs-commit at gcc dot gnu.org, 2021/11/26
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, jeffreyalaw at gmail dot com, 2021/11/28
- [Bug gas/28629] [gas, --gdwarf-5] File 0 has wrong dir, cvs-commit at gcc dot gnu.org, 2021/11/28