public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug debug/102481] New: Incorrect source file path in debuginfo for assembly file specified with relative path
@ 2021-09-25  4:32 roc at ocallahan dot org
  2021-09-25  5:55 ` [Bug debug/102481] " pinskia at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: roc at ocallahan dot org @ 2021-09-25  4:32 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102481

            Bug ID: 102481
           Summary: Incorrect source file path in debuginfo for assembly
                    file specified with relative path
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: debug
          Assignee: unassigned at gcc dot gnu.org
          Reporter: roc at ocallahan dot org
  Target Milestone: ---

Steps to reproduce:

$ cat > /tmp/test.S
.global foo
foo:
    ret
$ cd /tmp/obj
$ mkdir /tmp/obj
$ gcc -g -c - o test.o ../test.S
$ dwarfdump -i test.o

I get

UNIT<header overall offset = 0x00000000>:
< 0><0x0000000c>  DW_TAG_compile_unit
                    DW_AT_stmt_list             <.debug_line+0x00000000>
                    DW_AT_low_pc                0x00000000
                    DW_AT_high_pc               <offset-from-lowpc>1
                    DW_AT_name                  test.S
                    DW_AT_comp_dir              /tmp/obj
                    DW_AT_producer              GNU AS 2.37.50
                    DW_AT_language              DW_LANG_Mips_Assembler

This indicates the source file is at /tmp/obj/test.S, which is incorrect. If I
call the assembler directly, I get correct output:

$ as -g -o test.o ../test.S
$ dwarfdump -i test.o

UNIT<header overall offset = 0x00000000>:
< 0><0x0000000b>  DW_TAG_compile_unit
                    DW_AT_stmt_list             <.debug_line+0x00000000>
                    DW_AT_low_pc                0x00000000
                    DW_AT_high_pc               0x00000001
                    DW_AT_name                  ../test.S
                    DW_AT_comp_dir              /tmp/obj
                    DW_AT_producer              GNU AS 2.37.50
                    DW_AT_language              DW_LANG_Mips_Assembler

gcc version is 11.2.1 20210728 (Red Hat 11.2.1-1).

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug debug/102481] Incorrect source file path in debuginfo for assembly file specified with relative path
  2021-09-25  4:32 [Bug debug/102481] New: Incorrect source file path in debuginfo for assembly file specified with relative path roc at ocallahan dot org
@ 2021-09-25  5:55 ` pinskia at gcc dot gnu.org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-09-25  5:55 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102481

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |MOVED

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
This is a binutils bug (or feature dealing with dwarf5):
ubuntu@ubuntu:/tmp/obj\# as -g -o test.o ../test.S
ubuntu@ubuntu:/tmp/obj\# dwarfdump -i test.o

.debug_info

COMPILE_UNIT<header overall offset = 0x00000000>:
< 0><0x0000000b>  DW_TAG_compile_unit
                    DW_AT_stmt_list             0x00000000
                    DW_AT_low_pc                0x00000000
                    DW_AT_high_pc               0x00000004
                    DW_AT_name                  ../test.S
                    DW_AT_comp_dir              /tmp/obj
                    DW_AT_producer              GNU AS 2.37
                    DW_AT_language              DW_LANG_Mips_Assembler

ubuntu@ubuntu:/tmp/obj\# as -g -o test.o ../test.S -gdwarf-5
ubuntu@ubuntu:/tmp/obj\# dwarfdump -i test.o

.debug_info

COMPILE_UNIT<header overall offset = 0x00000000>:
< 0><0x0000000c>  DW_TAG_compile_unit
                    DW_AT_stmt_list             0x00000000
                    DW_AT_low_pc                0x00000000
                    DW_AT_high_pc               <offset-from-lowpc>0x00000004
                    DW_AT_name                  test.S
                    DW_AT_comp_dir              /tmp/obj
                    DW_AT_producer              GNU AS 2.37
                    DW_AT_language              DW_LANG_Mips_Assembler

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-09-25  5:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-25  4:32 [Bug debug/102481] New: Incorrect source file path in debuginfo for assembly file specified with relative path roc at ocallahan dot org
2021-09-25  5:55 ` [Bug debug/102481] " pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).