public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "rguenth at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug debug/98776] DW_AT_low_pc is inconsistent with function entry address, when enabling -fpatchable-function-entry
Date: Wed, 30 Jun 2021 08:06:37 +0000	[thread overview]
Message-ID: <bug-98776-4-MryHg0hAEL@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98776-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to Martin Liška from comment #5)
> (In reply to Richard Biener from comment #4)
> > Martin, can you bisect what fixed it?
> 
> Sure. Please help me how to verify what is a correct output? Isn't that
> related to DWARF 5 change done in GCC 11?

It's consistent with -gdwarf-2 -gstrict-dwarf as well, so no.

A broken executable will output a short disassembly from gdb:


> gcc-10 t.c -g -O -fpatchable-function-entry=16
> gdb -ex 'disassemble foo' -batch ./a.out | wc -l
3

actual output is

Dump of assembler code for function foo:
   0x00000000004004a6 <+0>:     ret    
End of assembler dump.

where a correctly working one is

> gdb -ex 'disassemble foo' -batch ./a.out | wc -l
19

with output

Dump of assembler code for function foo:
   0x0000000000400476 <+0>:     nop
   0x0000000000400477 <+1>:     nop
   0x0000000000400478 <+2>:     nop
   0x0000000000400479 <+3>:     nop
   0x000000000040047a <+4>:     nop
   0x000000000040047b <+5>:     nop
   0x000000000040047c <+6>:     nop
   0x000000000040047d <+7>:     nop
   0x000000000040047e <+8>:     nop
   0x000000000040047f <+9>:     nop
   0x0000000000400480 <+10>:    nop
   0x0000000000400481 <+11>:    nop
   0x0000000000400482 <+12>:    nop
   0x0000000000400483 <+13>:    nop
   0x0000000000400484 <+14>:    nop
   0x0000000000400485 <+15>:    nop
   0x0000000000400486 <+16>:    ret    
End of assembler dump.

  parent reply	other threads:[~2021-06-30  8:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-21  6:32 [Bug debug/98776] New: " lvlin at mail dot ustc.edu.cn
2021-03-31 10:21 ` [Bug debug/98776] " rearnsha at gcc dot gnu.org
2021-06-29 17:06 ` luis.machado at linaro dot org
2021-06-30  6:28 ` rguenth at gcc dot gnu.org
2021-06-30  6:28 ` rguenth at gcc dot gnu.org
2021-06-30  7:12 ` marxin at gcc dot gnu.org
2021-06-30  8:06 ` rguenth at gcc dot gnu.org [this message]
2021-06-30  8:20 ` marxin at gcc dot gnu.org
2021-06-30  8:27 ` rguenth at gcc dot gnu.org
2022-09-29 20:50 ` spop at gcc dot gnu.org
2022-12-01  3:11 ` spop at gcc dot gnu.org
2022-12-08 17:12 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:08 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:10 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:12 ` cvs-commit at gcc dot gnu.org
2022-12-15 15:15 ` spop at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98776-4-MryHg0hAEL@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).