public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/108905] New: Debugging information refers to the wrong file
@ 2023-02-23 15:22 lveyde at redhat dot com
  2023-02-23 15:40 ` [Bug debug/108905] Debugging information refers to the wrong file with function defined in toplevel inline-asm pinskia at gcc dot gnu.org
  2023-02-23 23:49 ` lveyde at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: lveyde at redhat dot com @ 2023-02-23 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108905
           Summary: Debugging information refers to the wrong file
           Product: gcc
           Version: 11.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lveyde at redhat dot com
  Target Milestone: ---

It seems GCC sometimes injects wrong DWARF information regarding the source
file and line.

In particular this shows itself in case of some Linux kernel symbols, for
example __SCT__x86_pmu_handle_irq.


$ /tmp/binutils-gdb/binutils/addr2line -fie vmlinux 0xffffffff81c00290
__SCT__x86_pmu_handle_irq
/tmp/linux-5.15.95/./arch/x86/include/asm/paravirt.h:10


In reality this symbol is generated by macro on line 63 of
arch/x86/events/core.c
 source file.

Please note:
https://sourceware.org/bugzilla/show_bug.cgi?id=30150#c24
and
https://sourceware.org/bugzilla/show_bug.cgi?id=30150#c29

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

* [Bug debug/108905] Debugging information refers to the wrong file with function defined in toplevel inline-asm
  2023-02-23 15:22 [Bug c/108905] New: Debugging information refers to the wrong file lveyde at redhat dot com
@ 2023-02-23 15:40 ` pinskia at gcc dot gnu.org
  2023-02-23 23:49 ` lveyde at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-02-23 15:40 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Debugging information       |Debugging information
                   |refers to the wrong file    |refers to the wrong file
                   |                            |with function defined in
                   |                            |toplevel inline-asm
           Keywords|                            |inline-asm
          Component|c                           |debug

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
GCC does not generate debug info for top level inline-asm. It is up to the user
of such things to do the .line, .file, etc.

So I think this is not a bug overall.

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

* [Bug debug/108905] Debugging information refers to the wrong file with function defined in toplevel inline-asm
  2023-02-23 15:22 [Bug c/108905] New: Debugging information refers to the wrong file lveyde at redhat dot com
  2023-02-23 15:40 ` [Bug debug/108905] Debugging information refers to the wrong file with function defined in toplevel inline-asm pinskia at gcc dot gnu.org
@ 2023-02-23 23:49 ` lveyde at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: lveyde at redhat dot com @ 2023-02-23 23:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Lev Veyde <lveyde at redhat dot com> ---
So the incorrect filename and line comes from not setting it properly in inline
assembly the macro resolves to?

So it's basically an issue in the Linux kernel source code?

I tried to add .line to the inline assembly code and it didn't really had any
effect on the compiled kernel, as far as debugging info for the symbol is
concerned. However I'm not 100% certain that I did it correctly.

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

end of thread, other threads:[~2023-02-23 23:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-23 15:22 [Bug c/108905] New: Debugging information refers to the wrong file lveyde at redhat dot com
2023-02-23 15:40 ` [Bug debug/108905] Debugging information refers to the wrong file with function defined in toplevel inline-asm pinskia at gcc dot gnu.org
2023-02-23 23:49 ` lveyde at redhat dot com

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).