public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/107513] [Feature Request] Implement __attribute__((__nodebug__))
Date: Wed, 02 Nov 2022 21:32:16 +0000	[thread overview]
Message-ID: <bug-107513-4-q1SJETuQ2h@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-107513-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Roy Jacobson from comment #2)
> I might be using it wrong? But it doesn't seem to do anything:
> https://godbolt.org/z/9bdKhz4E7
> 
> It would be nice to at least avoid having the function's name in the binary,
> clang does it with nodebug.

because it does something different really.
It is not used to reduce debug info but rather to make the debugging experience
better.

It marks the inlined function with DW_AT_artificial.


        .byte   0x1   # DW_AT_decl_file (/app/example.cpp)
        .byte   0x2   # DW_AT_decl_line
        .long   0x35  # DW_AT_type
        .byte   0x3   # DW_AT_inline
        .byte   0x1   # DW_AT_artificial

That is it is actually better than Clang's nodebug for debuggability reasons.

In my view nodebug is a hack rather than actually use DW_AT_artificial
correctly.

  parent reply	other threads:[~2022-11-02 21:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-02 20:59 [Bug c++/107513] New: " roi.jacobson1 at gmail dot com
2022-11-02 21:06 ` [Bug c++/107513] " pinskia at gcc dot gnu.org
2022-11-02 21:23 ` roi.jacobson1 at gmail dot com
2022-11-02 21:32 ` pinskia at gcc dot gnu.org [this message]
2022-11-02 22:13 ` redi at gcc dot gnu.org
2022-11-03 10:34 ` roi.jacobson1 at gmail dot com
2023-10-31  3:14 ` redi at gcc dot gnu.org
2023-11-01 14:08 ` redi 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-107513-4-q1SJETuQ2h@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).